CC3Bone is the building block of skeletons that control the deformation of a skin mesh. More...
#import <CC3VertexSkinning.h>
Public Member Functions | |
(void) | - applyPoseTo: |
Properties | |
CC3Matrix * | restPoseInvertedMatrix |
CC3Bone is the building block of skeletons that control the deformation of a skin mesh.
When building a skeleton, bones are assembled in a structural assembly, from a root bone out to limb or branch bones. For example, a skeleton for a human character might start with a root spine bone, to which are attached upper-arm and thigh bones, to which are attached, forearm and shin bones, to which are attached hand and foot bones, and so on.
In this structual assembly, moving an upper-arm bone to cause the character to reach out, carries the forearm and hand bones along with it. Movement of the forearm bone is then performed relative to the upper-arm bone, and movement of the hand bone is performed relative to the forearm, and so on.
CC3Bones are simply specialized structural nodes, and have no content of their own to draw. However, individual bones are referenced by skin sections of the skin mesh node, and the transform matrices of the bones influence the transformations of the vertices of the skin mesh, as the skeleton moves. The applyPoseTo: method handles applying the transform matrix of the bone to the transform matrix for the skin mesh vertices.
- (void) applyPoseTo: | (CC3Matrix *) | boneMatrix |
Applies the changes to the current transform of this bone, relative to the rest pose of this bone, to the specified matrix.
The specified bone matrix (BM) is populated from the following components:
as follows:
BM = B * Brsb(-1)
The existing contents of the specified boneMatrix are ignored, and it is populated from the above calculation.
- (CC3Matrix *) restPoseInvertedMatrix [read, retain] |
Returns the cached inverted rest pose matrix.
This is the transform matrix of this bone when it is in its rest pose, which is the location and rotation that corresponds to the undeformed skin mesh. Changes to the transform of this bone, relative to the rest pose, will deform the mesh to create soft-body movement of the mesh vertices.
The value of this property is set when the bindRestPose method is invoked.