CC3CALNode Class Reference
Inherits from | CC3Node : CC3Identifiable : NSObject |
Declared in | CC3CALNode.h |
Overview
A CC3CALNode extracted from a file.
During extraction from the file, nodes of this type are related to each other through index values.
Only CC3ArrayNodeAnimation should be used for animating this type of node.
CAF bones do not contain scale content. When a skeleton model whose bones do contain scale content is exported to a CAF file, the animation location content is incorrectly scaled.
To compensate, when using a CC3CALNode to hold animation content loaded from a CAF file, invoke the correctAnimationToSkeletalScale: method, passing the skeletalScale of the node to which the animation contained in the CC3CALNode is to be attached. This should only be done once, and subsequent invocations of that method will be ignored. Consequently, the animation held in a CC3CALNode should only be used to animate bones that have the same skeletalScale.
Tasks
-
calIndex
property -
calParentIndex
property -
isBaseCALNode
property -
– linkToCALNodes:
-
– getNodeWithCALIndex:
-
isAnimationCorrectedForScale
property -
– correctAnimationToSkeletalScale:
Properties
calIndex
The index of this node in the resource file.
@property (nonatomic, assign) GLint calIndex
Declared In
CC3CALNode.h
calParentIndex
The index of the parent of this node in the resource file.
@property (nonatomic, assign) GLint calParentIndex
Declared In
CC3CALNode.h
Instance Methods
correctAnimationToSkeletalScale:
Corrects the animation contained in this node to align with the specified skeletalScale.
- (void)correctAnimationToSkeletalScale:(CC3Vector)aScale
Discussion
CAF bones do not contain scale content. When a skeleton model whose bones do contain scale content is exported to a CAF file, the location content of this animation is not correctly scaled.
To compensate, invoke this method, passing the skeletalScale of the node to which this animation is to be attached.
When this method is invoked, if the value of the isAnimationCorrectedForScale property is NO, each location in the animation contained in this node (on all animation tracks) is scaled by the inverse of the specified scale. Once this is complete, the value of the isAnimationCorrectedForScale property is set to YES.
Since this scaling should only be done once, subsequent invocations of this method will be ignored. Consequently, the contained animation should only be used to animate bones that have the same skeletalScale.
This method is invoked automatically when this CAL node is retrieved from the CAF resource using the CC3CAFResource getNodeMatching: method. Normally, the application never has need to invoke this method.
Declared In
CC3CALNode.h