Game Development Reference
In-Depth Information
UpdateChildObjects('Neck')
UpdateChildObjects('Head')
UpdateChildObjects('Right Shoulder')
UpdateChildObjects('Right Bicep')
UpdateChildObjects('Right Forearm')
UpdateChildObjects('Right Hand')
Only the call to UpdateChildObjects with 'Torso' as the parameter finds
more than one object in the object list that needs updating. The remainder
of the objects are the parents of at most one object. If the hierarchies of
objects in your scene remain constant after loading, then you could
eliminate some of the function call overheads by changing the order of
objects in the scene so that a parent is transformed before a child simply
by traversing the object list once. In this simple example, this would be
achieved by ordering the list as in Table 7.2.
Table 7.2 Object list and parents suitable for once-through transformations
Object
Parent
Next pointer
m_ObjectList
NULL
Torso
Torso
NULL
Left Shoulder
Left Shoulder
Torso
Left Bicep
Left Bicep
Left Shoulder
Left Forearm
Left Forearm
Left Bicep
Left Hand
Left Hand
Left Forearm
Neck
Neck
Torso
Head
Head
Neck
Right Shoulder
Right Shoulder
Torso
Right Bicep
Right Bicep
Right Shoulder
Right Forearm
Right Forearm
Right Bicep
Right Hand
Right Hand
Right Forearm
NULL
A development engine with objects being added and moved around
would probably lend itself to the recursive 'UpdateChildObjects' option,
whilst a runtime engine where speed of execution is the highest priority
would be more suited to the once-through list that is guaranteed to be in
a suitable ordering.
 
Search Nedrilad ::




Custom Search