Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WPCG::WP_Model Class Reference

#include <WP_Model.h>

Inheritance diagram for WPCG::WP_Model:

WPCG::WP_AnimatedModel WPCG::WP_NonAnimatedModel WPCG::WP_Model_MD2 WPCG::WP_MetaBall List of all members.

Public Methods

 WP_Model ()
 WP_Model (const string &name)
 WP_Model (const WP_Model &model)
virtual ~WP_Model ()
WP_Model & operator= (const WP_Model &model)
virtual void drawOpenGL (const WP_Matrix3D &matrix, WP_Object *object)=0
virtual bool initModel ()=0
bool init ()
virtual OPCODE_Model * getCollisionModel (const WP_Object *object)=0
virtual WP_VertexgetVertex (const WP_Object *object, unsigned int index)=0

Public Attributes

string model_name
int numberTriangles
unsigned int * triangles
int numberVertices
int count
GLint tex_id

Protected Methods

virtual bool finalizeAll ()=0

Friends

class WP_Frame

Detailed Description

this abstract class represents a 3D model which is used in WP_Object to composite a 3D entity. The model is only the 3D shape, its textures, its bounding hull for collision detection. A WP_Object contains far more, it can contain for instance among others mass, heading, velocity etc etc


Constructor & Destructor Documentation

WPCG::WP_Model::WP_Model  
 

WPCG::WP_Model::WP_Model const string &    name [inline]
 

Parameters:
the  name of the model to load

WPCG::WP_Model::WP_Model const WP_Model &    model
 

WPCG::WP_Model::~WP_Model   [virtual]
 


Member Function Documentation

virtual void WPCG::WP_Model::drawOpenGL const WP_Matrix3D   matrix,
WP_Object   object
[pure virtual]
 

this function draws the model according to its world matrix into the 3D scene

Parameters:
matrix  a WP_Matrix3D object representing the world matrix of the model indicating where and how the model is rendered into the scene

Implemented in WPCG::WP_NonAnimatedModel.

virtual bool WPCG::WP_Model::finalizeAll   [protected, pure virtual]
 

this function finalizes all after the model was read and everything was initialized. It for instance builds the collision mesh

Implemented in WPCG::WP_NonAnimatedModel.

virtual OPCODE_Model* WPCG::WP_Model::getCollisionModel const WP_Object   object [pure virtual]
 

Implemented in WPCG::WP_NonAnimatedModel.

virtual WP_Vertex* WPCG::WP_Model::getVertex const WP_Object   object,
unsigned int    index
[pure virtual]
 

Implemented in WPCG::WP_NonAnimatedModel.

bool WPCG::WP_Model::init  
 

this function must be called to init the model. This is based on the Template design pattern.

virtual bool WPCG::WP_Model::initModel   [pure virtual]
 

this virtual function should be overriden by child objects. In this function the model must be read and the model's internals must be filled (like for example the meshes, the material etc). Every 3d file format stores this information in a different way there this function can be used to substract the necessary data from it.

Implemented in WPCG::WP_NonAnimatedModel.

WP_Model & WPCG::WP_Model::operator= const WP_Model &    model
 


Friends And Related Function Documentation

friend class WP_Frame [friend]
 


Member Data Documentation

int WPCG::WP_Model::count
 

the number of objects using this model, this is used by the WP_ObjectManager object. The model is only discarted by the object manager if this value is zero. This is a so called reference count

string WPCG::WP_Model::model_name
 

the name of the model

int WPCG::WP_Model::numberTriangles
 

int WPCG::WP_Model::numberVertices
 

the number of vertices in the model

GLint WPCG::WP_Model::tex_id
 

the OpenGL texture ID of the texture belonging to this model

unsigned int* WPCG::WP_Model::triangles
 

indices into the vertices array, so every three indices make up a triangle


The documentation for this class was generated from the following files:
Generated on Tue Jan 28 20:26:41 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002