Public Member Functions | Static Public Member Functions

obj::Model Class Reference
[OBJ 3D Models]

#include <obj-model.h>

Inheritance diagram for obj::Model:
Inheritance graph
[legend]
Collaboration diagram for obj::Model:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Model (void) throw ()
virtual void render (IN const render_context_t &rc, IN RenderQueue *rq)=0
 this method is called to actually draw the object.
virtual rect3d_t getBoundingBox (void) const =0 throw ()
 here the object must provide a bounding box.
virtual bool isAnimateable (void) const throw ()
 does this object support animations? Default answer is false.
virtual void getAnimationState (OUT std::string &state)
 the object must provide current animation state.
virtual bool setAnimationState (IN const char *state)
 the object should update its animation state.
virtual void getAnimationVerbs (OUT VecString &verbs)
 the object should return the full list of animation verbs it supports.
virtual bool setAnimation (IN const char *verb)
 please update animations based on requested verb.

Static Public Member Functions

static smart_ptr< Modelcreate (IN nstream::Stream *stream, IN float scale)
 loads an OBJ scene object (aiScene) which can render itself

Detailed Description

Definition at line 82 of file obj-model.h.


Constructor & Destructor Documentation

obj::Model::~Model ( void   )  throw () [virtual]

Definition at line 40 of file obj-model.cpp.


Member Function Documentation

virtual void glut::Renderable::render ( IN const render_context_t rc,
IN RenderQueue rq 
) [pure virtual, inherited]

this method is called to actually draw the object.

The object can assume that all necessary transforms (translation, rotation, scaling, etc.) have already been applied. There is no default implementation since this method is the whole point of the interface!

Implemented in glut::model_t, and glut::lod_model_t.

virtual rect3d_t glut::Renderable::getBoundingBox ( void   )  const throw () [pure virtual, inherited]

here the object must provide a bounding box.

This is a bounding box in model-relative coordinates, not world coordinates. So this bounding box does not depend on where the model is positioned or how it is rotated, for instance. There is no default implementation since an accurate bounding box is critical for performance when rendering.

Implemented in glut::model_t, and glut::lod_model_t.

bool glut::Renderable::isAnimateable ( void   )  const throw () [virtual, inherited]

does this object support animations? Default answer is false.

(random aside: did you know "animateable" is not a word?)

Definition at line 168 of file renderable.cpp.

void glut::Renderable::getAnimationState ( OUT std::string &  state  )  [virtual, inherited]

the object must provide current animation state.

Default implementation returns empty state string.

Definition at line 181 of file renderable.cpp.

bool glut::Renderable::setAnimationState ( IN const char *  state  )  [virtual, inherited]

the object should update its animation state.

Returns false if the object doesn't understand the provided state. Default implementation returns false.

Definition at line 192 of file renderable.cpp.

void glut::Renderable::getAnimationVerbs ( OUT VecString &  verbs  )  [virtual, inherited]

the object should return the full list of animation verbs it supports.

The default implementation returns an empty list.

Definition at line 205 of file renderable.cpp.

bool glut::Renderable::setAnimation ( IN const char *  verb  )  [virtual, inherited]

please update animations based on requested verb.

Returns false if verb is not supported. Default implementation returns false.

Definition at line 216 of file renderable.cpp.


The documentation for this class was generated from the following files: