- Cal3D 0.11 API Reference -

Classes | Public Member Functions | List of all members
CalHardwareModel Class Reference

Classes

struct  CalHardwareMesh
 

Public Member Functions

 CalHardwareModel (CalCoreModel *pCoreModel)
 Constructs the hardware model instance. More...
 
void setVertexBuffer (char *pVertexBuffer, int stride)
 Set the vertex (position) buffer of the hardware model instance. More...
 
void setIndexBuffer (CalIndex *pIndexBuffer)
 Set the index buffer of the hardware model instance. More...
 
void setNormalBuffer (char *pNormalBuffer, int stride)
 Set the normal buffer of the hardware model instance. More...
 
void setWeightBuffer (char *pWeightBuffer, int stride)
 Set the weight buffer of the hardware model instance. More...
 
void setMatrixIndexBuffer (char *pMatrixIndexBuffer, int stride)
 Set the matrix index buffer of the hardware model instance. More...
 
void setTextureCoordNum (int textureCoordNum)
 Set the number the texture coordinate of the hardware model instance. More...
 
void setTextureCoordBuffer (int mapId, char *pTextureCoordBuffer, int stride)
 Set the texture coordinate buffer of the hardware model instance. More...
 
void setTangentSpaceBuffer (int mapId, char *pTangentSpaceBuffer, int stride)
 Set the tangent space buffer of the hardware model instance. More...
 
void setCoreMeshIds (const std::vector< int > &coreMeshIds)
 Set the list of core mesh ids to use for building the hardware model instance. More...
 
bool load (int baseVertexIndex, int startIndex, int maxBonesPerMesh)
 Compute the information needed to use the hardware model . More...
 
std::vector< CalHardwareMesh > & getVectorHardwareMesh ()
 Returns the hardware mesh vector. More...
 
void getAmbientColor (unsigned char *pColorBuffer)
 Provides access to the ambient color. More...
 
void getDiffuseColor (unsigned char *pColorBuffer)
 Provides access to the diffuse color. More...
 
void getSpecularColor (unsigned char *pColorBuffer)
 Provides access to the specular color. More...
 
const CalQuaterniongetRotationBoneSpace (int boneId, CalSkeleton *pSkeleton)
 Returns the bone space rotation of the bone boneId. More...
 
const CalVectorgetTranslationBoneSpace (int boneId, CalSkeleton *pSkeleton)
 Returns the bone space translation of the bone boneId. More...
 
float getShininess ()
 Returns the shininess factor. More...
 
int getHardwareMeshCount ()
 Returns the number of hardware meshes. More...
 
int getFaceCount ()
 Returns the number of faces. More...
 
int getVertexCount ()
 Returns the number of vertex. More...
 
int getBoneCount ()
 Returns the number of bone. More...
 
int getBaseVertexIndex ()
 Returns the base vertex index. More...
 
int getStartIndex ()
 Returns the start index. More...
 
int getTotalFaceCount ()
 Returns the number of faces in the hardware model instance. More...
 
int getTotalVertexCount ()
 Returns the number of vertices in the hardware model instance. More...
 
Cal::UserData getMapUserData (int mapId)
 Provides access to a specified map user data. More...
 
bool selectHardwareMesh (size_t meshId)
 Selects a hardware mesh for rendering data queries. More...
 

Constructor & Destructor Documentation

CalHardwareModel::CalHardwareModel ( CalCoreModel pCoreModel)

Constructs the hardware model instance.

This function is the default constructor of the hardware model instance.

Member Function Documentation

void CalHardwareModel::getAmbientColor ( unsigned char *  pColorBuffer)

Provides access to the ambient color.

This function returns the ambient color of the material of the selected hardware mesh.

Parameters
pColorBufferA pointer to the user-provided buffer where the color data is written to.
int CalHardwareModel::getBaseVertexIndex ( )

Returns the base vertex index.

This function returns the base vertex index of the selected hardware mesh instance.

Returns
a integer with the base vertex index.
int CalHardwareModel::getBoneCount ( )

Returns the number of bone.

This function returns the number of bone in the selected hardware mesh instance.

Returns
The number of bone.
void CalHardwareModel::getDiffuseColor ( unsigned char *  pColorBuffer)

Provides access to the diffuse color.

This function returns the diffuse color of the material of the selected hardware mesh.

Parameters
pColorBufferA pointer to the user-provided buffer where the color data is written to.
int CalHardwareModel::getFaceCount ( )

Returns the number of faces.

This function returns the number of faces in the selected hardware mesh instance.

Returns
The number of faces.
int CalHardwareModel::getHardwareMeshCount ( )

Returns the number of hardware meshes.

This function returns the number of hardware meshes in the hardware model instance.

Returns
The number of hardware meshes.
Cal::UserData CalHardwareModel::getMapUserData ( int  mapId)

Provides access to a specified map user data.

This function returns the user data stored in the specified map of the material of the selected hardware mesh.

Parameters
mapIdThe ID of the map.
Returns
One of the following values:
  • the user data stored in the specified map
  • 0 if an error happend
const CalQuaternion & CalHardwareModel::getRotationBoneSpace ( int  boneId,
CalSkeleton pSkeleton 
)

Returns the bone space rotation of the bone boneId.

This function returns the rotation to bring a point into the bone instance space of the bone boneId of the selected hardware mesh.

Parameters
boneIdA integer with the bone number
Returns
The rotation to bring a point into bone space.
float CalHardwareModel::getShininess ( )

Returns the shininess factor.

This function returns the shininess factor of the material of the selected hardware mesh..

Returns
The shininess factor.
void CalHardwareModel::getSpecularColor ( unsigned char *  pColorBuffer)

Provides access to the specular color.

This function returns the specular color of the material of the selected hardware.

Parameters
pColorBufferA pointer to the user-provided buffer where the color data is written to.
int CalHardwareModel::getStartIndex ( )

Returns the start index.

This function returns the start index of the selected hardware mesh instance.

Returns
a integer with the start index.
int CalHardwareModel::getTotalFaceCount ( )

Returns the number of faces in the hardware model instance.

This function returns the number of faces in the hardware model instance.

Returns
The number of faces.
int CalHardwareModel::getTotalVertexCount ( )

Returns the number of vertices in the hardware model instance.

This function returns the number of vertices in the hardware model instance.

Returns
The number of vertices.
const CalVector & CalHardwareModel::getTranslationBoneSpace ( int  boneId,
CalSkeleton pSkeleton 
)

Returns the bone space translation of the bone boneId.

This function returns the translation to bring a point into the bone instance space of the bone boneId of the selected hardware mesh.

Parameters
boneIdA integer with the bone number
Returns
The translation to bring a point into bone space.
std::vector< CalHardwareModel::CalHardwareMesh > & CalHardwareModel::getVectorHardwareMesh ( )

Returns the hardware mesh vector.

This function returns the vector that contains all hardware mesh of the core mesh instance.

Returns
A reference to the hardware mesh vector.
int CalHardwareModel::getVertexCount ( )

Returns the number of vertex.

This function returns the number of vertex in the selected hardware mesh instance.

Returns
The number of vertex.
bool CalHardwareModel::load ( int  baseVertexIndex,
int  startIndex,
int  maxBonesPerMesh 
)

Compute the information needed to use the hardware model .

This function Compute the information needed to use the hardware model, it fill vertex buffers with the model data

Parameters
baseVertexIndexThe base vertex Index.
startIndexThe start index.
maxBonesPerMeshThe maximun of bone by hardware mesh
Returns
One of the following values:
  • true if succeed
  • false if an error happend
bool CalHardwareModel::selectHardwareMesh ( size_t  meshId)

Selects a hardware mesh for rendering data queries.

This function selects a hardware mesh for further rendering data queries.

Parameters
meshIdThe ID of the hardware mesh that should be used for further rendering data queries.
Returns
One of the following values:
  • true if successful
  • false if an error happend
void CalHardwareModel::setCoreMeshIds ( const std::vector< int > &  coreMeshIds)

Set the list of core mesh ids to use for building the hardware model instance.

setCoreMeshIds must be called before the load method otherwise it will have no effect. If setCoreMeshIds is not called, the hardware model instance will use all the core mesh ids from the core model.

Parameters
coreMeshIdsa vector of core mesh ids
void CalHardwareModel::setIndexBuffer ( CalIndex *  pIndexBuffer)

Set the index buffer of the hardware model instance.

This function set the index buffer the hardware model instance.

Parameters
pIndexBufferA pointer to the index buffer.
void CalHardwareModel::setMatrixIndexBuffer ( char *  pMatrixIndexBuffer,
int  stride 
)

Set the matrix index buffer of the hardware model instance.

This function set the matrix index buffer the hardware model instance.

Parameters
pMatrixIndexBufferA pointer to the matrix index buffer.
strideThe number of byte to add to find the next element
void CalHardwareModel::setNormalBuffer ( char *  pNormalBuffer,
int  stride 
)

Set the normal buffer of the hardware model instance.

This function set the normal buffer the hardware model instance.

Parameters
pNormalBufferA pointer to the normal buffer.
strideThe number of byte to add to find the next element
void CalHardwareModel::setTangentSpaceBuffer ( int  mapId,
char *  pTangentSpaceBuffer,
int  stride 
)

Set the tangent space buffer of the hardware model instance.

This function set the tangent space buffer the hardware model instance.

Parameters
mapIdA integer to the texture stage
pTangentSpaceBufferA pointer to the tangent space buffer.
strideThe number of byte to add to find the next element
void CalHardwareModel::setTextureCoordBuffer ( int  mapId,
char *  pTextureCoordBuffer,
int  stride 
)

Set the texture coordinate buffer of the hardware model instance.

This function set the texture coordinate buffer the hardware model instance.

Parameters
mapIdA integer to the texture stage
pTextureCoordBufferA pointer to the texture coord buffer.
strideThe number of byte to add to find the next element
void CalHardwareModel::setTextureCoordNum ( int  textureCoordNum)

Set the number the texture coordinate of the hardware model instance.

This function set the number the texture coordinate the hardware model instance.

Parameters
textureCoordNumA integer with the number the texture coordinate.
void CalHardwareModel::setVertexBuffer ( char *  pVertexBuffer,
int  stride 
)

Set the vertex (position) buffer of the hardware model instance.

This function set the vertex (position) buffer the hardware model instance.

Parameters
pVertexBufferA pointer to the vertex buffer.
strideThe number of byte to add to find the next element
void CalHardwareModel::setWeightBuffer ( char *  pWeightBuffer,
int  stride 
)

Set the weight buffer of the hardware model instance.

This function set the weight buffer the hardware model instance.

Parameters
pWeightBufferA pointer to the weight buffer.
strideThe number of byte to add to find the next element

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

Generated at Sat Aug 16 2014 01:39:52 by The Cal3D Team with Doxygen 1.8.7