class View3D
package away3d.containers
extends Sprite
extended by StereoView3D
Available on all platforms
Constructor
new(?scene:Scene3D, ?camera:Camera3D, ?renderer:RendererBase, forceSoftware:Bool = false, profile:String = "baseline", contextIndex:Int = -1)
Variables
backgroundColor:UInt
The background color of the screen. This value is only used when clearAll is set to true.
forceMouseMove:Bool
Forces mouse-move related events even when the mouse hasn't moved. This allows mouseOver and mouseOut events etc to be triggered due to changes in the scene graph. Defaults to false.
layeredView:Bool
Used in a sharedContext. When true, clears the depth buffer prior to rendering this particular view to avoid depth sorting with lower layers. When false, the depth buffer is not cleared from the previous (lower) view's render so objects in this view may be occluded by the lower layer. Defaults to false.
read onlyrenderedFacesCount:UInt
The amount of faces that were pushed through the render pipeline on the last frame render.
shareContext:Bool
Defers control of Context3D clear() and present() calls to Stage3DProxy, enabling multiple Stage3D frameworks to share the same Context3D object.
Methods
getRay(sX:Float, sY:Float, sZ:Float):Vector3D
Calculates the ray in scene space from the camera to the given screen coordinates.
eg. getRay(view.mouseX, view.mouseY, 500) returns the ray from the camera to a position under the mouse, 500 units into the screen.
Parameters:
sX | The absolute x coordinate in 2D relative to View3D, representing the screenX coordinate. |
|---|---|
sY | The absolute y coordinate in 2D relative to View3D, representing the screenY coordinate. |
sZ | The distance into the screen, representing the screenZ coordinate. |
Returns:
The ray from the camera to the scene space position of the given screen coordinates.
project(point3d:Vector3D):Vector3D
Calculates the projected position in screen space of the given scene position.
Parameters:
point3d | the position vector of the point to be projected. |
|---|
Returns:
The absolute screen position of the given scene coordinates.
unproject(sX:Float, sY:Float, sZ:Float, ?v:Vector3D):Vector3D
Calculates the scene position of the given screen coordinates.
eg. unproject(view.mouseX, view.mouseY, 500) returns the scene position of the mouse 500 units into the screen.
Parameters:
sX | The absolute x coordinate in 2D relative to View3D, representing the screenX coordinate. |
|---|---|
sY | The absolute y coordinate in 2D relative to View3D, representing the screenY coordinate. |
sZ | The distance into the screen, representing the screenZ coordinate. |
v | the destination Vector3D object |
Returns:
The scene position of the given screen coordinates.