sgObject Class Reference

#include <sgObject.h>

List of all members.

Public Member Functions

 sgObject (sgObject *p, sgObject *n)
sgObjectcreateObject (const char *name)
void cloneMaterial (unsigned int mat)
void setAnimation (const char *name, float percent)
void destroy ()
void destroyAll ()
void updateModel ()

Public Attributes

sgVector3 position
sgQuaternion rotation
sgVector3 scale
sgMatrix4x4 matmodel
sgMatrix4x4 matnormal
std::vector< sgMaterial * > materials
std::vector< sgMesh * > meshs
sgObjectnext
sgObjectprev

Detailed Description

Object class. Responsible for object handling.


Constructor & Destructor Documentation

sgObject::sgObject ( sgObject p,
sgObject n 
)

Constructor. Creates an empty object.

Parameters:
p the previous object in the linked object list
n the next object in the linked object list

Member Function Documentation

void sgObject::cloneMaterial ( unsigned int  mat  ) 

Clone material. Makes the given material a clone from the previous one, to allow independant materials for objects of the same type.

Parameters:
mat index of the material to clone
sgObject * sgObject::createObject ( const char *  name  ) 

Create object. Creates a new object loaded from a model file or a predefined name and makes it next of this.

Parameters:
name name of the object or the file to load it from
Returns:
pointer to the new object
void sgObject::destroy (  ) 

Destroy. Destroys this object.

void sgObject::destroyAll (  ) 

Destroy All. Destroys this and all objects connected to it.

void sgObject::setAnimation ( const char *  name,
float  percent 
)

Set animation. Sets the meshes given animation frame.

Parameters:
name name of the animation
percent position within the animation in percent
void sgObject::updateModel (  ) 

Update model. Updates this objects model transformation matrix. This function is called automatically before rendering.


Member Data Documentation

Materials. A vector of the materials. There have to be as many materials as meshes, where each mesh is rendered with the material at the same position as the mesh in the mesh array.

Model matrix. The transformation matrix of this object.

Normal matrix. The normal transformation matrix of this object.

std::vector<sgMesh*> sgObject::meshs

Meshs. A vector of the meshs. There have to be as many meshes as materials, where each mesh is rendered with the material at the same position in the material array.

Next. Pointer to the next object within the object list or NULL if there is none.

Position. The position of this object.

Previous. Pointer to the previous object within the object list or NULL if there is none.

Rotation. The rotation of this object as quaternion.

Scale. The scale of this object.


The documentation for this class was generated from the following files:
Generated on Thu Jun 3 13:31:04 2010 for iSDGE by  doxygen 1.6.3