Index

 E3d_ModelHrcFree
 E3d_ModelHrcMap2DTextures
 E3d_ModelHrcRefreshHierarchy
 E3d_ModelHrcRefreshMatrices
 E3d_ModelHrcRefreshMatricesNoScaling
 E3d_ModelHrcFreezeScaling
 E3d_ModelHrcSkeletonSetDefaultTransform
 E3d_ModelHrcBranchGetLastNode
 E3d_ModelHrcBranchGetNodeAfter


E3d_ModelHrcFree

Free a Model hierarchy

Syntax
 void E3d_ModelHrcFree(E3dModel* LRootModel, EBool LAllTypes)
Argument
 E3dModel* LRootModel       Pointer to the Root of the hierarchy to be freed
Description
This function parses through the given hierarchy and frees the memory associated with each node and its Geometries.

Return value
None.

E3d_ModelHrcMap2DTextures

(Re)Map 2DTextures of Model hierarchy

Syntax
 void E3d_ModelHrcMap2DTextures(E3dModel* LRootModel)
Argument
 E3dModel*  LRootModel      Pointer to the Root of the hierarchy
Description
This function parses through the given hierarchy and recomputes the 2DTexture coordinates (S and T) based on the mapping-method and parameters.

Return value
None.

E3d_ModelHrcRefreshHierarchy

Update all links and other internal data of a hierarchy

Syntax
 void E3d_ModelHrcRefreshHierarchy(E3dModel* LRootModel)
Argument
 E3dModel* LRootModel       Pointer to the Root of the hierarchy
Description
This function prepares a hierarchy for efficient parsing and rendering: it walks through the Models of the hierarchy and updates the Prev, Next and PrevSibling link fields and other internal information on each Model, using only the Parent, Child and NextSibling links.
The Prev and Next links will follow the "depth-first" order, and only apply within that hierarchy.
See the diagram below:


Note that hierarchies are NOT linked in any way, but a Scene keeps an array of its hierarchies.
When creating a new hierarchy, or changing the links in an existing one (topology change), the application only has to set the Parent, Child and NextSibling links of the Models, and then call this function with the root Model of the hierarchy.

Return value
None.

See also
E3d_ModelHrcRefreshMatrices

E3d_ModelHrcRefreshMatrices

Compute transformation Matrices of a Model hierarchy

Syntax
 void E3d_ModelHrcRefreshMatrices(E3dModel* LBranchRootModel)
Argument
 E3dModel* LBranchRootModel       Pointer to the Root of the tree or branch
Description
Parses through the given hierarchy and recomputes the LocalToWorldMatrix and LocalToWorldNormalMatrix on each node, using the transformation values of that Model node. E3d_ModelHrcRefreshMatrices() should be called on a hierarchy after a change in local transformation values (Scaling, Rotation, Translation) on the Model nodes.

Return value
None.

See also
E3d_ModelHrcRefreshMatricesNoScaling, E3d_ModelHrcRefreshHierarchy

E3d_ModelHrcRefreshMatricesNoScaling

Update the LocalToWorld Matrices of a Model hierarchy

Syntax
 void E3d_ModelHrcRefreshMatricesNoScaling(E3dModel* LRootModel)
Arguments
 E3dModel*     LModel           Pointer to the root Model of the hierarchy
Description
This function walks through the given hierarchy following the Parent, Child and NextSibling links (depth-first) and refreshes the local-to-world matrix field (LocalToWorldMatrix) of the Model nodes. E3d_ModelHrcRefreshMatricesNoScaling() should be called on a hierarchy after a change in local transformation values (Scaling, Rotation, Translation) on the Model nodes. This function ignores the Scaling values of the Model nodes, so it is much faster than E3d_ModelHrcRefreshMatrices(), but it only works correctly with Models that have "unit scaling" (1.0, 1.0, 1.0).

Return value
None.

See also
E3d_ModelHrcRefreshMatrices, E3d_ModelHrcRefreshHierarchy

E3d_ModelHrcFreezeScaling

Freeze scaling on a hierarchy or a branch (sub-tree of a hierarchy)

Syntax
 int E3d_ModelHrcFreezeScaling(E3dModel* LBranchRootModel)
Argument
 E3dModel* LBranchRootModel     Pointer to the Root of the branch
Description
This function performs the scaling on the geometries of each node in the tgiven hierarchy or branch, then sets the scaling values to 1.0.

Return value
None.

E3d_ModelHrcSkeletonSetDefaultTransform

Make the current "pose" of a JointModel hierarchy its default pose

Syntax
 void E3d_ModelHrcSkeletonSetDefaultTransform(E3dModel* LModel)
Arguments
 E3dModel* LModel             Root Model of the skeleton hierarchy
Description
Makes the current pose of the Skeleton hierarchy its default pose by setting the WorldToDefaultMatrix of each Model to the inverse of the Model's LocalToWorldMatrix

Return value
None.

See also
E3d_SkinMeshBindPose

E3d_ModelHrcBranchGetLastNode

Get the last Model-node of a branch (sub-tree of a hierarchy)

Syntax
 E3dModel* E3d_ModelHrcBranchGetLastNode(E3dModel* LBranchRootModel)
Argument
 E3dModel*  LBranchRootModel    Pointer to the Root of the branch
Description
Parses through the given branch (in depth-first order) and gets the last Model-node that belongs to this branch (that is: it is still a descendant of LBranchRootModel).

Return value
The last Model-node of the given branch, or NULL in case of an error.

E3d_ModelHrcBranchGetNodeAfter

Get todel-node that follows a branch (sub-tree of a hierarchy)

Syntax
 E3dModel* E3d_ModelHrcBranchGetNodeAfter(E3dModel* LBranchRootModel)
Argument
 E3dModel* LBranchRootModel     Pointer to the Root of the branch
Description
Parses through the given branch (in depth-first order) and gets the Model-node that comes after the last node of the given branch (the next one after the last descendant of LBranchRootModel).

Return value
The Model-node following the given branch (can be NULL).