CC3VertexBoneWeights Class Reference
Inherits from | CC3VertexArray : CC3Identifiable : NSObject |
Declared in | CC3VertexArrays.h |
Overview
A CC3VertexArray that manages a collection of bone weights for each vertex. Each bone weight indicates how much that particular bone influences the movement of the vertex for a mesh that uses vertex skinning. Vertex skinning is the manipulation of a soft-body mesh under control of a skeleton of bone nodes.
For each vertex, the bone to which the weight should be applied is identified by the bone index specified in the corresponding entry in the CC3VertexBoneIndices vertex array.
This vertex array works together with an instace of a CC3VertexBoneIndices vertex array. The elementSize property of the two vertex arrays must be equal, and under OpenGL ES 1.1, must not be larger than the maximum number of available bone influences allowed by the platform, which can be retreived from CC3OpenGL.sharedGL.maxNumberOfBoneInfluencesPerVertex.
Instance Methods
boneWeightsAt:
Returns the weights of all of the bones that influence the movement of the vertex at the specified index within the underlying vertex content.
- (GLfloat *)boneWeightsAt:(GLuint)vtxIndex
Discussion
Several weights are stored for each vertex, one for each bone that influences the movement of the vertex. The number of elements in the returned array is the same for each vertex in this vertex array, as defined by the elementSize property.
The vertex index refers to vertices, not bytes. The implementation takes into consideration the vertexStride and elementOffset properties to access the correct vertices.
If the releaseRedundantContent method has been invoked and the underlying vertex content has been released, this method will raise an assertion exception.
Declared In
CC3VertexArrays.h
setBoneWeights:at:
Sets the weights of all of the bones that influence the movement of the vertex at the specified index within the underlying vertex content.
- (void)setBoneWeights:(GLfloat *)weights at:(GLuint)vtxIndex
Discussion
Several weights are stored for each vertex, one for each bone that influences the movement of the vertex. The number of elements in the specified input array must therefore be at least as large as the value of the elementSize property.
The vertex index refers to vertices, not bytes. The implementation takes into consideration the vertexStride and elementOffset properties to access the correct vertices.
If the releaseRedundantContent method has been invoked and the underlying vertex content has been released, this method will raise an assertion exception.
Declared In
CC3VertexArrays.h
setWeight:forBoneInfluence:at:
Sets the weight value, for the specified influence index within the vertex, for the vertex at the specified index within the underlying vertex content.
- (void)setWeight:(GLfloat)weight forBoneInfluence:(GLuint)influenceIndex at:(GLuint)vtxIndex
Discussion
The weight indicates how much a particular bone influences the movement of the particular vertex. Several weights are stored for each vertex, one for each bone that influences the movement of that vertex. The specified influenceIndex parameter must be between zero, and the elementSize property (inclusive/exclusive respectively).
The vertex index refers to vertices, not bytes. The implementation takes into consideration the vertexStride and elementOffset properties to access the correct element.
If the releaseRedundantContent method has been invoked and the underlying vertex content has been released, this method will raise an assertion exception.
Declared In
CC3VertexArrays.h
setWeight:forVertexUnit:at:
*@deprecated Renamed to setWeight:forBoneInfluence:at:.
- (void)setWeight:(GLfloat)aWeight forVertexUnit:(GLuint)vertexUnit at:(GLuint)index
Declared In
CC3VertexArrays.h
setWeights:at:
*@deprecated Renamed to setBoneWeights:at:.
- (void)setWeights:(GLfloat *)weights at:(GLuint)vtxIndex
Declared In
CC3VertexArrays.h
weightForBoneInfluence:at:
Returns the weight value, for the specified influence index within the vertex, for the vertex at the specified index within the underlying vertex content.
- (GLfloat)weightForBoneInfluence:(GLuint)influenceIndex at:(GLuint)vtxIndex
Discussion
The weight indicates how much a particular bone influences the movement of the particular vertex. Several weights are stored for each vertex, one for each bone that influences the movement of that vertex. The specified influenceIndex parameter must be between zero, and the elementSize property (inclusive/exclusive respectively).
The vertex index refers to vertices, not bytes. The implementation takes into consideration the vertexStride and elementOffset properties to access the correct element.
If the releaseRedundantContent method has been invoked and the underlying vertex content has been released, this method will raise an assertion exception.
Declared In
CC3VertexArrays.h