Packageorg.papervision3d.view
Classpublic class Viewport3D
InheritanceViewport3D Inheritance flash.display.Sprite
ImplementsIViewport3D
SubclassesBitmapViewport3D



Public Properties
 PropertyDefined by
  autoClipping : Boolean
Whether clipping is enabled (not rendering bitmap data outside the rectangle of the viewport by making use of the Sprite.scrollRect)
Viewport3D
  autoCulling : Boolean
Whether culling is enabled (not rendering triangles hidden behind other triangles)
Viewport3D
  autoScaleToStage : Boolean
The auto scale to stage boolean flag
Viewport3D
  containerSprite : ViewportLayer
[read-only] The Sprite holding the Viewport3D
Viewport3D
  cullingRectangle : Rectangle
cullingRectangle stores the width, height, x, y of the culling rectangle.
Viewport3D
  interactive : Boolean
The interactive boolean flag
Viewport3D
  interactiveSceneManager : InteractiveSceneManager
interactiveSceneManager manages the interaction between the user's mouse and the Papervision3D scene.
Viewport3D
  lastRenderList : Array
lastRenderList stores RenderableListItems (Triangles, Lines, Pixels, Particles, Fog) of everything that was rendered in the last pass.
Viewport3D
  lineCuller : ILineCuller
lineCuller uses the culling Rectangle to determine which particles will not be rendered in BasicRenderEngine
Viewport3D
  particleCuller : IParticleCuller
particleCuller uses the cullingRectangle to determine which particles will not be rendered in BasicRenderEngine
Viewport3D
  sizeRectangle : Rectangle
sizeRectangle stores the width and the height of the Viewport3D sprite
Viewport3D
  triangleCuller : ITriangleCuller
triangleCuller uses the cullingRectangle to determine which triangles will not be rendered in BasicRenderEngine
Viewport3D
  viewportHeight : Number
Height of the Viewport
Viewport3D
  viewportObjectFilter : ViewportObjectFilter
The ViewportObjectFilter
Viewport3D
  viewportWidth : Number
Width of the Viewport3D
Viewport3D
Public Methods
 MethodDefined by
  
Viewport3D(viewportWidth:Number = 640, viewportHeight:Number = 480, autoScaleToStage:Boolean = false, interactive:Boolean = false, autoClipping:Boolean = true, autoCulling:Boolean = true)
Viewport3D
  
accessLayerFor(rc:RenderableListItem, setInstance:Boolean = false):ViewportLayer
Gets the layer of the RenderListItem.
Viewport3D
  
destroy():void
Removes all references and sets the viewport's InteractiveSceneManager to null for a future garbage collection sweep
Viewport3D
  
getChildLayer(do3d:DisplayObject3D, createNew:Boolean = true, recurse:Boolean = true):ViewportLayer
Creates or receives a ViewportLayer of the given DisplayObject3D
Viewport3D
  
Checks the Mouse x and y against the RenderHitData
Viewport3D
  
Checks a Point against the RenderHitData of the viewport
Viewport3D
  
Viewport3D
  
updateAfterRender(renderSessionData:RenderSessionData):void
Updates a ViewportLayer after the 3d data is rendered into the 2d scene
Viewport3D
  
updateBeforeRender(renderSessionData:RenderSessionData):void
Updates a ViewportLayer prior to the 3d data being rendered into the 2d scene
Viewport3D
Protected Methods
 MethodDefined by
  
onAddedToStage(event:Event):void
Triggered when added to the stage to start listening to stage resizing
Viewport3D
  
onRemovedFromStage(event:Event):void
Triggered when removed from the stage to remove the stage resizing listener
Viewport3D
  
onStageResize(event:Event = null):void
Resizes the viewport when the stage is resized (if autoScaleToStage == true)
Viewport3D
  
Viewport3D
Property detail
autoClippingproperty
autoClipping:Boolean  [read-write]

Whether clipping is enabled (not rendering bitmap data outside the rectangle of the viewport by making use of the Sprite.scrollRect)

Implementation
    public function get autoClipping():Boolean
    public function set autoClipping(value:Boolean):void

See also

autoCullingproperty 
autoCulling:Boolean  [read-write]

Whether culling is enabled (not rendering triangles hidden behind other triangles)

Implementation
    public function get autoCulling():Boolean
    public function set autoCulling(value:Boolean):void

See also

autoScaleToStageproperty 
autoScaleToStage:Boolean  [read-write]

The auto scale to stage boolean flag

Implementation
    public function get autoScaleToStage():Boolean
    public function set autoScaleToStage(value:Boolean):void
containerSpriteproperty 
containerSprite:ViewportLayer  [read-only]

The Sprite holding the Viewport3D

Implementation
    public function get containerSprite():ViewportLayer
cullingRectangleproperty 
public var cullingRectangle:Rectangle

cullingRectangle stores the width, height, x, y of the culling rectangle. It's used to determine the bounds in which the triangles are drawn.

See also

interactiveproperty 
interactive:Boolean  [read-write]

The interactive boolean flag

Implementation
    public function get interactive():Boolean
    public function set interactive(value:Boolean):void
interactiveSceneManagerproperty 
public var interactiveSceneManager:InteractiveSceneManager

interactiveSceneManager manages the interaction between the user's mouse and the Papervision3D scene. This is done by checking the mouse against renderHitData. renderHitData is generated from hitTestPoint2D and passed into the interactiveSceneManager to check agains the various mouse actions.

See also

lastRenderListproperty 
public var lastRenderList:Array

lastRenderList stores RenderableListItems (Triangles, Lines, Pixels, Particles, Fog) of everything that was rendered in the last pass. This list is used to determine hitTests in hitTestPoint2D.

See also

lineCullerproperty 
public var lineCuller:ILineCuller

lineCuller uses the culling Rectangle to determine which particles will not be rendered in BasicRenderEngine

See also

particleCullerproperty 
public var particleCuller:IParticleCuller

particleCuller uses the cullingRectangle to determine which particles will not be rendered in BasicRenderEngine

See also

sizeRectangleproperty 
public var sizeRectangle:Rectangle

sizeRectangle stores the width and the height of the Viewport3D sprite

See also

triangleCullerproperty 
public var triangleCuller:ITriangleCuller

triangleCuller uses the cullingRectangle to determine which triangles will not be rendered in BasicRenderEngine

See also

viewportHeightproperty 
viewportHeight:Number  [read-write]

Height of the Viewport

Implementation
    public function get viewportHeight():Number
    public function set viewportHeight(value:Number):void
viewportObjectFilterproperty 
viewportObjectFilter:ViewportObjectFilter  [read-write]

The ViewportObjectFilter

Implementation
    public function get viewportObjectFilter():ViewportObjectFilter
    public function set viewportObjectFilter(value:ViewportObjectFilter):void
viewportWidthproperty 
viewportWidth:Number  [read-write]

Width of the Viewport3D

Implementation
    public function get viewportWidth():Number
    public function set viewportWidth(value:Number):void
Constructor detail
Viewport3D()constructor
public function Viewport3D(viewportWidth:Number = 640, viewportHeight:Number = 480, autoScaleToStage:Boolean = false, interactive:Boolean = false, autoClipping:Boolean = true, autoCulling:Boolean = true)

Parameters
viewportWidth:Number (default = 640) — Width of the viewport
 
viewportHeight:Number (default = 480) — Height of the viewport
 
autoScaleToStage:Boolean (default = false) — Determines whether the viewport should resize when the stage resizes
 
interactive:Boolean (default = false) — Determines whether the viewport should listen for Mouse events by creating an InteractiveSceneManager
 
autoClipping:Boolean (default = true) — Determines whether DisplayObject3Ds outside the rectangle of the viewport should be rendered
 
autoCulling:Boolean (default = true) — Detemines whether only the objects in front of the camera should be rendered. In other words, if a triangle is hidden by another triangle from the camera, it will not be rendered.
Method detail
accessLayerFor()method
public function accessLayerFor(rc:RenderableListItem, setInstance:Boolean = false):ViewportLayer

Gets the layer of the RenderListItem. Most-likely internal use.

Parameters
rc:RenderableListItem — A RenderableListItem to look for
 
setInstance:Boolean (default = false) — sets the container to the layer

Returns
ViewportLayer — The found ViewportLayer
destroy()method 
public function destroy():void

Removes all references and sets the viewport's InteractiveSceneManager to null for a future garbage collection sweep

getChildLayer()method 
public function getChildLayer(do3d:DisplayObject3D, createNew:Boolean = true, recurse:Boolean = true):ViewportLayer

Creates or receives a ViewportLayer of the given DisplayObject3D

Parameters
do3d:DisplayObject3D — A DisplayObject3D used to either find the layer or create a new one
 
createNew:Boolean (default = true) — Forces the creation of a new layer
 
recurse:Boolean (default = true) — Adds the DisplayObject3D as well as all of its children to a new layer

Returns
ViewportLayerViewportLayer of the given DisplayObject3D
hitTestMouse()method 
public function hitTestMouse():RenderHitData

Checks the Mouse x and y against the RenderHitData

Returns
RenderHitData — RenderHitData of the current mouse location
hitTestPoint2D()method 
public function hitTestPoint2D(point:Point):RenderHitData

Checks a Point against the RenderHitData of the viewport

Parameters
point:Point — a 2d Point you want to analyze into 3d space

Returns
RenderHitDataRenderHitData of the given Point
hitTestPointObject()method 
public function hitTestPointObject(point:Point, object:DisplayObject3D):RenderHitDataParameters
point:Point
 
object:DisplayObject3D

Returns
RenderHitData
onAddedToStage()method 
protected function onAddedToStage(event:Event):void

Triggered when added to the stage to start listening to stage resizing

Parameters
event:Event
onRemovedFromStage()method 
protected function onRemovedFromStage(event:Event):void

Triggered when removed from the stage to remove the stage resizing listener

Parameters
event:Event
onStageResize()method 
protected function onStageResize(event:Event = null):void

Resizes the viewport when the stage is resized (if autoScaleToStage == true)

Parameters
event:Event (default = null)
setStageScaleMode()method 
protected function setStageScaleMode():void
updateAfterRender()method 
public function updateAfterRender(renderSessionData:RenderSessionData):void

Updates a ViewportLayer after the 3d data is rendered into the 2d scene

Parameters
renderSessionData:RenderSessionData — All the information regarding the current renderSession packed into one class
updateBeforeRender()method 
public function updateBeforeRender(renderSessionData:RenderSessionData):void

Updates a ViewportLayer prior to the 3d data being rendered into the 2d scene

Parameters
renderSessionData:RenderSessionData — All the information regarding the current renderSession packed into one class