A concrete CC3NodeAnimation that holds animation data in simple arrays. More...
#import <CC3NodeAnimation.h>
Public Member Functions | |
(CC3Vector *) | - allocateLocations |
(CC3Vector4 *) | - allocateQuaternions |
(CC3Vector *) | - allocateRotations |
(CC3Vector *) | - allocateScales |
(void) | - deallocateLocations |
(void) | - deallocateQuaternions |
(void) | - deallocateRotations |
(void) | - deallocateScales |
Properties | |
CC3Vector * | animatedLocations |
CC3Vector4 * | animatedQuaternions |
CC3Vector * | animatedRotations |
CC3Vector * | animatedScales |
A concrete CC3NodeAnimation that holds animation data in simple arrays.
The arrays can be allocated and managed either by the instance, or externally.
There are four properties that hold the animated data:
You do not need to use all of these properties. You can choose to animate any subset of these animation data properties, and leave the remaining animation data properties set to NULL (the default). If you do not set an animation data property, the corresponding property on the node will not be animated, and will retain its originally set value.
For instance, if you set only the animatedLocations property, and run a CC3Animate on the node, only the location of the node will move around during the animation. The remaining node properties (rotation, quaternion, scale) will remain unchanged by the animation. The effect will be that the node moves around, but remains at a fixed size, and oriented in a fixed rotation.
You can work with these animation data properties in one of two ways:
- (CC3Vector*) allocateLocations |
Allocates underlying memory for an array of location vectors.
All elements of the array are initialized to zero location. The amount of memory allocated will be (frameCount * sizeof(CC3Vector)) bytes.
It is safe to invoke this method more than once, but understand that any previously allocated memory will be safely freed prior to the allocation of the new memory. The memory allocated earlier will therefore be lost and should not be referenced.
- (CC3Vector4*) allocateQuaternions |
Allocates underlying memory for an array of quaternions vectors.
All elements of the array are initialized to the identity quaternion. The amount of memory allocated will be (frameCount * sizeof(CC3Vector4)) bytes.
It is safe to invoke this method more than once, but understand that any previously allocated memory will be safely freed prior to the allocation of the new memory. The memory allocated earlier will therefore be lost and should not be referenced.
- (CC3Vector*) allocateRotations |
Allocates underlying memory for an array of rotation vectors.
All elements of the array are initialized to zero rotation. The amount of memory allocated will be (frameCount * sizeof(CC3Vector)) bytes.
It is safe to invoke this method more than once, but understand that any previously allocated memory will be safely freed prior to the allocation of the new memory. The memory allocated earlier will therefore be lost and should not be referenced.
- (CC3Vector*) allocateScales |
Allocates underlying memory for an array of scale vectors.
All elements of the array are initialized to unity scale. The amount of memory allocated will be (frameCount * sizeof(CC3Vector)) bytes.
It is safe to invoke this method more than once, but understand that any previously allocated memory will be safely freed prior to the allocation of the new memory. The memory allocated earlier will therefore be lost and should not be referenced.
- (void) deallocateLocations |
Deallocates the underlying location array allocated with the allocateLocations.
It is safe to invoke this method more than once, or even if allocateLocations was not previously invoked.
This method is invoked automatically when this instance is deallocated.
- (void) deallocateQuaternions |
Deallocates the underlying quaternion array allocated with the allocateQuaternions.
It is safe to invoke this method more than once, or even if allocateQuaternions was not previously invoked.
This method is invoked automatically when this instance is deallocated.
- (void) deallocateRotations |
Deallocates the underlying rotation array allocated with the allocateRotations.
It is safe to invoke this method more than once, or even if allocateRotations was not previously invoked.
This method is invoked automatically when this instance is deallocated.
- (void) deallocateScales |
Deallocates the underlying scale array allocated with the allocateScales.
It is safe to invoke this method more than once, or even if allocateScales was not previously invoked.
This method is invoked automatically when this instance is deallocated.
- (CC3Vector *) animatedLocations [read, write, assign] |
An array of location data.
Each CC3Vector in the array holds the location datum for one frame of animation. The array must have at least frameCount elements. The property can be set to NULL to indicate that location is not animated.
Setting this property will safely free any memory allocated by the allocateLocations method.
- (CC3Vector4 *) animatedQuaternions [read, write, assign] |
An array of rotation quaternion data.
Each CC3Vector4 in the array holds the location datum for one frame of animation. The array must have at least frameCount elements. The property can be set to NULL to indicate that quaternion rotation is not animated.
Setting this property will safely free any memory allocated by the allocateQuaternions method.
- (CC3Vector *) animatedRotations [read, write, assign] |
An array of rotation data.
Each CC3Vector in the array holds the rotation datum for one frame of animation. The array must have at least frameCount elements. The property can be set to NULL to indicate that rotation is not animated.
Setting this property will safely free any memory allocated by the allocateRotations method.
- (CC3Vector *) animatedScales [read, write, assign] |
An array of scale data.
Each CC3Vector in the array holds the scale datum for one frame of animation. The array must have at least frameCount elements. The property can be set to NULL to indicate that scale is not animated.
Setting this property will safely free any memory allocated by the allocateScales method.