FCDMorphController Class Reference
[COLLADA Document Geometry Entity]

A COLLADA morpher. More...

#include <FCDMorphController.h>

Inheritance diagram for FCDMorphController:

FCDObject FUObject List of all members.

Public Member Functions

 FCDMorphController (FCDocument *document, FCDController *parent)
 Constructor: do not use directly.
virtual ~FCDMorphController ()
 Destructor: do not use directly.
FCDEntityGetBaseTarget ()
 Retrieves the base entity controlled by this morpher.
const FCDEntityGetBaseTarget () const
 See above.
void SetBaseTarget (FCDEntity *entity)
 Sets the base entity controlled by this morpher.
FCDMorphTargetListGetTargets ()
 Retrieves the list of the morph targets.
const FCDMorphTargetListGetTargets () const
 See above.
size_t GetTargetCount () const
 Retrieves the number of morph targets.
FCDMorphTargetGetTarget (size_t index)
 Retrieves a specific morph target.
const FCDMorphTargetGetTarget (size_t index) const
 See above.
FCDMorphTargetAddTarget (FCDGeometry *geometry=NULL, float weight=0.0f)
 Adds a new morph target.
void ReleaseTarget (FCDMorphTarget *target)
 Releases a morph target used in this morpher.
FUDaeMorphMethod::Method GetMethod () const
 Retrieves the method used to interpolate between the different morph targets.
void SetMethod (FUDaeMorphMethod::Method _method)
 Sets the method used to interpolate between the different morph targets.
bool IsSimilar (FCDEntity *entity)
 Retrieves whether a given entity is similar to the base target.
FUStatus LoadFromXML (xmlNode *morphNode)
 [INTERNAL] Reads in the <morph> element from a given COLLADA XML tree node.
xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the <morph> element to the given COLLADA XML tree node.
FUStatus Link ()
 [INTERNAL] Links the controller with its entities.

Detailed Description

A COLLADA morpher.

A morpher holds a base geometry and a set of morph targets that contains a geometry and a weight. The geometry must be similar to the base geometry and the weights are used to interpolate the vertex positions of the base geometry. To be similar, two meshes must have the same number of vertices and two splines must have the same number of control points. The morphing weights can be animated.

There are two interpolation functions defined in COLLADA. See the FUDaeMorphMethod::Method enumerated type for more information.

See also:
FCDMorphTarget FUDaeMorphMethod


Constructor & Destructor Documentation

FCDMorphController::FCDMorphController FCDocument document,
FCDController parent
 

Constructor: do not use directly.

Instead, use the FCDController::CreateMorphController function.

Parameters:
document The COLLADA document that owns the morpher.
parent The COLLADA controller that contains this morpher.

virtual FCDMorphController::~FCDMorphController  )  [virtual]
 

Destructor: do not use directly.

Instead, release the parent controller or create a new skin/morpher.


Member Function Documentation

FCDMorphTarget* FCDMorphController::AddTarget FCDGeometry geometry = NULL,
float  weight = 0.0f
 

Adds a new morph target.

Parameters:
geometry The morph target geometry.
weight The morphing weight.
Returns:
The new morph target.

FCDEntity* FCDMorphController::GetBaseTarget  )  [inline]
 

Retrieves the base entity controlled by this morpher.

This entity may be a geometry or another controller.

Returns:
The base target.

FUDaeMorphMethod::Method FCDMorphController::GetMethod  )  const [inline]
 

Retrieves the method used to interpolate between the different morph targets.

Returns:
The interpolation method.

FCDMorphTarget* FCDMorphController::GetTarget size_t  index  )  [inline]
 

Retrieves a specific morph target.

Parameters:
index The index of the morph target.
Returns:
The morph target. This pointer will be NULL if the index is out-of-bounds.

size_t FCDMorphController::GetTargetCount  )  const [inline]
 

Retrieves the number of morph targets.

Returns:
The number of morph targets.

FCDMorphTargetList& FCDMorphController::GetTargets  )  [inline]
 

Retrieves the list of the morph targets.

All the morph target geometries should be similar to the base entity.

Returns:
The morph targets.

bool FCDMorphController::IsSimilar FCDEntity entity  ) 
 

Retrieves whether a given entity is similar to the base target.

Entities must be similar to be able to morph between them.

Parameters:
entity An entity.
Returns:
Whether the given entity is similar to the base target.

FUStatus FCDMorphController::Link  ) 
 

[INTERNAL] Links the controller with its entities.

Since geometries are loaded before the controllers, no linkage is necessary.

Returns:
The status of the linkage: always successful.

FUStatus FCDMorphController::LoadFromXML xmlNode *  morphNode  ) 
 

[INTERNAL] Reads in the <morph> element from a given COLLADA XML tree node.

Parameters:
morphNode The COLLADA XML tree node.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the morpher.

void FCDMorphController::ReleaseTarget FCDMorphTarget target  ) 
 

Releases a morph target used in this morpher.

Parameters:
target The morph target to release.

void FCDMorphController::SetBaseTarget FCDEntity entity  ) 
 

Sets the base entity controlled by this morpher.

This entity may be a geometry or another controller. Since the morph targets must be similar to this entity, all the morph targets that are not similar to the new base entity will be removed.

Parameters:
entity The new base entity.

void FCDMorphController::SetMethod FUDaeMorphMethod::Method  _method  )  [inline]
 

Sets the method used to interpolate between the different morph targets.

Parameters:
_method The interpolation method.

xmlNode* FCDMorphController::WriteToXML xmlNode *  parentNode  )  const
 

[INTERNAL] Writes out the <morph> element to the given COLLADA XML tree node.

Parameters:
parentNode The COLLADA XML parent node in which to insert the morphing information.
Returns:
The created element XML tree node.


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