- Cal3D 0.11 API Reference -

Classes | Public Member Functions | List of all members
CalSubmesh Class Reference

Classes

struct  Face
 
struct  PhysicalProperty
 
struct  TangentSpace
 

Public Member Functions

 CalSubmesh (CalCoreSubmesh *coreSubmesh)
 
CalCoreSubmeshgetCoreSubmesh ()
 Provides access to the core submesh. More...
 
const CalCoreSubmeshgetCoreSubmesh () const
 Provides access to the core submesh. More...
 
int getCoreMaterialId () const
 Returns the core material ID. More...
 
int getFaceCount () const
 Returns the number of faces. More...
 
int getFaces (CalIndex *pFaceBuffer) const
 Provides access to the face data. More...
 
std::vector< CalVector > & getVectorNormal ()
 Returns the normal vector. More...
 
const std::vector< CalVector > & getVectorNormal () const
 Returns the normal vector. More...
 
std::vector< std::vector< TangentSpace > > & getVectorVectorTangentSpace ()
 Returns the tangent space vector-vector. More...
 
const std::vector< std::vector< TangentSpace > > & getVectorVectorTangentSpace () const
 Returns the tangent space vector-vector. More...
 
std::vector< PhysicalProperty > & getVectorPhysicalProperty ()
 Returns the physical property vector. More...
 
const std::vector< PhysicalProperty > & getVectorPhysicalProperty () const
 Returns the physical property vector. More...
 
std::vector< CalVector > & getVectorVertex ()
 Returns the vertex vector. More...
 
const std::vector< CalVector > & getVectorVertex () const
 Returns the vertex vector. More...
 
int getVertexCount () const
 Returns the number of vertices. More...
 
bool hasInternalData () const
 Returns if the submesh instance handles vertex data internally. More...
 
void disableInternalData ()
 Disable internal data (and thus springs system) More...
 
void setCoreMaterialId (int coreMaterialId)
 Sets the core material ID. More...
 
void setLodLevel (float lodLevel)
 Sets the LOD level. More...
 
bool isTangentsEnabled (int mapId) const
 Returns true if tangent vectors are enabled. More...
 
bool enableTangents (int mapId, bool enabled)
 Enables (and calculates) or disables the storage of tangent spaces. More...
 
void setMorphTargetWeight (int blendId, float weight)
 Sets weight of a morph target with the given id. More...
 
float getMorphTargetWeight (int blendId) const
 Gets weight of a morph target with the given id. More...
 
void setMorphTargetWeight (const unsigned int &morphName, float weight)
 Sets weight of a morph target with the given name. More...
 
int getMorphTargetWeightCount () const
 Returns the number of weights. More...
 
bool getMorphTargetWeight (const unsigned int &morphName, float *weightOut)
 Gets weight of a morph target with the given name. More...
 
void getMorphIdAndWeightArray (MorphIdAndWeight *arrayResult, unsigned int *numMiawsResult, unsigned int maxMiaws)
 
float getBaseWeight () const
 Gets weight of the base vertices. More...
 
std::vector< float > & getVectorMorphTargetWeight ()
 Returns the morph target weight vector. More...
 
const std::vector< float > & getVectorMorphTargetWeight () const
 Returns the morph target weight vector. More...
 
void clearMorphTargetScales ()
 Clears the scale of each morph target. More...
 
void clearMorphTargetState (const unsigned int &morphName)
 
void blendMorphTargetScale (const unsigned int &morphName, float scale, float unrampedWeight, float rampValue, bool replace)
 Sets weight of a morph target with the given name. More...
 
void setSubMorphTargetGroupAttenuatorArray (unsigned int len, int const *morphTargetIdArray)
 
void setSubMorphTargetGroupAttenuationArray (unsigned int len, float const *attenuationArray)
 

Member Function Documentation

◆ blendMorphTargetScale()

void CalSubmesh::blendMorphTargetScale ( const unsigned int &  morphName,
float  scale,
float  unrampedWeight,
float  rampValue,
bool  replace 
)

Sets weight of a morph target with the given name.

Parameters
morphNameThe morph target name.
scaleScale from -inf to inf scales magnitude.
unrampedWeightThe blending weight, not incorporating ramp value
rampValueAmount to attenuate weight when ramping in/out the animation.
replaceIf true, all blends except one Replace blend will have their weight attenuated by 1 - rampValue of that Replace blend.

◆ clearMorphTargetScales()

void CalSubmesh::clearMorphTargetScales ( )

Clears the scale of each morph target.

Call this in preparation for calling blendMorphTargetScale() on the individual morph targets. As a side effect, this also clears the "weight" that setMorphTargetWeight() sets. The functions clear/blendMorphTargetScale() and setMorphTargetWeight() both set the influence of the morph target, but call it by different names (scale vs. weight) and have different composition behavior. Call one set of functions or the other.

◆ disableInternalData()

void CalSubmesh::disableInternalData ( )

Disable internal data (and thus springs system)

◆ enableTangents()

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.

◆ getBaseWeight()

float CalSubmesh::getBaseWeight ( ) const

Gets weight of the base vertices.

Returns
The weight of the base vertices.

◆ getCoreMaterialId()

int CalSubmesh::getCoreMaterialId ( ) const

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 happened

◆ getCoreSubmesh() [1/2]

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 happened

◆ getCoreSubmesh() [2/2]

const CalCoreSubmesh * CalSubmesh::getCoreSubmesh ( ) const

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 happened

◆ getFaceCount()

int CalSubmesh::getFaceCount ( ) const

Returns the number of faces.

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

Returns
The number of faces.

◆ getFaces()

int CalSubmesh::getFaces ( CalIndex *  pFaceBuffer) const

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
pFaceBufferA pointer to the user-provided buffer where the face data is written to.
Returns
The number of faces written to the buffer.

◆ getMorphTargetWeight() [1/2]

float CalSubmesh::getMorphTargetWeight ( int  blendId) const

Gets weight of a morph target with the given id.

Parameters
blendIdThe morph target id.
Returns
The weight of the morph target.

◆ getMorphTargetWeight() [2/2]

bool CalSubmesh::getMorphTargetWeight ( const unsigned int &  morphName,
float *  weightOut 
)

Gets weight of a morph target with the given name.

Parameters
morphNameThe morph target name
weightOutfills in the weight on success
Returns
true on success, false otherwise

◆ getMorphTargetWeightCount()

int CalSubmesh::getMorphTargetWeightCount ( ) const

Returns the number of weights.

This function returns the number of weights.

Returns
The number of weights.

◆ getVectorMorphTargetWeight() [1/2]

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.

◆ getVectorMorphTargetWeight() [2/2]

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

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.

◆ getVectorNormal() [1/2]

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.

◆ getVectorNormal() [2/2]

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

Returns the normal vector.

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

Returns
A reference to the normal vector.

◆ getVectorPhysicalProperty() [1/2]

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.

◆ getVectorPhysicalProperty() [2/2]

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

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.

◆ getVectorVectorTangentSpace() [1/2]

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.

◆ getVectorVectorTangentSpace() [2/2]

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

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.

◆ getVectorVertex() [1/2]

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.

◆ getVectorVertex() [2/2]

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

Returns the vertex vector.

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

Returns
A reference to the vertex vector.

◆ getVertexCount()

int CalSubmesh::getVertexCount ( ) const

Returns the number of vertices.

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

Returns
The number of vertices.

◆ hasInternalData()

bool CalSubmesh::hasInternalData ( ) const

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

◆ isTangentsEnabled()

bool CalSubmesh::isTangentsEnabled ( int  mapId) const

Returns true if tangent vectors are enabled.

This function returns true if the submesh contains tangent vectors.

Returns
True if tangent vectors are enabled.

◆ setCoreMaterialId()

void CalSubmesh::setCoreMaterialId ( int  coreMaterialId)

Sets the core material ID.

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

Parameters
coreMaterialIdThe core material ID that should be set.

◆ setLodLevel()

void CalSubmesh::setLodLevel ( float  lodLevel)

Sets the LOD level.

This function sets the LOD level of the submesh instance.

Parameters
lodLevelThe LOD level in the range [0.0, 1.0].

◆ setMorphTargetWeight() [1/2]

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

Sets weight of a morph target with the given id.

Parameters
blendIdThe morph target id.
weightThe weight to be set.

◆ setMorphTargetWeight() [2/2]

void CalSubmesh::setMorphTargetWeight ( const unsigned int &  morphName,
float  weight 
)

Sets weight of a morph target with the given name.

Parameters
morphNameThe morph target name.
weightThe weight to be set.

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

Generated by The Cal3D Team with Doxygen 1.8.14