C3DObject::AddChild

Top  Previous  Next

Syntax:

 

AddChild(C3DObject pChild)

 

Purpose:

Adds a child object to the list of objects to be drawn and transformed.

 

Parameters:

pChild - A C3DObject or derived class to add.

 

Returned value(s):

None.

 

Application:

scene.CreateScene(scrn1)
scene.AddChild(light)
scene.AddChild(m)

 

Class Hierarchy

C3DObject

 

Additional Info:

A scene consists of objects connected in a hierarchy.  When a child is added to a parent object the child will be positioned relative to its parent allowing complex scenes to be built.  Once an object is added to a parent only the parent object needs to be freed with the Free method. Rendering the parent object with Draw will also draw all of its children.

 

The object must have been created with CreateScene, CreateTransform, or be a derived class such as C3DMesh that has validly loaded geometry.