| 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 | ||
| materialManager : MaterialManager
The material manager for the scene.
| Scene3D | ||
| name : String [read-only]
Returns the scene's name as a string value.
| Scene3D | ||
| rectClipping : Boolean
Enable this property (default value is true!) to perfectly clip your 3D scene to the viewport dimension.
| Scene3D | ||
| root : Group
The root of the scene graph for this scene.
| 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 | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when a light is added to the scene. | Scene3D | |||
| Dispatched when the scene is culled. | Scene3D | |||
| Dispatched when the scene is rendered. | Scene3D | |||
| Dispatched when the display list is rendered. | Scene3D | |||
| Dispatched when the scene is updated. | Scene3D | |||
| camera | property |
| 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
| materialManager | property |
public var materialManager:MaterialManagerThe material manager for the scene.
| 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]Enable this property (default value is true!) to perfectly clip your 3D scene to the viewport dimension. Once enabled, even if you don't have enableClipping set to true for each of your objects, nothing will be drawn outside
Implementation public function get rectClipping():Boolean
public function set rectClipping(value:Boolean):void
| root | property |
| 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
|
See also
| 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. Not in use...
|
See also
| lightAdded | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.LIGHT_ADDED
Dispatched when a light is added to the scene.
Defines the value of the type property of a lightAdded event object.
| scene_cull | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.SCENE_CULL
Dispatched when the scene is culled.
Defines the value of the type property of a scene_cull event object.
| scene_render | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.SCENE_RENDER
Dispatched when the scene is rendered.
Defines the value of the type property of a scene_render event object.
| scene_render_display_list | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.SCENE_RENDER_DISPLAYLIST
Dispatched when the display list is rendered.
Defines the value of the type property of a scene_render_display_list event object.
| scene_update | event |
sandy.events.SandyEvent
sandy.events.SandyEvent.SCENE_UPDATE
Dispatched when the scene is updated.
Defines the value of the type property of a scene_update event object.