- Cal3D 0.11 API Reference -

Public Member Functions | List of all members
CalRenderer Class Reference

Public Member Functions

 CalRenderer (CalModel *pModel)
 Constructs the renderer instance.
 
 CalRenderer (CalRenderer *pRenderer)
 Copy-constructor for the renderer instance.
 
bool beginRendering ()
 Initializes the rendering query phase.
 
void endRendering ()
 Finishes the rendering query phase.
 
void getAmbientColor (unsigned char *pColorBuffer) const
 Provides access to the ambient color.
 
void getDiffuseColor (unsigned char *pColorBuffer) const
 Provides access to the diffuse color.
 
int getFaceCount () const
 Returns the number of faces.
 
int getFaces (CalIndex *pFaceBuffer) const
 Provides access to the face data.
 
int getMapCount () const
 Returns the number of maps.
 
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.
 
int getMeshCount () const
 Returns the number of attached meshes.
 
int getNormals (float *pNormalBuffer, int stride=0) const
 Provides access to the normal data.
 
float getShininess () const
 Returns the shininess factor.
 
void getSpecularColor (unsigned char *pColorBuffer) const
 Provides access to the specular color.
 
int getSubmeshCount (int meshId) const
 Returns the number of submeshes.
 
int getTextureCoordinates (int mapId, float *pTextureCoordinateBuffer, int stride=0) const
 Provides access to the texture coordinate data.
 
int getVertexCount () const
 Returns the number of vertices.
 
int getVertices (float *pVertexBuffer, int stride=0) const
 Provides access to the vertex data.
 
int getTangentSpaces (int mapId, float *pTangentSpaceBuffer, int stride=0) const
 Provides access to the tangent space data.
 
int getVertColors (float *pVertexBuffer)
 Provides access to the vertex colors.
 
int getVertColorsAsStandardPixels (unsigned int *pVertexBuffer)
 
int getVerticesAndNormals (float *pVertexBuffer, int stride=0) const
 Provides access to the submesh data.
 
int getVerticesNormalsAndTexCoords (float *pVertexBuffer, int NumTexCoords=1) const
 Provides access to the submesh data.
 
bool isTangentsEnabled (int mapId) const
 Returns if tangent are enabled.
 
bool selectMeshSubmesh (int meshId, int submeshId)
 Selects a mesh/submesh for rendering data queries.
 
void setNormalization (bool normalize)
 Sets the normalization flag to true or false.
 
bool textureCoordinatesForMapValid (int mapId)
 Returns true if texture coordinates exist for the given map.
 
bool hasNonWhiteVertexColors ()
 

Constructor & Destructor Documentation

◆ CalRenderer() [1/2]

CalRenderer::CalRenderer ( CalModel * pModel)

Constructs the renderer instance.

This function is the default constructor of the renderer instance.

◆ CalRenderer() [2/2]

CalRenderer::CalRenderer ( CalRenderer * pRenderer)

Copy-constructor for the renderer instance.

This function is the copy constructor of the renderer instance. This is useful for multi-pipe parallel rendering.

Member Function Documentation

◆ beginRendering()

bool CalRenderer::beginRendering ( )

Initializes the rendering query phase.

This function initializes the rendering query phase. It must be called before any rendering queries are executed.

◆ endRendering()

void CalRenderer::endRendering ( )

Finishes the rendering query phase.

This function finishes the rendering query phase. It must be called after all rendering queries have been executed.

◆ getAmbientColor()

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

Provides access to the ambient color.

This function returns the ambient color of the material of the selected mesh/submesh.

Parameters
pColorBufferA pointer to the user-provided buffer where the color data is written to.

◆ getDiffuseColor()

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

Provides access to the diffuse color.

This function returns the diffuse color of the material of the selected mesh/submesh.

Parameters
pColorBufferA pointer to the user-provided buffer where the color data is written to.

◆ getFaceCount()

int CalRenderer::getFaceCount ( ) const

Returns the number of faces.

This function returns the number of faces in the selected mesh/submesh.

Returns
The number of faces.

◆ getFaces()

int CalRenderer::getFaces ( CalIndex * pFaceBuffer) const

Provides access to the face data.

This function returns the face data (vertex indices) of the selected mesh/submesh. The LOD setting is taken into account.

Parameters
pFaceBufferA pointer to the user-provided buffer where the face data is written to.
Returns
The number of faces written to the buffer.

◆ getMapCount()

int CalRenderer::getMapCount ( ) const

Returns the number of maps.

This function returns the number of maps in the selected mesh/submesh.

Returns
The number of maps.

◆ getMapUserData() [1/2]

Cal::UserData CalRenderer::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 mesh/submesh.

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 CalRenderer::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 mesh/submesh.

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

◆ getMeshCount()

int CalRenderer::getMeshCount ( ) const

Returns the number of attached meshes.

This function returns the number of meshes attached to the renderer instance.

Returns
The number of attached meshes.

◆ getNormals()

int CalRenderer::getNormals ( float * pNormalBuffer,
int stride = 0 ) const

Provides access to the normal data.

This function returns the normal data of the selected mesh/submesh.

Parameters
pNormalBufferA pointer to the user-provided buffer where the normal data is written to.
Returns
The number of normals written to the buffer.

◆ getShininess()

float CalRenderer::getShininess ( ) const

Returns the shininess factor.

This function returns the shininess factor of the material of the selected mesh/submesh..

Returns
The shininess factor.

◆ getSpecularColor()

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

Provides access to the specular color.

This function returns the specular color of the material of the selected mesh/submesh.

Parameters
pColorBufferA pointer to the user-provided buffer where the color data is written to.

◆ getSubmeshCount()

int CalRenderer::getSubmeshCount ( int meshId) const

Returns the number of submeshes.

This function returns the number of submeshes in a given mesh.

Parameters
meshIdThe ID of the mesh for which the number of submeshes should be returned..
Returns
The number of submeshes.

◆ getTangentSpaces()

int CalRenderer::getTangentSpaces ( int mapId,
float * pTangentSpaceBuffer,
int stride = 0 ) const

Provides access to the tangent space data.

This function returns the tangent space data of the selected mesh/submesh.

Parameters
mapID
pTangentSpaceBufferA pointer to the user-provided buffer where the normal data is written to.
Returns
The number of tangent space written to the buffer.

◆ getTextureCoordinates()

int CalRenderer::getTextureCoordinates ( int mapId,
float * pTextureCoordinateBuffer,
int stride = 0 ) const

Provides access to the texture coordinate data.

This function returns the texture coordinate data for a given map of the selected mesh/submesh.

Parameters
mapIdThe ID of the map to get the texture coordinate data from.
pTextureCoordinateBufferA pointer to the user-provided buffer where the texture coordinate data is written to.
Returns
The number of texture coordinates written to the buffer.

◆ getVertColors()

int CalRenderer::getVertColors ( float * pVertexBuffer)

Provides access to the vertex colors.

This function returns the vertex colors of the selected mesh/submesh.

Parameters
pVertexBufferA pointer to the user-provided buffer where the vertex colors are written to.
Returns
The number of vertices written to the buffer.

◆ getVertexCount()

int CalRenderer::getVertexCount ( ) const

Returns the number of vertices.

This function returns the number of vertices in the selected mesh/submesh.

Returns
The number of vertices.

◆ getVertices()

int CalRenderer::getVertices ( float * pVertexBuffer,
int stride = 0 ) const

Provides access to the vertex data.

This function returns the vertex data of the selected mesh/submesh.

Parameters
pVertexBufferA pointer to the user-provided buffer where the vertex data is written to.
Returns
The number of vertices written to the buffer.

◆ getVerticesAndNormals()

int CalRenderer::getVerticesAndNormals ( float * pVertexBuffer,
int stride = 0 ) const

Provides access to the submesh data.

This function returns the vertex and normal data of the selected mesh/submesh.

Parameters
pVertexBufferA pointer to the user-provided buffer where the vertex and normal data is written to.
Returns
The number of vertex written to the buffer.

◆ getVerticesNormalsAndTexCoords()

int CalRenderer::getVerticesNormalsAndTexCoords ( float * pVertexBuffer,
int NumTexCoords = 1 ) const

Provides access to the submesh data.

This function returns the vertex and normal data of the selected mesh/submesh.

Parameters
pVertexBufferA pointer to the user-provided buffer where the vertex and normal data is written to.
Returns
The number of vertex written to the buffer.

◆ isTangentsEnabled()

bool CalRenderer::isTangentsEnabled ( int mapId) const

Returns if tangent are enabled.

This function returns if tangent of the current submesh are enabled

Returns
True is tangent is enabled.

◆ selectMeshSubmesh()

bool CalRenderer::selectMeshSubmesh ( int meshId,
int submeshId )

Selects a mesh/submesh for rendering data queries.

This function selects a mesh/submesh for further rendering data queries.

Parameters
meshIdThe ID of the mesh that should be used for further rendering data queries.
submeshIdThe ID of the submesh that should be used for further rendering data queries.
Returns
One of the following values:
  • true if successful
  • false if an error happened

◆ setNormalization()

void CalRenderer::setNormalization ( bool normalize)

Sets the normalization flag to true or false.

This function sets the normalization flag on or off. If off, the normals calculated by Cal3D will not be normalized. Instead, this transform is left up to the user.

◆ textureCoordinatesForMapValid()

bool CalRenderer::textureCoordinatesForMapValid ( int mapId)

Returns true if texture coordinates exist for the given map.

Parameters
mapIdThe ID of the map to test for texture coordinate data.
Returns
true if texture coordinates for the given map are valid.

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

Generated by The Cal3D Team with Doxygen 1.10.0