FCDAnimationMultiCurve Class Reference
[COLLADA Document Object Model.]

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

#include <FCDAnimationMultiCurve.h>

Inheritance diagram for FCDAnimationMultiCurve:

FCDObject FUObject List of all members.

Public Member Functions

 FCDAnimationMultiCurve (FCDocument *document, uint32 dimension)
 Constructor.
virtual ~FCDAnimationMultiCurve ()
 Destructor.
uint32 GetDimension () const
 Retrieves the number of dimensions for the curve.
FloatListGetKeys ()
 Retrieves the list of key inputs for the animation curve.
const FloatListGetKeys () const
 See above.
FloatListGetKeyValues ()
 Retrieves the lists of key outputs for the animation curve.
const FloatListGetKeyValues () const
 See above.
FloatListGetInTangents ()
 Retrieves the lists of key in-tangent values for the animation curve.
const FloatListGetInTangents () const
 See above.
FloatListGetOutTangents ()
 Retrieves the lists of key out-tangent values for the animation curve.
const FloatListGetOutTangents () const
 See above.
UInt32ListGetInterpolations ()
 Retrieves the list of interpolation type for the segments of the animation curve.
const UInt32ListGetInterpolations () const
 See above.
void Evaluate (float input, float *output) const
 Evaluates the animation curve.
FCDAnimationCurveCollapse (FCDCollapsingFunction collapse=NULL) const
 Collapses this multi-dimensional curve into a one-dimensional curve.
void WriteSourceToXML (xmlNode *parentNode, const string &baseId)
 [INTERNAL] Writes out the data sources necessary to import the animation curve to a given XML tree node.
xmlNode * WriteSamplerToXML (xmlNode *parentNode, const string &baseId)
 [INTERNAL] Writes out the sampler that puts together the data sources and generates a sampling function.
xmlNode * WriteChannelToXML (xmlNode *parentNode, const string &baseId, const string &pointer)
 [INTERNAL] Writes out the animation channel that attaches the sampling function to the animatable value.
int32 GetTargetElement () const
 [INTERNAL] Retrieves the target element suffix for the curve.
void SetTargetElement (int32 e)
 [INTERNAL] Sets the target element suffix for the curve.

Static Public Member Functions

static FCDAnimationMultiCurveMergeCurves (const vector< FCDAnimationCurve * > &toMerge, const FloatList &defaultValues)
 Merges multiple single-dimensional animation curves into one multi-dimensional animation curve.
static FCDAnimationMultiCurveMergeCurves (const vector< const FCDAnimationCurve * > &toMerge, const FloatList &defaultValues)
 See above.

Detailed Description

A COLLADA multi-dimensional animation curve.

This is a utility class that is used to convert multiple animation curves into one animation curve that has multiple dimensions, but only one list of key inputs.

FCollada will never create a multi-dimensional animation curve during the import of a COLLADA document.


Constructor & Destructor Documentation

FCDAnimationMultiCurve::FCDAnimationMultiCurve FCDocument document,
uint32  dimension
 

Constructor.

The number of dimensions will not change in the lifetime of a multi-dimensional curve.

Parameters:
document The COLLADA document that owns the animation curve.
dimension The number of dimensions for the animation curve.


Member Function Documentation

FCDAnimationCurve* FCDAnimationMultiCurve::Collapse FCDCollapsingFunction  collapse = NULL  )  const
 

Collapses this multi-dimensional curve into a one-dimensional curve.

Parameters:
collapse The function to use to collapse multiple floating-point values into one. Set this to NULL to use the default collapsing function, which averages all the values.
See also:
Average TakeFirst

void FCDAnimationMultiCurve::Evaluate float  input,
float *  output
const
 

Evaluates the animation curve.

Parameters:
input An input value.
output An array of floating-point values to fill in with the sampled values.

uint32 FCDAnimationMultiCurve::GetDimension  )  const [inline]
 

Retrieves the number of dimensions for the curve.

Returns:
The number of dimensions for the curve.

FloatList* FCDAnimationMultiCurve::GetInTangents  )  [inline]
 

Retrieves the lists of key in-tangent values for the animation curve.

These lists have data only if the curve includes segments with the bezier interpolation. There is one separate list of key in-tangent values for each dimension of the curve.

Returns:
The lists of in-tangent values.

UInt32List& FCDAnimationMultiCurve::GetInterpolations  )  [inline]
 

Retrieves the list of interpolation type for the segments of the animation curve.

There is always one interpolation type for each key in the curve. The interpolation type of a segment of the curve is set at the key at which begins the segment.

See also:
FUDaeInterpolation
Returns:
The list of interpolation types.

FloatList& FCDAnimationMultiCurve::GetKeys  )  [inline]
 

Retrieves the list of key inputs for the animation curve.

Returns:
The list of key inputs.

FloatList* FCDAnimationMultiCurve::GetKeyValues  )  [inline]
 

Retrieves the lists of key outputs for the animation curve.

There is one separate list of key outputs for each dimension of the curve.

Returns:
The lists of key outputs.

FloatList* FCDAnimationMultiCurve::GetOutTangents  )  [inline]
 

Retrieves the lists of key out-tangent values for the animation curve.

These lists have data only if the curve includes segments with the bezier interpolation. There is one separate list of key out-tangent values for each dimension of the curve.

Returns:
The lists of out-tangent values.

int32 FCDAnimationMultiCurve::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.

static FCDAnimationMultiCurve* FCDAnimationMultiCurve::MergeCurves const vector< FCDAnimationCurve * > &  toMerge,
const FloatList defaultValues
[static]
 

Merges multiple single-dimensional animation curves into one multi-dimensional animation curve.

For each NULL element found within the 'toMerge' list, the corresponding default value is used. If there are not enough default values provided, zero is assumed. The number of dimensions for the output animation curve is taken as the size of the 'toMerge' list.

Parameters:
toMerge The list of single-dimensional animation curves to merge. This list may contain NULL elements, as explained above.
defaultValues The list of default values to use when a NULL element is encountered. Default values should be provided even for the elements that are not NULL.

void FCDAnimationMultiCurve::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.

xmlNode* FCDAnimationMultiCurve::WriteChannelToXML xmlNode *  parentNode,
const string &  baseId,
const string &  pointer
 

[INTERNAL] Writes out the animation channel that attaches the sampling function to the animatable value.

Parameters:
parentNode The XML tree node in which to create the sampler.
baseId The COLLADA Id prefix used when generating the source ids and the sampler id.
pointer The target pointer prefix for the targeted animated element.
Returns:
The created XML tree node.

xmlNode* FCDAnimationMultiCurve::WriteSamplerToXML xmlNode *  parentNode,
const string &  baseId
 

[INTERNAL] Writes out the sampler that puts together the data sources and generates a sampling function.

Parameters:
parentNode The XML tree node in which to create the sampler.
baseId The COLLADA id prefix used when generating the source ids. This prefix is also used to generate the sampler COLLADA id.
Returns:
The created XML tree node.

void FCDAnimationMultiCurve::WriteSourceToXML xmlNode *  parentNode,
const string &  baseId
 

[INTERNAL] Writes out the data sources necessary to import the animation curve to a given XML tree node.

Parameters:
parentNode The XML tree node in which to create the data sources.
baseId A COLLADA Id prefix to use when generating the source ids.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:41 2006 for FCollada by  doxygen 1.4.6-NO