#import <CC3VertexSkinning.h>
Instance Methods | |
(CC3Face) | - deformedFaceAt: |
(CC3Vector) | - deformedFaceCenterAt: |
(CC3Vector) | - deformedFaceNormalAt: |
(CC3Plane) | - deformedFacePlaneAt: |
(CC3Vector) | - deformedVertexLocationAt:fromFaceAt: |
Properties | |
BOOL | hasRigidSkeleton |
BOOL | hasSkeleton |
CC3MeshNode extension to define polymorphic methods to support vertex skinning.
- (CC3Face) deformedFaceAt: | (GLuint) | faceIndex |
Returns the face from the mesh at the specified index.
If the vertices of this mesh node represent the skin covering the bones of a soft-body, the vertex locations of the returned face take into consideration the current deformation caused by motion of the bones underlying the this skin mesh. Otherwise, this method returns the same value as the faceAt: method.
In either case, the vertex locations of the returned face are specified in the local coordinate system of this node.
The specified faceIndex value refers to the index of the face, not the vertices themselves. So, a value of 5 will retrieve the three vertices that make up the fifth triangular face in this mesh. The specified index must be between zero, inclusive, and the value of the faceCount property, exclusive.
The returned face structure contains only the locations of the vertices. If the vertex locations are interleaved with other vertex data, such as color or texture coordinates, or other padding, that data will not appear in the returned face structure. For that remaining vertex data, you can use the faceIndicesAt: method to retrieve the indices of the vertex data, and then use the vertex accessor methods to retrieve the individual vertex data components.
Extends class CC3MeshNode.
- (CC3Vector) deformedFaceCenterAt: | (GLuint) | faceIndex |
Returns the center of the mesh face at the specified index.
If the vertices of this mesh node represent the skin covering the bones of a soft-body, the returned location takes into consideration the current deformation caused by motion of the bones underlying the this skin mesh. The returned location is the center of the face in its location and orientation after the skin has been deformed by the current position of the underlying bones. Otherwise, this method returns the same value as the faceCenterAt: method.
In either case, the returned face center is specified in the local coordinate system of this node.
Extends class CC3MeshNode.
- (CC3Vector) deformedFaceNormalAt: | (GLuint) | faceIndex |
Returns the normal of the mesh face at the specified index.
If the vertices of this mesh node represent the skin covering the bones of a soft-body, the returned normal takes into consideration the current deformation caused by motion of the bones underlying the this skin mesh. The returned vector is the normal of the face in its orientation after the skin has been deformed by the current position of the underlying bones. Otherwise, this method returns the same value as the faceNormalAt: method.
In either case, the returned face normal is specified in the local coordinate system of this node.
Extends class CC3MeshNode.
- (CC3Plane) deformedFacePlaneAt: | (GLuint) | faceIndex |
Returns the plane of the mesh face at the specified index.
If the vertices of this mesh node represent the skin covering the bones of a soft-body, the returned plane takes into consideration the current deformation caused by motion of the bones underlying the this skin mesh. The returned plane is the plane of the face in its location and orientation after the skin has been deformed by the current position of the underlying bones. Otherwise, this method returns the same value as the facePlaneAt: method.
In either case, the returned face plane is specified in the local coordinate system of this node.
Extends class CC3MeshNode.
- (CC3Vector) deformedVertexLocationAt: | (GLuint) | vertexIndex | |
fromFaceAt: | (GLuint) | faceIndex | |
Returns the vertex from the mesh at the specified vtxIndex, that is within the face at the specified faceIndex.
If the vertices of this mesh node represent the skin covering the bones of a soft-body, the returned vertex location takes into consideration the current deformation caused by motion of the bones underlying the this skin mesh. Otherwise, this method returns the same value as the vertexLocationAt: method.
In either case, the returned vertex location is specified in the local coordinate system of this node.
The specified faceIndex value refers to the index of the face that contains the vertex. It is required to determine the skin section whose bones are deforming the vertex location at the specified vertex index. The specified faceIndex must be between zero, inclusive, and the value of the faceCount property, exclusive.
The specified vtxIndex must be between zero, inclusive, and the value of the vertexCount property, exclusive.
Extends class CC3MeshNode.
|
readnonatomicassign |
Returns whether the skeletal structures controlling any descendant skinned mesh nodes are composed of bones that undergo only rigid transforms, relative to their nearest ancestor soft-body node.
The initial value of this property is NO. It is set to YES when the ensureRigidSkeleton method is invoked on this node, or an ancestor node, and this mesh node has a skeleton (as indicated by the hasSkeleton property of this node).
When the bones in a skeleton contain only rigid transforms, the vertices in the skin-mesh node can be transformed within a shader using rotations and transforms, instead of a full transform matrix. This allows for many more bones to be transferred to the shader program during a single GL draw call, which increases performance in many larger meshes.
Consequently, the value of this property affects the choice of shader that will be selected automatically for this node.
Extends class CC3MeshNode.
|
readnonatomicassign |
Returns whether the vertices of this mesh node are influenced by a skeleton of bones.
Vertex skinning (also known as bone-rigging) is a technique of manipulating, or deforming, the vertices of a mesh through the movement of a skeleton of bones.
This implementation returns NO. Subclasses that support vertex skinning (notably the CC3SkinMeshNode subclass) will return YES if the vertices are influenced by a skeleton of bone nodes.
Extends class CC3MeshNode.