- 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.
void | getAmbientColor (unsigned char *pColorBuffer)
| Provides access to the ambient color.
void | getDiffuseColor (unsigned char *pColorBuffer)
| Provides access to the diffuse color.
void | getSpecularColor (unsigned char *pColorBuffer)
| Provides access to the specular color.
const CalQuaternion & | getRotationBoneSpace (int boneId, CalSkeleton *pSkeleton)
| Returns the bone space rotation of the bone boneId.
const CalVector & | getTranslationBoneSpace (int boneId, CalSkeleton *pSkeleton)
| Returns the bone space translation of the bone boneId.
float | getShininess ()
| Returns the shininess factor.
int | getHardwareMeshCount ()
| Returns the number of hardware meshes.
int | getFaceCount ()
| Returns the number of faces.
int | getVertexCount ()
| Returns the number of vertex.
int | getBoneCount ()
| Returns the number of bone.
int | getBaseVertexIndex ()
| Returns the base vertex index.
int | getStartIndex ()
| Returns the start index.
int | getTotalFaceCount ()
| Returns the number of faces in the hardware model instance.
int | getTotalVertexCount ()
| Returns the number of vertices in the hardware model instance.
Cal::UserData | getMapUserData (int mapId)
| 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 | ) |

Provides access to the ambient color.

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

Parameters

  pColorBuffer | A pointer to the user-provided buffer where the color data is written to.

## ◆ getBaseVertexIndex()

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.

## ◆ getBoneCount()

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.

## ◆ getDiffuseColor()

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

  pColorBuffer | A pointer to the user-provided buffer where the color data is written to.

## ◆ getFaceCount()

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.

## ◆ getHardwareMeshCount()

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.

## ◆ getMapUserData()

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

  mapId | The ID of the map.

Returns
  One of the following values:
  - the user data stored in the specified map
  - 0 if an error happend

## ◆ getRotationBoneSpace()

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

  boneId | A integer with the bone number

Returns
  The rotation to bring a point into bone space.

## ◆ getShininess()

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.

## ◆ getSpecularColor()

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

  pColorBuffer | A pointer to the user-provided buffer where the color data is written to.

## ◆ getStartIndex()

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.

## ◆ getTotalFaceCount()

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.

## ◆ getTotalVertexCount()

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.

## ◆ getTranslationBoneSpace()

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

  boneId | A integer with the bone number

Returns
  The translation to bring a point into bone space.

## ◆ getVectorHardwareMesh()

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.

## ◆ getVertexCount()

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.

## ◆ 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

  baseVertexIndex | The base vertex Index.
  startIndex | The start index.
  maxBonesPerMesh | The maximun of bone by hardware mesh

Returns
  One of the following values:
  - true if succeed
  - false if an error happend

## ◆ 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

  meshId | The 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

## ◆ 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

  coreMeshIds | a 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

  pIndexBuffer | A 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

  pMatrixIndexBuffer | A pointer to the matrix index buffer.
  stride | The 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

  pNormalBuffer | A pointer to the normal buffer.
  stride | The 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

  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

## ◆ 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

  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

## ◆ 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

  textureCoordNum | A 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

  pVertexBuffer | A pointer to the vertex buffer.
  stride | The 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

  pWeightBuffer | A pointer to the weight buffer.
  stride | The number of byte to add to find the next element

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

- hardwaremodel.h
- hardwaremodel.cpp

Generated by The Cal3D Team with Doxygen 1.15.0