- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FCDAnimationCurve Class Reference
[COLLADA Document Object Model.]

A COLLADA single-dimensional animation curve. More...

`#include <FCDAnimationCurve.h>`

Inheritance diagram for FCDAnimationCurve:

List of all members.

## Public Member Functions
| DeclareFlag (AnimChanged, 0)
| DeclareFlagCount (1)
| FCDAnimationCurve (FCDocument *document, FCDAnimationChannel *parent)
| Constructor: do not use directly.
virtual | ~FCDAnimationCurve ()
| Destructor.
FCDAnimationChannel * | GetParent ()
| Retrieves the animation channel that contains this animation curve.
const FCDAnimationChannel * | GetParent () const
| See above.
FCDAnimationKey ** | GetKeys ()
| Retrieves the list of keys for the animation curve.
const FCDAnimationKey ** | GetKeys () const
| See above.
size_t | GetKeyCount () const
| Retrieves the number of keys within the animation curve.
void | SetKeyCount (size_t count, FUDaeInterpolation::Interpolation interpolation)
| Sets the number of keys within the animation curve.
FCDAnimationKey * | GetKey (size_t index)
| Retrieves one key in the animation curve.
const FCDAnimationKey * | GetKey (size_t index) const
| See above.
FCDAnimationKey * | AddKey (FUDaeInterpolation::Interpolation interpolation)
| Appends a key to the animation curve.
FCDAnimationKey * | AddKey (FUDaeInterpolation::Interpolation interpolation, float input)
| Adds a new key to the animation curve at the given time.
FCDAnimationKey * | AddKey (FUDaeInterpolation::Interpolation interpolation, float input, size_t &index)
| Adds a new key to the animation curve at the given time.
bool | DeleteKey (FCDAnimationKey *key)
| Removes the given key from this curves list and deletes it.
FUDaeInfinity::Infinity | GetPreInfinity () const
| Retrieves the type of behavior for the curve if the input value is outside the input interval defined by the curve keys and less than any key input value.
void | SetPreInfinity (FUDaeInfinity::Infinity infinity)
| Sets the behavior of the curve if the input value is outside the input interval defined by the curve keys and less than any key input value.
FUDaeInfinity::Infinity | GetPostInfinity () const
| Retrieves the type of behavior for the curve if the input value is outside the input interval defined by the curve keys and greater than any key input value.
void | SetPostInfinity (FUDaeInfinity::Infinity infinity)
| Sets the behavior of the curve if the input value is outside the input interval defined by the curve keys and greater than any key input value.
bool | HasDriver () const
| Retrieves whether this animation curve has a driver.
void | GetDriver (FCDAnimated *&driver, int32 &index)
| Retrieves the value pointer that drives this animation curve.
void | GetDriver (const FCDAnimated *&driver, int32 &index) const
| See above.
FCDAnimated * | GetDriverPtr ()
int32 | GetDriverIndex ()
| [INTERNAL] Retrieve the driver index.
void | SetDriver (FCDAnimated *driver, int32 index)
| Sets the value pointer that drives the animation curve.
size_t | GetClipCount () const
| Retrieves the number of animation clips that use this animation curve.
FCDAnimationClip ** | GetClips ()
| Retrieves the list of animation clips that use this animation curve.
const FCDAnimationClip ** | GetClips () const
| See above.
FCDAnimationClip * | GetClip (size_t index)
| Retrieves an animation clips that use this animation curve.
const FCDAnimationClip * | GetClip (size_t index) const
| See above.
void | AddClip (FCDAnimationClip *clip)
| Adds an animation clip to the list of animation clips that use this curve.
void | SetCurrentAnimationClip (FCDAnimationClip *clip)
| Updates the keys to match the timing of an animation clip that has been registered using RegisterAnimationClip, or returned from GetClips.
const float | GetClipOffset (size_t index) const
| Gets the offset for an animation clip.
FCDAnimationCurve * | Clone (FCDAnimationCurve *clone=NULL, bool includeClips=true) const
| Clones the animation curve.
void | ConvertValues (FCDConversionFunction valueConversion, FCDConversionFunction tangentConversion)
| Applies a conversion function to the key output values of the animation curve.
void | ConvertValues (FCDConversionFunctor *valueConversion, FCDConversionFunctor *tangentConversion)
| See above.
void | ConvertInputs (FCDConversionFunction timeConversion, FCDConversionFunction tangentWeightConversion)
| Applies a conversion function to the key input values of the animation curve.
void | ConvertInputs (FCDConversionFunctor *timeConversion, FCDConversionFunctor *tangentWeightConversion)
| See above.
float | Evaluate (float input) const
| Evaluates the animation curve.
void | RegisterAnimationClip (FCDAnimationClip *clip)
| [INTERNAL] Adds an animation clip to the list of animation clips that use this curve.
int32 | GetTargetElement () const
| [INTERNAL] Retrieves the target element suffix for the curve.
const fm::string & | GetTargetQualifier () const
| [INTERNAL] Retrieves the target qualifier for the curve.
void | SetTargetElement (int32 e)
| [INTERNAL] Sets the target element suffix for the curve.
void | SetTargetQualifier (const fm::string &q)
| [INTERNAL] Sets the target qualifier for the curve.
void | SetClipOffset (float offset, const FCDAnimationClip *clip)
| [INTERNAL] Updates the offset for a given animation clip.
## Static Public Member Functions
static void | Set2DCurveEvaluation (bool flag)
| Sets the 2D Curve Evaluation flag.
static bool | Is2DCurveEvaluation ()
| Returns whether 2D Curve Evaluation is on or off.

## Detailed Description

A COLLADA single-dimensional animation curve.

An animation curve holds the keyframes necessary to animate an animatable floating-point value.

There are multiple interpolation mechanisms supported by COLLADA. FCollada supports the CONSTANT, LINEAR and BEZIER interpolations.

See also:
  FUDaeInterpolation FUDaeInfinity

## Constructor & Destructor Documentation

FCDAnimationCurve::FCDAnimationCurve | ( | FCDocument * | document,
|  | FCDAnimationChannel * | parent
| ) |

  | Constructor: do not use directly. Instead, use the FCDAnimationChannel::AddCurve function. You should also attach the new curve to an animated element using the FCDAnimated::SetCurve function. Parameters:
  | document | The COLLADA document that owns the animation curve.
  | parent | The animation channel that contains the curve.

## Member Function Documentation

void FCDAnimationCurve::AddClip | ( | FCDAnimationClip * | clip | ) |

  | Adds an animation clip to the list of animation clips that use this curve. Parameters:
  | clip | An animation clip that uses this curve.

FCDAnimationKey* FCDAnimationCurve::AddKey | ( | FUDaeInterpolation::Interpolation | interpolation,
|  | float | input,
|  | size_t & | index
| ) |

  | Adds a new key to the animation curve at the given time. Parameters:
  | interpolation | The interpolation type for the new key.
  | input | The input (x) value of the new key.
  | index | [OUT] The index in the array of the new key
Returns: The new key.

FCDAnimationKey* FCDAnimationCurve::AddKey | ( | FUDaeInterpolation::Interpolation | interpolation,
|  | float | input
| ) | `[inline]`

  | Adds a new key to the animation curve at the given time. Parameters:
  | interpolation | The interpolation type for the new key.
  | input | The input (x) value of the new key.
Returns: The new key.

FCDAnimationKey* FCDAnimationCurve::AddKey | ( | FUDaeInterpolation::Interpolation | interpolation | ) |

  | Appends a key to the animation curve. Parameters:
  | interpolation | The interpolation type for the new key.
Returns: The new key.

FCDAnimationCurve* FCDAnimationCurve::Clone | ( | FCDAnimationCurve * | clone = `NULL`,
|  | bool | includeClips = `true`
| ) | const

  | Clones the animation curve. The animation clips can be cloned as well, but this may lead to an infinite recursion because cloning the clips will also clone its curves. Parameters:
  | clone | The cloned animation curve. If this pointer is NULL, a new animation curve will be created for you. You will then need to release the pointer.
  | includeClips | True if want to also clone the animation clips.
Returns: The cloned animation curve.

void FCDAnimationCurve::ConvertInputs | ( | FCDConversionFunction | timeConversion,
|  | FCDConversionFunction | tangentWeightConversion
| ) |

  | Applies a conversion function to the key input values of the animation curve. Parameters:
  | timeConversion | The conversion function to use on the key inputs.
  | tangentWeightConversion | The conversion function to use on the key tangent weights.

void FCDAnimationCurve::ConvertValues | ( | FCDConversionFunction | valueConversion,
|  | FCDConversionFunction | tangentConversion
| ) |

  | Applies a conversion function to the key output values of the animation curve. Parameters:
  | valueConversion | The conversion function to use on the key outputs.
  | tangentConversion | The conversion function to use on the key tangents.

bool FCDAnimationCurve::DeleteKey | ( | FCDAnimationKey * | key | ) |

  | Removes the given key from this curves list and deletes it. Parameters:
  | key | The key to find and delete
Returns: True on success, false if the key is not found

float FCDAnimationCurve::Evaluate | ( | float | input | ) | const

  | Evaluates the animation curve. Parameters:
  | input | An input value.
Returns: The sampled value of the curve at the given input value.

FCDAnimationClip* FCDAnimationCurve::GetClip | ( | size_t | index | ) | `[inline]`

  | Retrieves an animation clips that use this animation curve. Parameters:
  | index | The index of the animation clip.
Returns: The animation clip at the given index in the list of clips that use this curve.

size_t FCDAnimationCurve::GetClipCount | ( |  | ) | const`[inline]`

| Retrieves the number of animation clips that use this animation curve. Returns: The number of animation clips.

const float FCDAnimationCurve::GetClipOffset | ( | size_t | index | ) | const`[inline]`

  | Gets the offset for an animation clip. When the offset is added to the keys, it causes the animation curve to be repositioned so that the animation clip starts at the beginning. Parameters:
  | index | The index of the animation clip to get offset for.
Returns: The offset value.

FCDAnimationClip** FCDAnimationCurve::GetClips | ( |  | ) | `[inline]`

| Retrieves the list of animation clips that use this animation curve. Returns: The list of animation clips.

void FCDAnimationCurve::GetDriver | ( | FCDAnimated *& | driver,
|  | int32 & | index
| ) |

  | Retrieves the value pointer that drives this animation curve. Parameters:
  | driver | A reference to receive the animated input driver. This pointer will be set to NULL when there is no input driver.
  | index | A reference to receive the animated input driver element index.

int32 FCDAnimationCurve::GetDriverIndex | ( |  | ) | `[inline]`

| [INTERNAL] Retrieve the driver index. Returns: The driver index.

FCDAnimationKey* FCDAnimationCurve::GetKey | ( | size_t | index | ) | `[inline]`

  | Retrieves one key in the animation curve. Parameters:
  | index | The index of the key to retrieve.
Returns: The key.

size_t FCDAnimationCurve::GetKeyCount | ( |  | ) | const`[inline]`

| Retrieves the number of keys within the animation curve. Returns: The number of keys.

FCDAnimationKey** FCDAnimationCurve::GetKeys | ( |  | ) | `[inline]`

| Retrieves the list of keys for the animation curve. Returns: The list of keys.

FCDAnimationChannel* FCDAnimationCurve::GetParent | ( |  | ) | `[inline]`

| Retrieves the animation channel that contains this animation curve. Returns: The parent animation channel.

FUDaeInfinity::Infinity FCDAnimationCurve::GetPostInfinity | ( |  | ) | const`[inline]`

| Retrieves the type of behavior for the curve if the input value is outside the input interval defined by the curve keys and greater than any key input value. See also: FUDaeInfinity Returns: The post-infinity behavior of the curve.

FUDaeInfinity::Infinity FCDAnimationCurve::GetPreInfinity | ( |  | ) | const`[inline]`

| Retrieves the type of behavior for the curve if the input value is outside the input interval defined by the curve keys and less than any key input value. See also: FUDaeInfinity Returns: The pre-infinity behavior of the curve.

int32 FCDAnimationCurve::GetTargetElement | ( |  | ) | const`[inline]`

| [INTERNAL] Retrieves the target element suffix for the curve. This will be -1 if the animated element does not belong to an animated element list. Returns: The target element suffix.

const fm::string& FCDAnimationCurve::GetTargetQualifier | ( |  | ) | const`[inline]`

| [INTERNAL] Retrieves the target qualifier for the curve. This will be the empty string if that the curve affects a one-dimensional animated element. Returns: The target qualifier.

bool FCDAnimationCurve::HasDriver | ( |  | ) | const

| Retrieves whether this animation curve has a driver. Returns: Whether there is a driver for this curve.

static bool FCDAnimationCurve::Is2DCurveEvaluation | ( |  | ) | `[inline, static]`

| Returns whether 2D Curve Evaluation is on or off. Returns: A boolean that indicates if the 2D Curve Evaluation is on or off.

void FCDAnimationCurve::RegisterAnimationClip | ( | FCDAnimationClip * | clip | ) |

  | [INTERNAL] Adds an animation clip to the list of animation clips that use this curve. Parameters:
  | clip | An animation clip.

static void FCDAnimationCurve::Set2DCurveEvaluation | ( | bool | flag | ) | `[inline, static]`

  | Sets the 2D Curve Evaluation flag. This flag can be set by the user to enable the slower, but higher quality 2D evaluation. If the flag is negative, the faster 1D slope-based evaluation is performed. Defaults to true. Parameters:
  | flag | Whether to enable 2D curve evaluation.

void FCDAnimationCurve::SetClipOffset | ( | float | offset,
|  | const FCDAnimationClip * | clip
| ) |

  | [INTERNAL] Updates the offset for a given animation clip. Parameters:
  | offset | The new offset.
  | clip | The animation clip to associate with the offset.

void FCDAnimationCurve::SetCurrentAnimationClip | ( | FCDAnimationClip * | clip | ) |

  | Updates the keys to match the timing of an animation clip that has been registered using RegisterAnimationClip, or returned from GetClips. Parameters:
  | clip | The clip to update the keys to.

void FCDAnimationCurve::SetDriver | ( | FCDAnimated * | driver,
|  | int32 | index
| ) |

  | Sets the value pointer that drives the animation curve. Parameters:
  | driver | The driver animated value. Set this pointer to NULL to indicate that time drives the animation curve.
  | index | The driver animated value index.

void FCDAnimationCurve::SetKeyCount | ( | size_t | count,
|  | FUDaeInterpolation::Interpolation | interpolation
| ) |

  | Sets the number of keys within the animation curve. Parameters:
  | count | The new number of keys in the curve.
  | interpolation | If creating new keys, the interpolation type for the new keys.

void FCDAnimationCurve::SetPostInfinity | ( | FUDaeInfinity::Infinity | infinity | ) | `[inline]`

  | Sets the behavior of the curve if the input value is outside the input interval defined by the curve keys and greater than any key input value. See also: FUDaeInfinity Parameters:
  | infinity | The post-infinity behavior of the curve.

void FCDAnimationCurve::SetPreInfinity | ( | FUDaeInfinity::Infinity | infinity | ) | `[inline]`

  | Sets the behavior of the curve if the input value is outside the input interval defined by the curve keys and less than any key input value. See also: FUDaeInfinity Parameters:
  | infinity | The pre-infinity behavior of the curve.

void FCDAnimationCurve::SetTargetElement | ( | int32 | e | ) | `[inline]`

  | [INTERNAL] Sets the target element suffix for the curve. Parameters:
  | e | The target element suffix. Set to value to -1 if the animated element does not belong to an animated element list.

void FCDAnimationCurve::SetTargetQualifier | ( | const fm::string & | q | ) | `[inline]`

  | [INTERNAL] Sets the target qualifier for the curve. Parameters:
  | q | The target qualifier. You may sets this string to the empty string only if that the curve affects a one-dimensional animated element.

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

- FCDocument/FCDAnimationCurve.h