Packageaway3d.containers
Classpublic class View3D
InheritanceView3D Inheritance flash.display.Sprite

Sprite container used for storing camera, scene, session, renderer and clip references, and resolving mouse events



Public Properties
 PropertyDefined By
  background : Sprite
A background sprite positioned under the rendered scene.
View3D
  camera : Camera3D
Camera used when rendering.
View3D
  cameraVarsStore : CameraVarsStore
[read-only]
View3D
  clipping : Clipping
Clipping area used when rendering.
View3D
  forceUpdate : Boolean
Defines whether the view always redraws on a render, or just redraws what 3d objects change.
View3D
  foreground : Sprite
A container for 2D overlays positioned over the rendered scene.
View3D
  hitManager : HitManager
[read-only]
View3D
  mouseEvents : Boolean
Enables/Disables mouse interactivity.
View3D
  mouseMaterial : Material
Current material under the mouse.
View3D
  mouseObject : Object3D
Current object under the mouse.
View3D
  mouseZeroMove : Boolean
Forces mousemove events to fire even when cursor is static.
View3D
  overlay : Sprite
An overlay sprite positioned on top of the rendered scene.
View3D
  renderer : Renderer
Renderer object used to traverse the scenegraph and output the drawing primitives required to render the scene to the view.
View3D
  scene : Scene3D
Scene used when rendering.
View3D
  screenClipping : Clipping
[read-only]
View3D
  session : AbstractSession
Session object used to draw all drawing primitives returned from the renderer to the view container.
View3D
  sourceURL : String
Optional string for storing source url.
View3D
  stats : Boolean
Enables/Disables stats panel.
View3D
  statsOpen : Boolean
Keeps track of whether the stats panel is currently open.
View3D
  statsPanel : Stats
Object instance of the stats panel.
View3D
  updated : Boolean
[read-only] Flag used to determine if the camera has updated the view.
View3D
  viewSourceObject : ViewSourceObject
[read-only]
View3D
Public Methods
 MethodDefined By
  
View3D(init:Object = null)
Creates a new View3D object.
View3D
  
addOnMouseDown(listener:Function):void
Default method for adding a mouseDown3d event listener.
View3D
  
addOnMouseMove(listener:Function):void
Default method for adding a mouseMove3d event listener.
View3D
  
addOnMouseOut(listener:Function):void
Default method for adding a 3d mouseOut event listener.
View3D
  
addOnMouseOver(listener:Function):void
Default method for adding a 3d mouseOver event listener.
View3D
  
addOnMouseUp(listener:Function):void
Default method for adding a mouseUp3d event listener.
View3D
  
addOverlay(value:IOverlay):void
Adds an overlay effect on top of the view container.
View3D
  
addSourceURL(url:String):void
Defines a source url string that can be accessed though a View Source option in the right-click menu.
View3D
  
clear():void
Clears previously rendered view from all render sessions.
View3D
  
fireMouseEvent(type:String, x:Number, y:Number, ctrlKey:Boolean = false, shiftKey:Boolean = false):void
Collects all information from the given type of 3d mouse event into a MouseEvent3D object that can be accessed from the getMouseEvent() method.
View3D
  
fireMouseMoveEvent(force:Boolean = false):void
Manually fires a mouseMove3D event.
View3D
  
getBitmapData():BitmapData
Returns the bitmapData of the rendered scene.
View3D
  
getContainer():DisplayObject
Returns the DisplayObject container of the rendered scene.
View3D
  
removeOnMouseDown(listener:Function):void
Default method for removing a mouseDown3d event listener.
View3D
  
removeOnMouseMove(listener:Function):void
Default method for removing a mouseMove3D event listener.
View3D
  
removeOnMouseOut(listener:Function):void
Default method for removing a 3d mouseOut event listener.
View3D
  
removeOnMouseOver(listener:Function):void
Default method for removing a 3d mouseOver event listener.
View3D
  
removeOnMouseUp(listener:Function):void
Default method for removing a 3d mouseUp event listener.
View3D
  
Removes an overlay effect on top of the view container.
View3D
  
render():void
Renders a snapshot of the view to the render session's view container.
View3D
  
View3D
Events
 Event Summary Defined By
  Dispatched when a user presses the let hand mouse button while the cursor is over a 3d objectView3D
  Dispatched when a user moves the cursor while it is over a 3d objectView3D
  Dispatched when a user moves the cursor away from a 3d objectView3D
  Dispatched when a user moves the cursor over a 3d objectView3D
  Dispatched when a user releases the let hand mouse button while the cursor is over a 3d objectView3D
Property Detail
backgroundproperty
public var background:Sprite

A background sprite positioned under the rendered scene.

cameraproperty 
camera:Camera3D

Camera used when rendering.


Implementation
    public function get camera():Camera3D
    public function set camera(value:Camera3D):void

See also

cameraVarsStoreproperty 
cameraVarsStore:CameraVarsStore  [read-only]


Implementation
    public function get cameraVarsStore():CameraVarsStore
clippingproperty 
clipping:Clipping

Clipping area used when rendering. If null, the visible edges of the screen are located with the Clipping.screen() method.


Implementation
    public function get clipping():Clipping
    public function set clipping(value:Clipping):void

See also

render()
away3d.core.render.Clipping.scene()
forceUpdateproperty 
public var forceUpdate:Boolean

Defines whether the view always redraws on a render, or just redraws what 3d objects change. Defaults to false.

See also

foregroundproperty 
public var foreground:Sprite

A container for 2D overlays positioned over the rendered scene.

hitManagerproperty 
hitManager:HitManager  [read-only]


Implementation
    public function get hitManager():HitManager
mouseEventsproperty 
public var mouseEvents:Boolean

Enables/Disables mouse interactivity.

mouseMaterialproperty 
public var mouseMaterial:Material

Current material under the mouse.

mouseObjectproperty 
public var mouseObject:Object3D

Current object under the mouse.

mouseZeroMoveproperty 
public var mouseZeroMove:Boolean

Forces mousemove events to fire even when cursor is static.

overlayproperty 
public var overlay:Sprite

An overlay sprite positioned on top of the rendered scene.

rendererproperty 
renderer:Renderer

Renderer object used to traverse the scenegraph and output the drawing primitives required to render the scene to the view.


Implementation
    public function get renderer():Renderer
    public function set renderer(value:Renderer):void
sceneproperty 
scene:Scene3D

Scene used when rendering.


Implementation
    public function get scene():Scene3D
    public function set scene(value:Scene3D):void

See also

render()
screenClippingproperty 
screenClipping:Clipping  [read-only]


Implementation
    public function get screenClipping():Clipping
sessionproperty 
session:AbstractSession

Session object used to draw all drawing primitives returned from the renderer to the view container.


Implementation
    public function get session():AbstractSession
    public function set session(value:AbstractSession):void

See also

sourceURLproperty 
public var sourceURL:String

Optional string for storing source url.

statsproperty 
public var stats:Boolean

Enables/Disables stats panel.

See also

statsOpenproperty 
public var statsOpen:Boolean

Keeps track of whether the stats panel is currently open.

See also

statsPanelproperty 
public var statsPanel:Stats

Object instance of the stats panel.

See also

updatedproperty 
updated:Boolean  [read-only]

Flag used to determine if the camera has updated the view.


Implementation
    public function get updated():Boolean

See also

viewSourceObjectproperty 
viewSourceObject:ViewSourceObject  [read-only]


Implementation
    public function get viewSourceObject():ViewSourceObject
Constructor Detail
View3D()Constructor
public function View3D(init:Object = null)

Creates a new View3D object.

Parameters
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
####INIT####
Method Detail
addOnMouseDown()method
public function addOnMouseDown(listener:Function):void

Default method for adding a mouseDown3d event listener.

Parameters

listener:Function — The listener function.

addOnMouseMove()method 
public function addOnMouseMove(listener:Function):void

Default method for adding a mouseMove3d event listener.

Parameters

listener:Function — The listener function.

addOnMouseOut()method 
public function addOnMouseOut(listener:Function):void

Default method for adding a 3d mouseOut event listener.

Parameters

listener:Function — The listener function.

addOnMouseOver()method 
public function addOnMouseOver(listener:Function):void

Default method for adding a 3d mouseOver event listener.

Parameters

listener:Function — The listener function.

addOnMouseUp()method 
public function addOnMouseUp(listener:Function):void

Default method for adding a mouseUp3d event listener.

Parameters

listener:Function — The listener function.

addOverlay()method 
public function addOverlay(value:IOverlay):void

Adds an overlay effect on top of the view container.

Parameters

value:IOverlay

addSourceURL()method 
public function addSourceURL(url:String):void

Defines a source url string that can be accessed though a View Source option in the right-click menu. Requires the stats panel to be enabled.

Parameters

url:String — The url to the source files.

clear()method 
public function clear():void

Clears previously rendered view from all render sessions.

See also

fireMouseEvent()method 
public function fireMouseEvent(type:String, x:Number, y:Number, ctrlKey:Boolean = false, shiftKey:Boolean = false):void

Collects all information from the given type of 3d mouse event into a MouseEvent3D object that can be accessed from the getMouseEvent() method.

Parameters

type:String — The type of 3d mouse event being triggered - can be MOUSE_UP, MOUSE_DOWN, MOUSE_OVER, MOUSE_OUT, and MOUSE_MOVE.
 
x:Number — The x coordinate being used for the 3d mouse event.
 
y:Number — The y coordinate being used for the 3d mouse event.
 
ctrlKey:Boolean (default = false) — [optional] The ctrl key value being used for the 3d mouse event.
 
shiftKey:Boolean (default = false) — [optional] The shift key value being used for the 3d mouse event.

See also

fireMouseMoveEvent()method 
public function fireMouseMoveEvent(force:Boolean = false):void

Manually fires a mouseMove3D event.

Parameters

force:Boolean (default = false)

getBitmapData()method 
public function getBitmapData():BitmapData

Returns the bitmapData of the rendered scene. session is required to be an instance of BitmapRenderSession, otherwise an error is thrown.

Returns
BitmapData — The rendered view image.

Throws
Error incorrect — session object - require BitmapRenderSession.

See also

session
away3d.core.render.BitmapRenderSession
getContainer()method 
public function getContainer():DisplayObject

Returns the DisplayObject container of the rendered scene.

Returns
DisplayObject — The DisplayObject containing the output from the render session of the view.

See also

session
away3d.core.render.BitmapRenderSession
away3d.core.render.SpriteRenderSession
removeOnMouseDown()method 
public function removeOnMouseDown(listener:Function):void

Default method for removing a mouseDown3d event listener.

Parameters

listener:Function — The listener function.

removeOnMouseMove()method 
public function removeOnMouseMove(listener:Function):void

Default method for removing a mouseMove3D event listener.

Parameters

listener:Function — The listener function.

removeOnMouseOut()method 
public function removeOnMouseOut(listener:Function):void

Default method for removing a 3d mouseOut event listener.

Parameters

listener:Function — The listener function.

removeOnMouseOver()method 
public function removeOnMouseOver(listener:Function):void

Default method for removing a 3d mouseOver event listener.

Parameters

listener:Function — The listener function.

removeOnMouseUp()method 
public function removeOnMouseUp(listener:Function):void

Default method for removing a 3d mouseUp event listener.

Parameters

listener:Function — The listener function.

removeOverlay()method 
public function removeOverlay(value:IOverlay):void

Removes an overlay effect on top of the view container.

Parameters

value:IOverlay

render()method 
public function render():void

Renders a snapshot of the view to the render session's view container.

See also

updateScreenClipping()method 
public function updateScreenClipping():void

Event Detail
mouseDown Event
Event Object Type: away3d.events.MouseEvent3D
MouseEvent3D.type property = away3d.events.MouseEvent3D

Dispatched when a user presses the let hand mouse button while the cursor is over a 3d object

mouseMove Event  
Event Object Type: away3d.events.MouseEvent3D
MouseEvent3D.type property = away3d.events.MouseEvent3D

Dispatched when a user moves the cursor while it is over a 3d object

mouseOut Event  
Event Object Type: away3d.events.MouseEvent3D
MouseEvent3D.type property = away3d.events.MouseEvent3D

Dispatched when a user moves the cursor away from a 3d object

mouseOver Event  
Event Object Type: away3d.events.MouseEvent3D
MouseEvent3D.type property = away3d.events.MouseEvent3D

Dispatched when a user moves the cursor over a 3d object

mouseUp Event  
Event Object Type: away3d.events.MouseEvent3D
MouseEvent3D.type property = away3d.events.MouseEvent3D

Dispatched when a user releases the let hand mouse button while the cursor is over a 3d object