overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
gameplay::AnimationTarget Class Reference

#include <AnimationTarget.h>

Inheritance diagram for gameplay::AnimationTarget:
gameplay::Control gameplay::MaterialParameter gameplay::Sprite gameplay::Text gameplay::Transform gameplay::Container gameplay::ImageControl gameplay::JoystickControl gameplay::Label gameplay::Node gameplay::Form gameplay::Button gameplay::Slider gameplay::TextBox gameplay::Joint gameplay::CheckBox gameplay::RadioButton

List of all members.

Public Member Functions

AnimationcreateAnimation (const char *id, int propertyId, unsigned int keyCount, unsigned int *keyTimes, float *keyValues, Curve::InterpolationType type)
AnimationcreateAnimation (const char *id, int propertyId, unsigned int keyCount, unsigned int *keyTimes, float *keyValues, float *keyInValue, float *keyOutValue, Curve::InterpolationType type)
AnimationcreateAnimation (const char *id, const char *url)
AnimationcreateAnimation (const char *id, Properties *animationProperties)
AnimationcreateAnimationFromTo (const char *id, int propertyId, float *from, float *to, Curve::InterpolationType type, unsigned long duration)
AnimationcreateAnimationFromBy (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
AnimationgetAnimation (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

Detailed Description

Defines an interface allowing animation to target an object for changing its animation properties.


Member Enumeration Documentation

The type of animation target.


Constructor & Destructor Documentation

Constructor.

virtual gameplay::AnimationTarget::~AnimationTarget ( ) [protected, virtual]

Destructor.


Member Function Documentation

void gameplay::AnimationTarget::addChannel ( Animation::Channel *  channel) [protected]

Adds the given animation channel to this animation target.

Parameters:
channelThe 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.

Parameters:
targetThe target to copy into.
contextThe 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.

Parameters:
idThe ID of the animation.
propertyIdThe property on this target to animate.
keyCountThe number of keyframes in the animation. Must be greater than one.
keyTimesThe list of key times for the animation (in milliseconds).
keyValuesThe list of key values for the animation.
typeThe curve interpolation type.
Returns:
The newly created animation.
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.

Parameters:
idThe ID of the animation.
propertyIdThe property on this target to animate.
keyCountThe number of keyframes in the animation. Must be greater than one.
keyTimesThe list of key times for the animation (in milliseconds).
keyValuesThe list of key values for the animation.
keyInValueThe list of key in values for the animation.
keyOutValueThe list of key out values for the animation.
typeThe curve interpolation type.
Returns:
The newly created animation.
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).

Parameters:
idThe ID of the animation.
urlThe URL pointing to the Properties object defining the animation data.
Returns:
The newly created animation.
Animation* gameplay::AnimationTarget::createAnimation ( const char *  id,
Properties animationProperties 
)

Creates an animation on this target using the data from the given properties object.

Parameters:
idThe ID of the animation.
animationPropertiesThe properties object defining the animation data.
Returns:
The newly created animation.
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.

Parameters:
idThe ID of the animation.
propertyIdThe property on this target to animate.
fromThe values to animate from.
byThe values to animate by.
typeThe curve interpolation type.
durationThe duration of the animation (in milliseconds).
Returns:
The newly created animation.
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.

Parameters:
idThe ID of the animation.
propertyIdThe property on this target to animate.
fromThe values to animate from.
toThe values to animate to.
typeThe curve interpolation type.
durationThe duration of the animation (in milliseconds).
Returns:
The newly created animation.
void gameplay::AnimationTarget::destroyAnimation ( const char *  id = NULL)

Destroys the animation with the specified ID. Destroys the first animation if ID is NULL.

Parameters:
idThe 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.

Parameters:
idThe 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.

Parameters:
propertyIdThe ID of the property on the AnimationTarget to obtain the component count for.
Returns:
The property component count of the given property.

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.

Parameters:
propertyIdThe ID of the property on the AnimationTarget to get the animation property value for.
valueThe 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]

Gets the Animation::Channel that belongs to the Animation with the specified ID.

Parameters:
idThe ID of the Animation the Channel belongs to.
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.

Parameters:
typeThe TargetType of the AnimationTarget.
propertyIdStrThe property ID string.
Returns:
The property ID value for the property ID string; -1 if the propertyIdStr does not exist for the TargetType.

Reimplemented in gameplay::Sprite, and gameplay::Text.

void gameplay::AnimationTarget::removeChannel ( Animation::Channel *  channel) [protected]

Removes the given animation channel from this animation target.

Parameters:
channelThe 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.

Parameters:
propertyIdThe ID of the property on the AnimationTarget to set the animation property value on.
valueThe container to set the animation property value in.
blendWeightThe blend weight.

Implemented in gameplay::Control, gameplay::Transform, gameplay::Sprite, gameplay::MaterialParameter, gameplay::Container, and gameplay::Text.


Member Data Documentation

The target's type.

See also:
TargetType::SCALAR
TargetType::TRANSFORM
 All Classes Functions Variables Typedefs Enumerations Enumerator