Constructor

@:value({ contextIndex : -1, profile : "baseline", forceSoftware : false, renderer : null, camera : null, scene : null })new(?scene:Scene3D, ?camera:Camera3D, ?renderer:RendererBase, forceSoftware:Bool = false, profile:String = "baseline", contextIndex:Int = -1)

Variables

antiAlias:UInt

The amount of anti-aliasing to be used.

backgroundColor:UInt

The background color of the screen. This value is only used when clearAll is set to true.

camera:Camera3D

The camera that's used to render the scene for this viewport

read onlydeltaTime:UInt

The amount of milliseconds the last render call took

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.

renderer:RendererBase

The renderer used to draw the scene.

scene:Scene3D

The scene that's used to render for this viewport

shareContext:Bool

Defers control of Context3D clear() and present() calls to Stage3DProxy, enabling multiple Stage3D frameworks to share the same Context3D object.

Methods

dispose():Void

Disposes all memory occupied by the view. This will also dispose the renderer.

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.

render():Void

Renders the view.

@:value({ v : null })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.