#include <AnimationTarget.h>
Public Member Functions | |
Animation * | createAnimation (const char *id, int propertyId, unsigned int keyCount, unsigned int *keyTimes, float *keyValues, Curve::InterpolationType type) |
Animation * | createAnimation (const char *id, int propertyId, unsigned int keyCount, unsigned int *keyTimes, float *keyValues, float *keyInValue, float *keyOutValue, Curve::InterpolationType type) |
Animation * | createAnimation (const char *id, const char *url) |
Animation * | createAnimation (const char *id, Properties *animationProperties) |
Animation * | createAnimationFromTo (const char *id, int propertyId, float *from, float *to, Curve::InterpolationType type, unsigned long duration) |
Animation * | createAnimationFromBy (const char *id, int propertyId, float *from, float *by, Curve::InterpolationType type, unsigned long duration) |
void | destroyAnimation (const char *id=NULL) |
virtual unsigned int | getAnimationPropertyComponentCount (int propertyId) const =0 |
virtual void | getAnimationPropertyValue (int propertyId, AnimationValue *value)=0 |
virtual void | setAnimationPropertyValue (int propertyId, AnimationValue *value, float blendWeight=1.0f)=0 |
Animation * | getAnimation (const char *id=NULL) const |
Protected Types | |
enum | TargetType { SCALAR, TRANSFORM } |
Protected Member Functions | |
AnimationTarget () | |
virtual | ~AnimationTarget () |
virtual int | getPropertyId (TargetType type, const char *propertyIdStr) |
void | addChannel (Animation::Channel *channel) |
void | removeChannel (Animation::Channel *channel) |
Animation::Channel * | getChannel (const char *id) const |
void | cloneInto (AnimationTarget *target, NodeCloneContext &context) const |
Protected Attributes | |
TargetType | _targetType |
Defines an interface allowing animation to target an object for changing its animation properties.
enum gameplay::AnimationTarget::TargetType [protected] |
The type of animation target.
gameplay::AnimationTarget::AnimationTarget | ( | ) | [protected] |
Constructor.
virtual gameplay::AnimationTarget::~AnimationTarget | ( | ) | [protected, virtual] |
Destructor.
void gameplay::AnimationTarget::addChannel | ( | Animation::Channel * | channel | ) | [protected] |
Adds the given animation channel to this animation target.
channel | The animation channel to add. |
void gameplay::AnimationTarget::cloneInto | ( | AnimationTarget * | target, |
NodeCloneContext & | context | ||
) | const [protected] |
Copies data from this animation target into the given target for the purpose of cloning.
target | The target to copy into. |
context | The clone context. |
Animation* gameplay::AnimationTarget::createAnimation | ( | const char * | id, |
int | propertyId, | ||
unsigned int | keyCount, | ||
unsigned int * | keyTimes, | ||
float * | keyValues, | ||
Curve::InterpolationType | type | ||
) |
Creates an animation on this target from a set of key value and key time pairs. Cannot use Curve::BEZIER or CURVE::HERMITE as the interpolation type since they require tangents/control points.
id | The ID of the animation. |
propertyId | The property on this target to animate. |
keyCount | The number of keyframes in the animation. Must be greater than one. |
keyTimes | The list of key times for the animation (in milliseconds). |
keyValues | The list of key values for the animation. |
type | The curve interpolation type. |
Animation* gameplay::AnimationTarget::createAnimation | ( | const char * | id, |
int | propertyId, | ||
unsigned int | keyCount, | ||
unsigned int * | keyTimes, | ||
float * | keyValues, | ||
float * | keyInValue, | ||
float * | keyOutValue, | ||
Curve::InterpolationType | type | ||
) |
Creates an animation on this target from a set of key value and key time pairs.
id | The ID of the animation. |
propertyId | The property on this target to animate. |
keyCount | The number of keyframes in the animation. Must be greater than one. |
keyTimes | The list of key times for the animation (in milliseconds). |
keyValues | The list of key values for the animation. |
keyInValue | The list of key in values for the animation. |
keyOutValue | The list of key out values for the animation. |
type | The curve interpolation type. |
Animation* gameplay::AnimationTarget::createAnimation | ( | const char * | id, |
const char * | url | ||
) |
Creates an animation on this target using the data from the Properties object defined at the specified URL, where the URL is of the format "<file-path>.<extension>#<namespace-id>/<namespace-id>/.../<namespace-id>" (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
id | The ID of the animation. |
url | The URL pointing to the Properties object defining the animation data. |
Animation* gameplay::AnimationTarget::createAnimation | ( | const char * | id, |
Properties * | animationProperties | ||
) |
Creates an animation on this target using the data from the given properties object.
id | The ID of the animation. |
animationProperties | The properties object defining the animation data. |
Animation* gameplay::AnimationTarget::createAnimationFromBy | ( | const char * | id, |
int | propertyId, | ||
float * | from, | ||
float * | by, | ||
Curve::InterpolationType | type, | ||
unsigned long | duration | ||
) |
Creates a simple two keyframe from-by animation. Cannot use Curve::BEZIER or CURVE::HERMITE as the interpolation type since they require tangents/control points.
id | The ID of the animation. |
propertyId | The property on this target to animate. |
from | The values to animate from. |
by | The values to animate by. |
type | The curve interpolation type. |
duration | The duration of the animation (in milliseconds). |
Animation* gameplay::AnimationTarget::createAnimationFromTo | ( | const char * | id, |
int | propertyId, | ||
float * | from, | ||
float * | to, | ||
Curve::InterpolationType | type, | ||
unsigned long | duration | ||
) |
Creates a simple two keyframe from-to animation. Cannot use Curve::BEZIER or CURVE::HERMITE as the interpolation type since they require tangents/control points.
id | The ID of the animation. |
propertyId | The property on this target to animate. |
from | The values to animate from. |
to | The values to animate to. |
type | The curve interpolation type. |
duration | The duration of the animation (in milliseconds). |
void gameplay::AnimationTarget::destroyAnimation | ( | const char * | id = NULL | ) |
Destroys the animation with the specified ID. Destroys the first animation if ID is NULL.
id | The ID of the animation to destroy. |
Animation* gameplay::AnimationTarget::getAnimation | ( | const char * | id = NULL | ) | const |
Gets the animation with the specified ID. If the ID is NULL, this function will return the first animation it finds.
id | The name of the animation to get. |
Reimplemented in gameplay::Node, and gameplay::Container.
virtual unsigned int gameplay::AnimationTarget::getAnimationPropertyComponentCount | ( | int | propertyId | ) | const [pure virtual] |
Abstract method to return the property component count of the given property ID on the AnimationTarget.
propertyId | The ID of the property on the AnimationTarget to obtain the component count for. |
Implemented in gameplay::Control, gameplay::Transform, gameplay::Sprite, gameplay::MaterialParameter, gameplay::Container, and gameplay::Text.
virtual void gameplay::AnimationTarget::getAnimationPropertyValue | ( | int | propertyId, |
AnimationValue * | value | ||
) | [pure virtual] |
Abstract method for getting the animation property value for the given property ID on the AnimationTarget.
propertyId | The ID of the property on the AnimationTarget to get the animation property value for. |
value | The container to get the animation property value in. |
Implemented in gameplay::Control, gameplay::Transform, gameplay::Sprite, gameplay::MaterialParameter, gameplay::Container, and gameplay::Text.
Animation::Channel* gameplay::AnimationTarget::getChannel | ( | const char * | id | ) | const [protected] |
virtual int gameplay::AnimationTarget::getPropertyId | ( | TargetType | type, |
const char * | propertyIdStr | ||
) | [protected, virtual] |
Gets the TargetType's property ID value for the specified property ID string.
type | The TargetType of the AnimationTarget. |
propertyIdStr | The property ID string. |
Reimplemented in gameplay::Sprite, and gameplay::Text.
void gameplay::AnimationTarget::removeChannel | ( | Animation::Channel * | channel | ) | [protected] |
Removes the given animation channel from this animation target.
channel | The animation channel to delete. |
virtual void gameplay::AnimationTarget::setAnimationPropertyValue | ( | int | propertyId, |
AnimationValue * | value, | ||
float | blendWeight = 1.0f |
||
) | [pure virtual] |
Abstract method for setting the animation property value for the given property ID on the AnimationTarget.
propertyId | The ID of the property on the AnimationTarget to set the animation property value on. |
value | The container to set the animation property value in. |
blendWeight | The blend weight. |
Implemented in gameplay::Control, gameplay::Transform, gameplay::Sprite, gameplay::MaterialParameter, gameplay::Container, and gameplay::Text.
TargetType gameplay::AnimationTarget::_targetType [protected] |
The target's type.