|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:

List of all members.

## 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

## Detailed Description

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

## Member Enumeration Documentation

enum gameplay::AnimationTarget::TargetType `[protected]`

The type of animation target.

## Constructor & Destructor Documentation

gameplay::AnimationTarget::AnimationTarget | ( |  | ) | `[protected]`

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:

  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.

Parameters:

  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.

Parameters:

  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.

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:

  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.

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:

  id | The ID of the animation.
  url | The 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:

  id | The ID of the animation.
  animationProperties | The 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:

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

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:

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

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:

  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.

Parameters:

  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.

Parameters:

  propertyId | The 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:

  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]`

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

Parameters:

  id | The 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:

  type | The TargetType of the AnimationTarget.
  propertyIdStr | The 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:

  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.

Parameters:

  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.

## Member Data Documentation

TargetType gameplay::AnimationTarget::_targetType `[protected]`

The target's type.

See also:
  TargetType::SCALAR
  TargetType::TRANSFORM

All Classes Functions Variables Typedefs Enumerations Enumerator