| Package | sandy.core |
| Class | public class Scene3D |
| Inheritance | Scene3D flash.events.EventDispatcher |
| Subclasses | World3D |
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.
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 );
| Property | Defined 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 | ||
| Property | Defined by | ||
|---|---|---|---|
| m_sName : String | Scene3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
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 | ||
| camera | property |
public var camera:Camera3DThe camera looking at this scene.
| container | property |
public var container:SpriteThe container that stores all displayabel objects for this scene.
| light | property |
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_sName | property |
protected var m_sName:String
| name | property |
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
| rectClipping | property |
rectClipping:Boolean [read-write]Implementation
public function get rectClipping():Boolean
public function set rectClipping(value:Boolean):void
| root | property |
public var root:GroupThe root of the scene graph for this scene.
| 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
Parametersp_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
|
| dispose | () | method |
public function dispose():BooleanDispose all the resources of this given scene.
Ressources will be free, and scene unregistered from SceneLocator
ReturnsBoolean |
| render | () | method |
public function render(p_oEvt:SandyEvent = null):voidRenders this scene into its display object container.
Parametersp_oEvt:SandyEvent (default = null) — An eventual event - defaults to null
|