v2.0.2
Instance Methods | Properties | List of all members
CC3ArrayNodeAnimation Class Reference

#import <CC3NodeAnimation.h>

Inheritance diagram for CC3ArrayNodeAnimation:
Inheritance graph
[legend]

Instance Methods

(CCTime *) - allocateFrameTimes
 
(CC3Vector *) - allocateLocations
 
(CC3Quaternion *) - allocateQuaternions
 
(CC3Vector *) - allocateScales
 
(void) - deallocateFrameTimes
 
(void) - deallocateLocations
 
(void) - deallocateQuaternions
 
(void) - deallocateScales
 
- Instance Methods inherited from CC3NodeAnimation
(void) - establishFrameAt:forNode:
 
(void) - establishFrameAt:inNodeAnimationState:
 
(id) - initWithFrameCount:
 
(CCTime) - timeAtFrame:
 

Properties

CC3VectoranimatedLocations
 
CC3QuaternionanimatedQuaternions
 
CC3VectoranimatedScales
 
CCTime * frameTimes
 
- Properties inherited from CC3NodeAnimation
GLuint frameCount
 
BOOL hasVariableFrameTiming
 
BOOL isAnimating
 
BOOL isAnimatingLocation
 
BOOL isAnimatingQuaternion
 
BOOL isAnimatingScale
 
BOOL shouldInterpolate
 

Additional Inherited Members

- Class Methods inherited from CC3NodeAnimation
(id) + animationWithFrameCount:
 
(CCTime) + interpolationEpsilon
 
(void) + setInterpolationEpsilon:
 

Detailed Description

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 three properties that hold the animated content:

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 example, if you set only the animatedLocations property, and run a CC3ActionAnimate on the node, only the location of the node will move around during the animation. The remaining node properties (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.

This animation can be configured so that time interval between frames can vary from frame to frame, or that the time interval between frames is constant. To configure for variable frame timing, use the frameTimes property to assign a specific time to each frame. To configure for equally-spaced frames, set the frameTimes property to NULL.

You can work with these animation content properties in one of two ways:

Method Documentation

- (CCTime*) allocateFrameTimes

Allocates underlying memory for an array of frame times.

All elements of the array are initialized to zero. The amount of memory allocated will be (frameCount * sizeof(CCTime)) 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*) 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.

- (CC3Quaternion*) 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(CC3Quaternion)) 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) deallocateFrameTimes

Deallocates the underlying frame times array allocated with the allocateFrameTimes method.

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

This method is invoked automatically when this instance is deallocated.

- (void) deallocateLocations

Deallocates the underlying location array allocated with the allocateLocations method.

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 method.

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) deallocateScales

Deallocates the underlying scale array allocated with the allocateScales method.

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.

Property Documentation

- (CC3Vector*) animatedLocations
readwritenonatomicassign

An array of animated location content.

Each CC3Vector in the array holds the location content for one frame of animation. The array must have at least frameCount elements.

This property can be set to NULL to indicate that the location is not animated.

The isAnimatingLocation property will return YES if this property is not NULL, and NO otherwise.

Setting this property will safely free any memory allocated by the allocateLocations method.

The initial value of this property is NULL.

- (CC3Quaternion*) animatedQuaternions
readwritenonatomicassign

An array of animated rotation quaternion content.

Each CC3Quaternion in the array holds the rotation content for one frame of animation. The array must have at least frameCount elements.

This property can be set to NULL to indicate that the rotation is not animated.

The isAnimatingQuaternion property will return YES if this property is not NULL, and NO otherwise.

Setting this property will safely free any memory allocated by the allocateQuaternions method.

The initial value of this property is NULL.

- (CC3Vector*) animatedScales
readwritenonatomicassign

An array of animated scale content.

Each CC3Vector in the array holds the scale content for one frame of animation. The array must have at least frameCount elements.

This property can be set to NULL to indicate that the scale is not animated.

The isAnimatingScale property will return YES if this property is not NULL, and NO otherwise.

Setting this property will safely free any memory allocated by the allocateScales method.

The initial value of this property is NULL.

- (CCTime*) frameTimes
readwritenonatomicassign

An array of frame times.

Each CCTime in the array indicates the time for one frame. All values must be within the range from zero and one inclusive. For accurate animation, the value of the first element of this array should be zero, and the value of the last element should be one. The array must have at least frameCount elements.

This property can be set to NULL to indicate that the duration of all of the frames is the same.

The hasVariableFrameTiming property will return YES if this property is not NULL, and NO otherwise.

Setting this property will safely free any memory allocated by the allocateFrameTimes method.

The initial value of this property is NULL, indicating that the frames are equally spaced.


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