- Cal3D 0.11 API 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... | |
const std::vector< CalHardwareMesh > & | getVectorHardwareMesh () const |
Returns the hardware mesh vector. More... | |
void | getAmbientColor (unsigned char *pColorBuffer) const |
Provides access to the ambient color. More... | |
void | getDiffuseColor (unsigned char *pColorBuffer) const |
Provides access to the diffuse color. More... | |
void | getSpecularColor (unsigned char *pColorBuffer) const |
Provides access to the specular color. More... | |
const CalQuaternion & | getRotationBoneSpace (int boneId, CalSkeleton *pSkeleton) const |
Returns the bone space rotation of the bone boneId. More... | |
const CalVector & | getTranslationBoneSpace (int boneId, CalSkeleton *pSkeleton) const |
Returns the bone space translation of the bone boneId. More... | |
float | getShininess () const |
Returns the shininess factor. More... | |
int | getHardwareMeshCount () const |
Returns the number of hardware meshes. More... | |
int | getFaceCount () const |
Returns the number of faces. More... | |
int | getVertexCount () const |
Returns the number of vertex. More... | |
int | getBoneCount () const |
Returns the number of bone. More... | |
int | getBaseVertexIndex () const |
Returns the base vertex index. More... | |
int | getStartIndex () const |
Returns the start index. More... | |
int | getTotalFaceCount () const |
Returns the number of faces in the hardware model instance. More... | |
int | getTotalVertexCount () const |
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... | |
const Cal::UserData | getMapUserData (int mapId) const |
Provides access to a specified map user data. More... | |
bool | selectHardwareMesh (size_t meshId) |
Selects a hardware mesh for rendering data queries. More... | |
CalHardwareModel::CalHardwareModel | ( | CalCoreModel * | pCoreModel | ) |
Constructs the hardware model instance.
This function is the default constructor of the hardware model instance.
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.
pColorBuffer | A pointer to the user-provided buffer where the color data is written to. |
int CalHardwareModel::getBaseVertexIndex | ( | ) | const |
Returns the base vertex index.
This function returns the base vertex index of the selected hardware mesh instance.
int CalHardwareModel::getBoneCount | ( | ) | const |
Returns the number of bone.
This function returns the number of bone in the selected hardware mesh instance.
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.
pColorBuffer | A pointer to the user-provided buffer where the color data is written to. |
int CalHardwareModel::getFaceCount | ( | ) | const |
Returns the number of faces.
This function returns the number of faces in the selected hardware mesh instance.
int CalHardwareModel::getHardwareMeshCount | ( | ) | const |
Returns the number of hardware meshes.
This function returns the number of hardware meshes in the hardware model instance.
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.
mapId | The ID of the map. |
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.
mapId | The ID of the map. |
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.
boneId | A integer with the bone number |
float CalHardwareModel::getShininess | ( | ) | const |
Returns the shininess factor.
This function returns the shininess factor of the material of the selected hardware mesh..
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.
pColorBuffer | A pointer to the user-provided buffer where the color data is written to. |
int CalHardwareModel::getStartIndex | ( | ) | const |
Returns the start index.
This function returns the start index of the selected hardware mesh instance.
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.
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.
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.
boneId | A integer with the bone number |
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.
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.
int CalHardwareModel::getVertexCount | ( | ) | const |
Returns the number of vertex.
This function returns the number of vertex in the selected hardware mesh instance.
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
baseVertexIndex | The base vertex Index. |
startIndex | The start index. |
maxBonesPerMesh | The maximun of bone by hardware mesh |
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.
meshId | The ID of the hardware mesh that should be used for further rendering data queries. |
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.
coreMeshIds | a 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.
pIndexBuffer | A 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.
pMatrixIndexBuffer | A pointer to the matrix index buffer. |
stride | The 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.
pNormalBuffer | A pointer to the normal buffer. |
stride | The 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.
mapId | A integer to the texture stage |
pTangentSpaceBuffer | A pointer to the tangent space buffer. |
stride | The 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.
mapId | A integer to the texture stage |
pTextureCoordBuffer | A pointer to the texture coord buffer. |
stride | The 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.
textureCoordNum | A 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.
pVertexBuffer | A pointer to the vertex buffer. |
stride | The 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.
pWeightBuffer | A pointer to the weight buffer. |
stride | The number of byte to add to find the next element |