Public Member Functions | Properties

CC3DeformedFaceArray Class Reference

CC3DeformedFaceArray extends CC3FaceArray to hold the deformed positions of each vertex. More...

#import <CC3VertexSkinning.h>

Inheritance diagram for CC3DeformedFaceArray:
Inheritance graph
[legend]
Collaboration diagram for CC3DeformedFaceArray:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(CC3Vector *) - allocateDeformedVertexLocations
(void) - clearDeformableCaches
(void) - deallocateDeformedVertexLocations
(CC3Vector- deformedVertexLocationAt:fromFaceAt:
(void) - markDeformedVertexLocationsDirty
(void) - populateDeformedVertexLocations

Properties

CC3VectordeformedVertexLocations
CC3SkinMeshNodenode
GLuint vertexCount

Detailed Description

CC3DeformedFaceArray extends CC3FaceArray to hold the deformed positions of each vertex.

From this, the deformed shape and orientation of each face in the mesh can be retrieved.

If configured to cache the face data (if the shouldCacheFaces is set to YES), the instance will register as a transform listener with the skin mesh node, so that the faces can be rebuilt if the skin mesh node or any of the bones move.


Member Function Documentation

- (CC3Vector*) allocateDeformedVertexLocations

Allocates underlying memory for the deformedVertexLocations property, and returns a pointer to the allocated memory.

This method will allocate enough memory for the deformedVertexLocations property to hold the number of CC3Vector structures specified by the vertexCount property.

This method is invoked automatically by the populateDeformedVertexLocations method. Usually, the application never needs to invoke this method directly.

It is safe to invoke this method more than once, but understand that any previously allocated memory will be safely released prior to the allocation of the new memory. The memory allocated earlier will therefore be lost and should not be referenced.

The memory allocated will automatically be released when this instance is deallocated.

- (void) clearDeformableCaches

Clears any caches that contain deformable information.

This includes deformed vertices, plus face centers, normals and planes.

- (void) deallocateDeformedVertexLocations

Deallocates the underlying memory that was previously allocated with the allocateDeformedVertexLocations method.

It is safe to invoke this method more than once, or even if the allocateDeformedVertexLocations method was not previously invoked.

This method is invoked automatically when allocateDeformedVertexLocations is invoked, and when this instance is deallocated. Usually, the application never needs to invoke this method directly.

- (CC3Vector) deformedVertexLocationAt: (GLuint)  vertexIndex
fromFaceAt: (GLuint)  faceIndex 

Returns the deformed vertex location of the face at the specified vertex index, that is contained in the face with the specified index, lazily initializing the deformedVertexLocations property if needed.

- (void) markDeformedVertexLocationsDirty

Marks the deformed vertices data as dirty.

It will be automatically repopulated on the next access.

- (void) populateDeformedVertexLocations

Populates the contents of the deformedVertexLocations property from the associated mesh, automatically allocating memory for the property if needed.

This method is invoked automatically on the first access of the deformedVertexLocations property after the node property has been set. Usually, the application never needs to invoke this method directly.

However, if the deformedVertexLocations property has been set to an array created outside this instance, this method may be invoked to populate that array from the mesh.


Property Documentation

- (CC3Vector *) deformedVertexLocations [read, write, assign]

An array containing the vertex locations of the underlying mesh, as deformed by the current position and orientation of the bones.

This property will be lazily initialized on the first access after the node property has been set, by an automatic invocation of the populateDeformedVertexLocations method. When created in this manner, the memory allocated to hold the data in the returned array will be managed by this instance.

Alternately, this property may be set directly to an array that was created externally. In this case, the underlying data memory is not managed by this instance, and it is up to the application to manage the allocation and deallocation of the underlying data memory, and to ensure that the array is large enough to contain the number of CC3Vector structures specified by the vertexCount property.

- (CC3SkinMeshNode *) node [read, write, assign]

The skin mesh node containing the vertices for which this face array is managing faces.

Setting this property will also set the mesh property, and will cause the deformedVertexLocations, centers, normals, planes and neighbours properties to be deallocated and then re-built on the next access.

- (GLuint) vertexCount [read, assign]

Indicates the number of vertices in the deformedVertexLocations array, as retrieved from the mesh.

The value of this property will be zero until either the node or mesh properties are set.


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