SceneObject3D

Kind of class:public class
Package:org.papervision3d.core.proto
Inherits from:DisplayObjectContainer3D < EventDispatcher
Known subclasses:
Classpath:org.papervision3d.core.proto.SceneObject3D
File last modified:Sunday, 02 March 2008, 15:23:35
The SceneObject3D class is the base class for all scenes.

A scene is the place where objects are placed, it contains the 3D environment.

The scene manages all objects rendered in Papervision3D. It extends the DisplayObjectContainer3D class to arrange the display objects.

SceneObject3D is an abstract base class; therefore, you cannot call SceneObject3D directly.

Summary


Constructor
Instance properties
Instance methods

Constructor

SceneObject3D

public function SceneObject3D (
)

The SceneObject3D class lets you create scene classes.
Parameters:
container:
The Sprite that you draw into when rendering. If not defined, each object must have it's own private container.

Instance properties

animated

public animated:Boolean = false
(read,write)

A boolean flag indicating whether or not to use animation.

animationEngine

public animationEngine:AnimationEngine
(read,write)

A reference to the AnimationEngine. Only available if the scene3d is set to animated. @see org.papervision3d.animation.core.AnimationEngine

materials

public materials:MaterialsList
(read,write)

It contains a list of materials in the scene.

objects

public objects:Array
(read,write)

It contains a list of DisplayObject3D objects in the scene.

Instance methods

addChild

override public function addChild (
child:DisplayObject3D, name:String = null) : DisplayObject3D

Adds a child DisplayObject3D instance to the scene.

If you add a GeometryObject3D symbol, a new DisplayObject3D instance is created.

[TODO: If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.]
Parameters:
child:
The GeometryObject3D symbol or DisplayObject3D instance to add as a child of the scene.
name :
An optional name of the child to add or create. If no name is provided, the child name will be used.
Returns:
  • The DisplayObject3D instance that you have added or created.

removeChild

override public function removeChild (

Removes the specified child DisplayObject3D instance from the child and object list of the scene.

[TODO: The parent property of the removed child is set to null, and the object is garbage collected if no other references to the child exist.]

The garbage collector is the process by which Flash Player reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist.

Parameters:
child:
The DisplayObject3D instance to remove.
Returns:
  • The DisplayObject3D instance that you pass in the child parameter.