Packageaway3d.cameras.lenses
Classpublic class LensBase
InheritanceLensBase Inheritance flash.events.EventDispatcher
Subclasses FreeMatrixLens, ObliqueNearPlaneLens, OrthographicLens, OrthographicOffCenterLens, PerspectiveLens, PerspectiveOffCenterLens

An abstract base class for all lens classes. Lens objects provides a projection matrix that transforms 3D geometry to normalized homogeneous coordinates.



Public Properties
 PropertyDefined By
  far : Number
The distance to the far plane of the frustum.
LensBase
  frustumCorners : Vector.<Number>
Retrieves the corner points of the lens frustum.
LensBase
  matrix : Matrix3D
The projection matrix that transforms 3D geometry to normalized homogeneous coordinates.
LensBase
  near : Number
The distance to the near plane of the frustum.
LensBase
  unprojectionMatrix : Matrix3D
[read-only]
LensBase
Protected Properties
 PropertyDefined By
  _aspectRatio : Number = 1
LensBase
  _far : Number = 3000
LensBase
  _frustumCorners : Vector.<Number>
LensBase
  _matrix : Matrix3D
LensBase
  _matrixInvalid : Boolean = true
LensBase
  _near : Number = 20
LensBase
  _scissorRect : Rectangle
LensBase
  _viewPort : Rectangle
LensBase
Public Methods
 MethodDefined By
  
Creates a new LensBase object.
LensBase
  
Creates an exact duplicate of the lens
LensBase
  
project(point3d:Vector3D):Vector3D
Calculates the normalised position in screen space of the given scene position relative to the camera.
LensBase
  
unproject(nX:Number, nY:Number, sZ:Number):Vector3D
Calculates the scene position relative to the camera of the given normalized coordinates in screen space.
LensBase
Protected Methods
 MethodDefined By
  
Invalidates the projection matrix, which will cause it to be updated on the next request.
LensBase
  
Updates the matrix
LensBase
Property Detail
_aspectRatioproperty
protected var _aspectRatio:Number = 1

_farproperty 
protected var _far:Number = 3000

_frustumCornersproperty 
protected var _frustumCorners:Vector.<Number>

_matrixproperty 
protected var _matrix:Matrix3D

_matrixInvalidproperty 
protected var _matrixInvalid:Boolean = true

_nearproperty 
protected var _near:Number = 20

_scissorRectproperty 
protected var _scissorRect:Rectangle

_viewPortproperty 
protected var _viewPort:Rectangle

aspectRatioproperty 
aspectRatio:Number


Implementation
    arcane function get aspectRatio():Number
    arcane function set aspectRatio(value:Number):void
farproperty 
far:Number

The distance to the far plane of the frustum. Anything beyond the far plane will not be rendered.


Implementation
    public function get far():Number
    public function set far(value:Number):void
frustumCornersproperty 
frustumCorners:Vector.<Number>

Retrieves the corner points of the lens frustum.


Implementation
    public function get frustumCorners():Vector.<Number>
    public function set frustumCorners(value:Vector.<Number>):void
matrixproperty 
matrix:Matrix3D

The projection matrix that transforms 3D geometry to normalized homogeneous coordinates.


Implementation
    public function get matrix():Matrix3D
    public function set matrix(value:Matrix3D):void
nearproperty 
near:Number

The distance to the near plane of the frustum. Anything behind near plane will not be rendered.


Implementation
    public function get near():Number
    public function set near(value:Number):void
unprojectionMatrixproperty 
unprojectionMatrix:Matrix3D  [read-only]


Implementation
    public function get unprojectionMatrix():Matrix3D
Constructor Detail
LensBase()Constructor
public function LensBase()

Creates a new LensBase object.

Method Detail
clone()method
public function clone():LensBase

Creates an exact duplicate of the lens

Returns
LensBase
invalidateMatrix()method 
protected function invalidateMatrix():void

Invalidates the projection matrix, which will cause it to be updated on the next request.

project()method 
public function project(point3d:Vector3D):Vector3D

Calculates the normalised position in screen space of the given scene position relative to the camera.

Parameters

point3d:Vector3D — the position vector of the scene coordinates to be projected.

Returns
Vector3D — The normalised screen position of the given scene coordinates relative to the camera.
unproject()method 
public function unproject(nX:Number, nY:Number, sZ:Number):Vector3D

Calculates the scene position relative to the camera of the given normalized coordinates in screen space.

Parameters

nX:Number — The normalised x coordinate in screen space, -1 corresponds to the left edge of the viewport, 1 to the right.
 
nY:Number — The normalised y coordinate in screen space, -1 corresponds to the top edge of the viewport, 1 to the bottom.
 
sZ:Number — The z coordinate in screen space, representing the distance into the screen.

Returns
Vector3D — The scene position relative to the camera of the given screen coordinates.
updateMatrix()method 
protected function updateMatrix():void

Updates the matrix

updateScissorRect()method 
arcane function updateScissorRect(x:Number, y:Number, width:Number, height:Number):void

Parameters

x:Number
 
y:Number
 
width:Number
 
height:Number

updateViewport()method 
arcane function updateViewport(x:Number, y:Number, width:Number, height:Number):void

Parameters

x:Number
 
y:Number
 
width:Number
 
height:Number