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

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

# FCDSceneNode Class Reference
[COLLADA Document Object Model.]

A COLLADA visual scene node. More...

`#include <FCDSceneNode.h>`

Inheritance diagram for FCDSceneNode:

List of all members.

## Public Member Functions
| DeclareFlag (TransformsDirty, 0)
| Whether the transforms have been dirtied.
| DeclareFlag (Joint, 1)
| Whether the scene node is a joint.
| DeclareFlagCount (2)
| FCDSceneNode (FCDocument *document)
| Constructor: do not use directly.
virtual | ~FCDSceneNode ()
| Destructor.
virtual Type | GetType () const
| Retrieves the type of the entity class.
size_t | GetParentCount () const
| Retrieves the number of parent nodes for this visual scene node.
FCDSceneNode * | GetParent (size_t index=0)
| Retrieves a specific parent of the visual scene node.
const FCDSceneNode * | GetParent (size_t index=0) const
| See above.
const FCDSceneNode ** | GetParents () const
| Retrieves the list of parents for the visual scene node.
size_t | GetChildrenCount () const
| Retrieves the number of child nodes for this visual scene node.
FCDSceneNode * | GetChild (size_t index)
| Retrieves a specific child of the visual scene node.
const FCDSceneNode * | GetChild (size_t index) const
| See above.
const FCDSceneNode ** | GetChildren () const
| Retrieves the list of children of the visual scene node.
FCDSceneNode * | AddChildNode ()
| Creates a new child scene node.
bool | AddChildNode (FCDSceneNode *sceneNode)
| Attaches a existing scene node to this visual scene node.
void | RemoveChildNode (FCDSceneNode *childNode)
| Removes a scene node from this scene node direct child list.
size_t | GetInstanceCount () const
| Retrieves the number of entity instances at this node of the scene graph.
FCDEntityInstance * | GetInstance (size_t index)
| Retrieves a specific entity instance.
const FCDEntityInstance * | GetInstance (size_t index) const
| See above.
const FCDEntityInstance ** | GetInstances () const
| Retrieves the list of entity instances at this node of the scene graph.
FCDEntityInstance * | AddInstance (FCDEntity *entity)
| Creates a new entity instance.
FCDEntityInstance * | AddInstance (FCDEntity::Type type)
| Creates a new entity instance.
size_t | GetTransformCount () const
| Retrieves the number of transforms for this node of the scene graph.
FCDTransform * | GetTransform (size_t index)
| Retrieves a specific transform.
const FCDTransform * | GetTransform (size_t index) const
| See above.
const FCDTransform ** | GetTransforms () const
| Retrieves the list of transforms for this node of the scene graph. See above.
FCDTransform * | AddTransform (FCDTransform::Type type, size_t index=(size_t)-1)
| Creates a new transform for this visual scene node.
void | GetHierarchicalAssets (FCDAssetList &assets)
| Retrieves the asset information structures that affect this entity in its hierarchy.
virtual void | GetHierarchicalAssets (FCDAssetConstList &assets) const
| See above.
virtual FCDEntity * | FindDaeId (const fm::string &daeId)
| Retrieves the visual scene node with the given id.
virtual const FCDEntity * | FindDaeId (const fm::string &daeId) const
| See above.
const fm::string & | GetSubId () const
| Retrieves the optional sub-id of the node.
void | SetSubId (const fm::string &id)
| Sets the sub-id for this node.
FCDEntity * | FindSubId (const fm::string &subId)
| Retrieves the visual scene node with the given sub-id.
const FCDEntity * | FindSubId (const fm::string &subId) const
| See above.
FCDParameterAnimatableFloat & | GetVisibility ()
| Retrieves whether the visual scene node is visible.
const FCDParameterAnimatableFloat & | GetVisibility () const
| See above.
bool | IsVisible () const
| See above.
void | SetVisibility (bool isVisible)
| Sets the visibility of the visual scene node.
bool | IsTarget () const
| Retrieves whether this visual scene node is the target of an entity.
| DEPRECATED (3.05A, GetJointFlag) bool IsJoint() const
| Retrieves whether this visual scene node is a joint.
FMMatrix44 | ToMatrix () const
| Retrieves the local transform for this visual scene node.
FMMatrix44 | CalculateLocalTransform () const
| Retrieves the local transform for this visual scene node.
FMMatrix44 | CalculateWorldTransform () const
| Retrieves the world transform for this visual scene node.
virtual FCDEntity * | Clone (FCDEntity *clone=NULL, bool cloneChildren=false) const
| Copies the entity information into a clone.
void | IncrementTargetCount ()
| [INTERNAL] Increments the number of entities target this node.
void | DecrementTargetCount ()
| [INTERNAL] Decrements the number of entities target this node.
virtual void | CleanSubId ()
| [INTERNAL] Cleans up the sub identifiers.

## Detailed Description

A COLLADA visual scene node.

This class is also used to represent COLLADA visual scene entities.

A visual scene node contains child scene nodes to make a tree. A visual scene node may appear multiple times within the scene graph, but checks are made to verify that there are no cycles within the graph.

A visual scene node also contained an ordered list of transformations and a list of entity instances.

NOTE: The GenerateSampledMatrixAnimation function was moved to the FCDSceneNodeTools namespace to improve DLL support.

## Constructor & Destructor Documentation

FCDSceneNode::FCDSceneNode | ( | FCDocument * | document | ) |

  | Constructor: do not use directly. Instead, use the FCDSceneNode::AddChild function for child visual scene nodes or the FCDLibrary::AddEntity function for visual scenes. Parameters:
  | document | The COLLADA document that owns the scene node.

## Member Function Documentation

bool FCDSceneNode::AddChildNode | ( | FCDSceneNode * | sceneNode | ) |

  | Attaches a existing scene node to this visual scene node. This function will fail if attaching the given scene node to this visual scene node creates a cycle within the scene graph. Parameters:
  | sceneNode | The scene node to attach.
Returns: Whether the given scene node was attached to this scene node.

FCDSceneNode* FCDSceneNode::AddChildNode | ( |  | ) |

| Creates a new child scene node. Returns: The new child scene node.

FCDEntityInstance* FCDSceneNode::AddInstance | ( | FCDEntity::Type | type | ) |

  | Creates a new entity instance. Only geometric entities, controllers, light and cameras can be instantiated in the scene graph. To instantiate visual scene nodes, use the AddChildNode function. Parameters:
  | type | The type of entity to instantiate.
Returns: The entity instance structure. This pointer will be NULL if the entity cannot be instantiated here.

FCDEntityInstance* FCDSceneNode::AddInstance | ( | FCDEntity * | entity | ) |

  | Creates a new entity instance. Only geometric entities, controllers, light and cameras can be instantiated in the scene graph. To instantiate visual scene nodes, use the AddChildNode function. Parameters:
  | entity | The entity to instantiate. This pointer cannot be NULL.
Returns: The entity instance structure. This pointer will be NULL if the entity cannot be instantiated here or if the entity is a scene node.

FCDTransform* FCDSceneNode::AddTransform | ( | FCDTransform::Type | type,
|  | size_t | index = `(size_t)-1`
| ) |

  | Creates a new transform for this visual scene node. The transforms are processed in order and COLLADA is column-major. For row-major matrix stacks, such as DirectX, this implies that the transformations will be processed in reverse order. By default, a transform is added at the end of the list. Parameters:
  | type | The type of transform to create.
  | index | The index at which to insert the transform. Set this value to -1 to indicate that you want this transform at the end of the stack.
Returns: The created transform.

FMMatrix44 FCDSceneNode::CalculateLocalTransform | ( |  | ) | const`[inline]`

| Retrieves the local transform for this visual scene node. This is a shortcut to the above function. The above function will be deprecated in the future. Returns: The local transform.

FMMatrix44 FCDSceneNode::CalculateWorldTransform | ( |  | ) | const

| Retrieves the world transform for this visual scene node. This function is not optimized and will not work with node instances. Returns: The world transform.

virtual void FCDSceneNode::CleanSubId | ( |  | ) | `[virtual]`

| [INTERNAL] Cleans up the sub identifiers. The sub identifiers must be unique with respect to its parent. This method corrects the sub ids if there are conflicts.

virtual FCDEntity* FCDSceneNode::Clone | ( | FCDEntity * | clone = `NULL`,
|  | bool | cloneChildren = `false`
| ) | const`[virtual]`

  | Copies the entity information into a clone. All the overwriting functions of this function should call this function to copy the COLLADA id and the other entity-level information. All the up-classes of this class should implement this function. The cloned entity may reside in another document. Parameters:
  | clone | The empty clone. If this pointer is NULL, a new entity will be created and you will need to release the returned pointer manually.
  | cloneChildren | Whether to recursively clone this entity's children.
Returns: The clone. Reimplemented from FCDEntity.

void FCDSceneNode::DecrementTargetCount | ( |  | ) | `[inline]`

| [INTERNAL] Decrements the number of entities target this node. To set targets, use the FCDTargetedEntity::SetTarget function.

FCDSceneNode::DEPRECATED | ( | 3. | 05A,
|  | GetJointFlag |
| ) | const`[inline]`

| Retrieves whether this visual scene node is a joint. Joints are called bones in 3dsMax. A joint is a scene node that is used in skinning. Returns: Whether this node is a joint.

virtual FCDEntity* FCDSceneNode::FindDaeId | ( | const fm::string & | daeId | ) | `[inline, virtual]`

  | Retrieves the visual scene node with the given id. This function looks through the whole sub-tree of visual scene nodes for the wanted COLLADA id. Parameters:
  | daeId | The COLLADA id to look for.
Returns: The visual scene node which has the given COLLADA id. This pointer will be NULL if no visual scene node can be found with the given COLLADA id. Reimplemented from FCDEntity.

FCDEntity* FCDSceneNode::FindSubId | ( | const fm::string & | subId | ) | `[inline]`

  | Retrieves the visual scene node with the given sub-id. This function looks through the whole sub-tree of visual scene nodes for the wanted COLLADA sub-id. Parameters:
  | subId | The COLLADA sub-id to look for.
Returns: The visual scene node which has the given COLLADA sub-id. This pointer will be NULL if no visual scene node can be found with the given COLLADA sub-id.

FCDSceneNode* FCDSceneNode::GetChild | ( | size_t | index | ) | `[inline]`

  | Retrieves a specific child of the visual scene node. Parameters:
  | index | The index of the child.
Returns: The child scene node. This pointer will be NULL if the index is out-of-bounds.

const FCDSceneNode** FCDSceneNode::GetChildren | ( |  | ) | const`[inline]`

| Retrieves the list of children of the visual scene node. Returns: The list of child scene nodes.

size_t FCDSceneNode::GetChildrenCount | ( |  | ) | const`[inline]`

| Retrieves the number of child nodes for this visual scene node. Returns: The number of children.

void FCDSceneNode::GetHierarchicalAssets | ( | FCDAssetList & | assets | ) | `[inline]`

  | Retrieves the asset information structures that affect this entity in its hierarchy. Parameters:
  | assets | A list of asset information structures to fill in.
Reimplemented from FCDEntity.

FCDEntityInstance* FCDSceneNode::GetInstance | ( | size_t | index | ) | `[inline]`

  | Retrieves a specific entity instance. Parameters:
  | index | The index of the instance.
Returns: The entity instance at the given index. This pointer will be NULL if the index is out-of-bounds.

size_t FCDSceneNode::GetInstanceCount | ( |  | ) | const`[inline]`

| Retrieves the number of entity instances at this node of the scene graph. Returns: The number of entity instances.

const FCDEntityInstance** FCDSceneNode::GetInstances | ( |  | ) | const`[inline]`

| Retrieves the list of entity instances at this node of the scene graph. Returns: The list of entity instances.

FCDSceneNode* FCDSceneNode::GetParent | ( | size_t | index = `0` | ) | `[inline]`

  | Retrieves a specific parent of the visual scene node. Parameters:
  | index | The index of the parent.
Returns: The parent visual scene node. This pointer will be NULL if the scene node has no parents or if the index is out-of-bounds.

size_t FCDSceneNode::GetParentCount | ( |  | ) | const`[inline]`

| Retrieves the number of parent nodes for this visual scene node. Returns: The number of parents.

const FCDSceneNode** FCDSceneNode::GetParents | ( |  | ) | const`[inline]`

| Retrieves the list of parents for the visual scene node. Returns: The list of parents.

const fm::string& FCDSceneNode::GetSubId | ( |  | ) | const`[inline]`

| Retrieves the optional sub-id of the node. This sub-id is neither unique nor guaranteed to exist. Returns: The sub-id of the node.

FCDTransform* FCDSceneNode::GetTransform | ( | size_t | index | ) | `[inline]`

  | Retrieves a specific transform. Parameters:
  | index | The index of the transform.
Returns: The transform at the given index. This pointer will be NULL if the index is out-of-bounds.

size_t FCDSceneNode::GetTransformCount | ( |  | ) | const`[inline]`

| Retrieves the number of transforms for this node of the scene graph. Returns: The number of transforms.

const FCDTransform** FCDSceneNode::GetTransforms | ( |  | ) | const`[inline]`

| Retrieves the list of transforms for this node of the scene graph. See above. Returns: The list of transforms.

virtual Type FCDSceneNode::GetType | ( |  | ) | const`[inline, virtual]`

| Retrieves the type of the entity class. Returns: The type of entity class: SCENE_NODE. Reimplemented from FCDEntity.

FCDParameterAnimatableFloat& FCDSceneNode::GetVisibility | ( |  | ) | `[inline]`

| Retrieves whether the visual scene node is visible. A hidden visual scene node will not be rendered but will still affect the world. This parameter is a floating-point value because it is animated. It should be intepreted as a Boolean value. Returns: Whether the scene node is visible.

void FCDSceneNode::IncrementTargetCount | ( |  | ) | `[inline]`

| [INTERNAL] Increments the number of entities target this node. To set targets, use the FCDTargetedEntity::SetTarget function.

bool FCDSceneNode::IsTarget | ( |  | ) | const`[inline]`

| Retrieves whether this visual scene node is the target of an entity. Returns: Whether this is an entity target.

void FCDSceneNode::RemoveChildNode | ( | FCDSceneNode * | childNode | ) |

  | Removes a scene node from this scene node direct child list. This function should be used to detach a scene node with multiple parents. To completely delete a scene node, you should use the FCDSceneNode::Release function on the scene node to delete. If the given child node is instanced multiple times within this scene node, only the first instance will be removed. Parameters:
  | childNode | The child node to remove from the direct hierarchy.

void FCDSceneNode::SetSubId | ( | const fm::string & | id | ) |

  | Sets the sub-id for this node. The sub-id of an object is not required to be unique. Parameters:
  | id | The new sub-id of the node.

void FCDSceneNode::SetVisibility | ( | bool | isVisible | ) | `[inline]`

  | Sets the visibility of the visual scene node. A hidden visual scene node will not be rendered but will still affect the world. Parameters:
  | isVisible | Whether the visual scene node is visible.

FMMatrix44 FCDSceneNode::ToMatrix | ( |  | ) | const

| Retrieves the local transform for this visual scene node. This function does not handle or apply animations. Returns: The local transform.

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

- FCDocument/FCDSceneNode.h