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

Constructor & Destructor Documentation

◆ CalHardwareModel()

CalHardwareModel::CalHardwareModel ( CalCoreModel * pCoreModel)

Constructs the hardware model instance.

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

Member Function Documentation

◆ getAmbientColor()

void CalHardwareModel::getAmbientColor ( unsigned char * pColorBuffer) const

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.

◆ getBaseVertexIndex()

int CalHardwareModel::getBaseVertexIndex ( ) const

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.

◆ getBoneCount()

int CalHardwareModel::getBoneCount ( ) const

Returns the number of bone.

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

Returns
The number of bone.

◆ getDiffuseColor()

void CalHardwareModel::getDiffuseColor ( unsigned char * pColorBuffer) const

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.

◆ getFaceCount()

int CalHardwareModel::getFaceCount ( ) const

Returns the number of faces.

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

Returns
The number of faces.

◆ getHardwareMeshCount()

int CalHardwareModel::getHardwareMeshCount ( ) const

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.

◆ getMapUserData() [1/2]

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 happened

◆ getMapUserData() [2/2]

const Cal::UserData CalHardwareModel::getMapUserData ( int mapId) const

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 happened

◆ getRotationBoneSpace()

const CalQuaternion & CalHardwareModel::getRotationBoneSpace ( int boneId,
CalSkeleton * pSkeleton ) const

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.

◆ getShininess()

float CalHardwareModel::getShininess ( ) const

Returns the shininess factor.

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

Returns
The shininess factor.

◆ getSpecularColor()

void CalHardwareModel::getSpecularColor ( unsigned char * pColorBuffer) const

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.

◆ getStartIndex()

int CalHardwareModel::getStartIndex ( ) const

Returns the start index.

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

Returns
a integer with the start index.

◆ getTotalFaceCount()

int CalHardwareModel::getTotalFaceCount ( ) const

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.

◆ getTotalVertexCount()

int CalHardwareModel::getTotalVertexCount ( ) const

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.

◆ getTranslationBoneSpace()

const CalVector & CalHardwareModel::getTranslationBoneSpace ( int boneId,
CalSkeleton * pSkeleton ) const

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.

◆ getVectorHardwareMesh() [1/2]

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.

◆ getVectorHardwareMesh() [2/2]

const std::vector< CalHardwareModel::CalHardwareMesh > & CalHardwareModel::getVectorHardwareMesh ( ) const

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.

◆ getVertexCount()

int CalHardwareModel::getVertexCount ( ) const

Returns the number of vertex.

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

Returns
The number of vertex.

◆ load()

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 happened

◆ selectHardwareMesh()

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 happened

◆ setCoreMeshIds()

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

◆ setIndexBuffer()

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.

◆ setMatrixIndexBuffer()

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

◆ setNormalBuffer()

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

◆ setTangentSpaceBuffer()

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

◆ setTextureCoordBuffer()

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

◆ setTextureCoordNum()

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.

◆ setVertexBuffer()

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

◆ setWeightBuffer()

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 by The Cal3D Team with Doxygen 1.10.0