Composite Actors

Function AddCompositeChild(actor, child_actor, t_matrix)

Adds a child Actor to a composite actor.

Returns the child index in the composite actor.

NOTE: Reference the included Composite Demo for an example


Function GetCompositeChildCount(actor)

Returns the number of child actors in a composite actor


Function GetCompositeChild(actor, child_index)

Returns the actor stored as the child actor at a given index in a composite actor


Function GetCompositeChildIndex(actor, child_index)

Returns the index an actor is stored at in a composite actorr


Sub RemoveCompositeChild(actor, child_index)

Removes the actor stored as a child at the given index in a composite actor

NOTE: This will change the index of all the remaining child actors


Function GetCompositeChildTransform(actor, child_index, t_matrix)

Stores the transform from composite actor to the child index shape in t_matrix.


Function GetCompositeAABB(actor, t_matrix, ByRef min_x, ByRef min_y, ByRef min_z, ByRef max_x, ByRef max_y, ByRef max_z)

Returns the bounding box of a composite actor

t_matrix will store the transform for the bounding box.


Sub RecalculateCompositeAABB(actor)

Recalculates the bounding box for a composite actor.


Sub GenerateCompositeAABBFromChildren(actor)

Generates a bounding box based on the child actorsr.


Sub CalculateCompositePrincipalTransform(actor, ByRef masses, principal_matrix, ByRef x, ByRef y, ByRef z)

Calculates the center of mass and principal intertia axes for a composite actor.

Parameters:

  • masses - An array with masses for each child in the compound shape.
  • principal_matrix - This will be set to principal axis transform (x, y, z) - Inertia

Sub UpdateCompositeChildTransform(actor, child_index, t_matrix, recalc_flag)

Sets a new child transform and updates dynamic AABB tree.


Function GetCompositeUpdateRevision(actor)

Returns a counter that increments when the composite actor shape is modifed.