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

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
Public Methods
 MethodDefined By
  
Creates a new LensBase object.
LensBase
  
project(point3d:Vector3D):Vector3D
LensBase
  
unproject(mX:Number, mY:Number, mZ:Number):Vector3D
Calculates the position of the given normalized coordinates relative to the camera.
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

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
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

Parameters

point3d:Vector3D

Returns
Vector3D
unproject()method 
public function unproject(mX:Number, mY:Number, mZ:Number):Vector3D

Calculates the position of the given normalized coordinates relative to the camera.

Parameters

mX:Number — The x coordinate relative to the View3D. -1 corresponds to the utter left side of the viewport, 1 to the right.
 
mY:Number — The y coordinate relative to the View3D. -1 corresponds to the top side of the viewport, 1 to the bottom.
 
mZ:Number — The distance from the projection plane.

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

Updates the matrix