- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

# CalSubmesh Class Reference

The submesh class. More...

`#include <submesh.h>`

List of all members.

## Public Member Functions

| CalSubmesh ()
| Constructs the submesh instance.
virtual | ~CalSubmesh ()
| Destructs the submesh instance.
bool | create (CalCoreSubmesh *pCoreSubmesh)
| Creates the submesh instance.
void | destroy ()
| Destroys the submesh instance.
CalCoreSubmesh * | getCoreSubmesh ()
| Provides access to the core submesh.
int | getCoreMaterialId ()
| Returns the core material ID.
int | getFaceCount ()
| Returns the number of faces.
int | getFaces (CalIndex *pFaceBuffer)
| Provides access to the face data.
std::vector< CalVector > & | getVectorNormal ()
| Returns the normal vector.
std::vector< std::vector< TangentSpace > > & | getVectorVectorTangentSpace ()
| Returns the tangent space vector-vector.
std::vector< PhysicalProperty > & | getVectorPhysicalProperty ()
| Returns the physical property vector.
std::vector< CalVector > & | getVectorVertex ()
| Returns the vertex vector.
int | getVertexCount ()
| Returns the number of vertices.
bool | hasInternalData ()
| Returns if the submesh instance handles vertex data internally.
void | disableInternalData ()
| Disable internal data (and thus springs system).
void | setCoreMaterialId (int coreMaterialId)
| Sets the core material ID.
void | setLodLevel (float lodLevel)
| Sets the LOD level.
bool | isTangentsEnabled (int mapId)
| Returns true if tangent vectors are enabled.
bool | enableTangents (int mapId, bool enabled)
| Enables (and calculates) or disables the storage of tangent spaces.
std::vector< float > & | getVectorWeight ()
void | setMorphTargetWeight (int blendId, float weight)
| Sets weight of a morph target with the given id.
float | getMorphTargetWeight (int blendId)
| Gets weight of a morph target with the given id.
float | getBaseWeight ()
| Gets weight of the base vertices.
int | getMorphTargetWeightCount ()
| Returns the number of weights.
std::vector< float > & | getVectorMorphTargetWeight ()
| Returns the morph target weight vector.

## Protected Attributes

CalCoreSubmesh * | m_pCoreSubmesh
std::vector< float > | m_vectorMorphTargetWeight
std::vector< CalVector > | m_vectorVertex
std::vector< CalVector > | m_vectorNormal
std::vector< std::vector< TangentSpace > > | m_vectorvectorTangentSpace
std::vector< Face > | m_vectorFace
std::vector< PhysicalProperty > | m_vectorPhysicalProperty
int | m_vertexCount
int | m_faceCount
int | m_coreMaterialId
bool | m_bInternalData

## Detailed Description

The submesh class.

## Constructor & Destructor Documentation

CalSubmesh::CalSubmesh | ( |  | ) |

| Constructs the submesh instance. This function is the default constructor of the submesh instance.

CalSubmesh::~CalSubmesh | ( |  | ) | `[virtual]`

| Destructs the submesh instance. This function is the destructor of the submesh instance.

## Member Function Documentation

bool CalSubmesh::create | ( | CalCoreSubmesh * | pCoreSubmesh | ) |

| Creates the submesh instance. This function creates the submesh instance based on a core submesh.

Parameters:

  pCoreSubmesh | A pointer to the core submesh on which this submesh instance should be based on.

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

void CalSubmesh::destroy | ( |  | ) |

| Destroys the submesh instance. This function destroys all data stored in the submesh instance and frees all allocated memory.

bool CalSubmesh::enableTangents | ( | int | mapId,
|  | bool | enabled
| ) |

| Enables (and calculates) or disables the storage of tangent spaces. This function enables or disables the storage of tangent space bases.

float CalSubmesh::getBaseWeight | ( |  | ) |

| Gets weight of the base vertices.

Returns:
  The weight of the base vertices.

int CalSubmesh::getCoreMaterialId | ( |  | ) |

| Returns the core material ID. This function returns the core material ID of the submesh instance.

Returns:
  One of the following values:
  - the ID of the core material
  - -1 if an error happend

CalCoreSubmesh * CalSubmesh::getCoreSubmesh | ( |  | ) |

| Provides access to the core submesh. This function returns the core submesh on which this submesh instance is based on.

Returns:
  One of the following values:
  - a pointer to the core submesh
  - 0 if an error happend

int CalSubmesh::getFaceCount | ( |  | ) |

| Returns the number of faces. This function returns the number of faces in the submesh instance.

Returns:
  The number of faces.

int CalSubmesh::getFaces | ( | CalIndex * | pFaceBuffer | ) |

| Provides access to the face data. This function returns the face data (vertex indices) of the submesh instance. The LOD setting of the submesh instance is taken into account.

Parameters:

  pFaceBuffer | A pointer to the user-provided buffer where the face data is written to.

Returns:
  The number of faces written to the buffer.

float CalSubmesh::getMorphTargetWeight | ( | int | blendId | ) |

| Gets weight of a morph target with the given id.

Parameters:

  blendId | The morph target id.

Returns:
  The weight of the morph target.

int CalSubmesh::getMorphTargetWeightCount | ( |  | ) |

| Returns the number of weights. This function returns the number of weights.

Returns:
  The number of weights.

std::vector< float > & CalSubmesh::getVectorMorphTargetWeight | ( |  | ) |

| Returns the morph target weight vector. This function returns the vector that contains all weights for each morph target instance.

Returns:
  A reference to the weight vector.

std::vector< CalVector > & CalSubmesh::getVectorNormal | ( |  | ) |

| Returns the normal vector. This function returns the vector that contains all normals of the submesh instance.

Returns:
  A reference to the normal vector.

std::vector< CalSubmesh::PhysicalProperty > & CalSubmesh::getVectorPhysicalProperty | ( |  | ) |

| Returns the physical property vector. This function returns the vector that contains all physical properties of the submesh instance.

Returns:
  A reference to the physical property vector.

std::vector< std::vector< CalSubmesh::TangentSpace > > & CalSubmesh::getVectorVectorTangentSpace | ( |  | ) |

| Returns the tangent space vector-vector. This function returns the vector that contains all tangent space bases of the submesh instance. This vector contains another vector because there can be more than one texture map at each vertex.

Returns:
  A reference to the tangent space vector-vector.

std::vector< CalVector > & CalSubmesh::getVectorVertex | ( |  | ) |

| Returns the vertex vector. This function returns the vector that contains all vertices of the submesh instance.

Returns:
  A reference to the vertex vector.

int CalSubmesh::getVertexCount | ( |  | ) |

| Returns the number of vertices. This function returns the number of vertices in the submesh instance.

Returns:
  The number of vertices.

bool CalSubmesh::hasInternalData | ( |  | ) |

| Returns if the submesh instance handles vertex data internally. This function returns wheter the submesh instance handles vertex data internally.

Returns:
  One of the following values:
  - true if vertex data is handled internally
  - false if not

bool CalSubmesh::isTangentsEnabled | ( | int | mapId | ) |

| Returns true if tangent vectors are enabled. This function returns true if the submesh contains tangent vectors.

Returns:
  True if tangent vectors are enabled.

void CalSubmesh::setCoreMaterialId | ( | int | coreMaterialId | ) |

| Sets the core material ID. This function sets the core material ID of the submesh instance.

Parameters:

  coreMaterialId | The core material ID that should be set.

void CalSubmesh::setLodLevel | ( | float | lodLevel | ) |

| Sets the LOD level. This function sets the LOD level of the submesh instance.

Parameters:

  lodLevel | The LOD level in the range [0.0, 1.0].

void CalSubmesh::setMorphTargetWeight | ( | int | blendId,
|  | float | weight
| ) |

| Sets weight of a morph target with the given id.

Parameters:

  blendId | The morph target id.
  weight | The weight to be set.

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

- submesh.h
- submesh.cpp

Generated at Wed Apr 7 16:57:18 2004 by The Cal3D Team with 1.3.6 © 1997-2001 Dimitri van Heesch