Packagesandy.core
Classpublic class Scene3D
InheritanceScene3D Inheritance flash.events.EventDispatcher
SubclassesWorld3D

The Scene3D object is the central point of a Sandy world.

You can have multiple Scene3D objects in the same application.
The older World3D is a singleton special case of Scene3D.
The scene contains the object tree with groups, a camera, a light source and a canvas to draw on.


Example
To create a scene, you pass a container, a camera and a root group to its constructor.
The rendering of the world is driven by a "heart beat", which may be a Timer or the Event.ENTER_FRAME event.
   var camera:Camera3D = new Camera3D( 400, 300 );
   camera.z = -200;
   // The call to createScene() will create the root Group of this scene
   var scene:Scene3D = new Scene3D('Scene 1',this, camera, createScene());
   scene.root.addChild( camera );
   //The handler calls the world.render() method to render the world for each frame.
   addEventListener( Event.ENTER_FRAME, enterFrameHandler );
  



Public Properties
 PropertyDefined by
  camera : Camera3D
The camera looking at this scene.
Scene3D
  container : Sprite
The container that stores all displayabel objects for this scene.
Scene3D
  light : Light3D
The simple light of this scene.
Scene3D
  name : String
[read-only] Returns the scene's name as a string value.
Scene3D
  rectClipping : Boolean
Scene3D
  root : Group
The root of the scene graph for this scene.
Scene3D
Protected Properties
 PropertyDefined by
  m_sName : String
Scene3D
Public Methods
 MethodDefined by
  
Scene3D(p_sName:String, p_oContainer:Sprite, p_oCamera:Camera3D = null, p_oRootNode:Group = null)
Creates a new Scene.
Scene3D
  
dispose():Boolean
Dispose all the resources of this given scene.
Scene3D
  
render(p_oEvt:SandyEvent = null):void
Renders this scene into its display object container.
Scene3D
Property detail
cameraproperty
public var camera:Camera3D

The camera looking at this scene.

containerproperty 
public var container:Sprite

The container that stores all displayabel objects for this scene.

lightproperty 
light:Light3D  [read-write]

The simple light of this scene.

Implementation
    public function get light():Light3D
    public function set light(value:Light3D):void

See also

m_sNameproperty 
protected var m_sName:String
nameproperty 
name:String  [read-only]

Returns the scene's name as a string value. This value can't be changed.

Implementation
    public function get name():String
rectClippingproperty 
rectClipping:Boolean  [read-write]Implementation
    public function get rectClipping():Boolean
    public function set rectClipping(value:Boolean):void
rootproperty 
public var root:Group

The root of the scene graph for this scene.

Constructor detail
Scene3D()constructor
public function Scene3D(p_sName:String, p_oContainer:Sprite, p_oCamera:Camera3D = null, p_oRootNode:Group = null)

Creates a new Scene.

Each scene has its own container where its 2D representation will be drawn.
The scene is automatically registered with the SceneLocator.

Remember to give the scenes different names if you want to use the SceneLocator registry

Parameters
p_sName:String — The name of this scene
 
p_oContainer:Sprite — The container that will store all displayable objects for this scene
 
p_oCamera:Camera3D (default = null) — The single camera for this scene
 
p_oRootNode:Group (default = null) — The root group of the object tree for this scene
Method detail
dispose()method
public function dispose():Boolean

Dispose all the resources of this given scene.

Ressources will be free, and scene unregistered from SceneLocator

Returns
Boolean
render()method 
public function render(p_oEvt:SandyEvent = null):void

Renders this scene into its display object container.

Parameters
p_oEvt:SandyEvent (default = null) — An eventual event - defaults to null