| Package | alternativa.engine3d.display |
| Class | public class View |
| Inheritance | View flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
| camera : Camera3D
Current camera.
| View | ||
| height : Number Viewport height in pixels.
| View | ||
| interactive : Boolean View's mouse interactivity.
| View | ||
| width : Number Viewport width in pixels.
| View | ||
| Method | Defined by | ||
|---|---|---|---|
|
Create camera viewport instance.
| View | ||
|
The method returns coordinates of a point in coordinate system of a camera which is connected to the view.
| View | ||
|
getObjectsUnderPoint(viewPoint:Point):Array
The method returns an array of objects under the specified point of a view.
| View | ||
|
getObjectUnderPoint(viewPoint:Point):Object
Returns an object under the specified point of a view.
| View | ||
|
Projects a point from global coordinate system to a view.
| View | ||
|
projectViewPointToPlane(viewPoint:Point, planeNormal:Point3D, planeOffset:Number, result:Point3D = null):Point3D
Projects a 2d point of the viewport on a 3d plane.
| View | ||
| camera | property |
camera:Camera3D [read-write]Current camera.
Implementation public function get camera():Camera3D
public function set camera(value:Camera3D):void
| height | property |
height:Number [read-write]Viewport height in pixels.
Implementation public function get height():Number
public function set height(value:Number):void
| interactive | property |
interactive:Boolean [read-write]View's mouse interactivity. When the property is set to true, rendered objects can recieve mouse events.
The default value is false.
public function get interactive():Boolean
public function set interactive(value:Boolean):void
| width | property |
width:Number [read-write]Viewport width in pixels.
Implementation public function get width():Number
public function set width(value:Number):void
| View | () | constructor |
public function View(camera:Camera3D = null, width:Number = 0, height:Number = 0)Create camera viewport instance.
Parameterscamera:Camera3D (default = null) — camera that has to provide image |
|
width:Number (default = 0) — viewport width |
|
height:Number (default = 0) — viewport height |
| get3DCoords | () | method |
public function get3DCoords(viewPoint:Point, depth:Number, result:Point3D = null):Point3DThe method returns coordinates of a point in coordinate system of a camera which is connected to the view. In perspective projection mode a point on the line, which goes through the camera's origin and the specified point on the camera's focal plane, is returned. In orthographic mode the method returns a point on the line, which is perpendicular to the camera's focal plane and goes through the specified point on the focal plane.
ParametersviewPoint:Point — coordinates of a point on the view |
|
depth:Number — depth of the point in a camera — Z-coordinate in camera's coordinate system |
|
result:Point3D (default = null) — the result will be written in this parameter. If value of null is specified, then a new instance of Point3D will be created. |
Point3D — coordinates of a point in coordinate system of a camera, connected to the view, or null if there's no camera |
| getObjectsUnderPoint | () | method |
public override function getObjectsUnderPoint(viewPoint:Point):ArrayThe method returns an array of objects under the specified point of a view.
ParametersviewPoint:Point — Coordinates of a point on a view. The upper-left corner of a view has coordinates (0, 0). |
Array — an array of objects under the specified point of a view. Objects can be either a face (Face) or a sprite (Sprite3D). |
| getObjectUnderPoint | () | method |
public function getObjectUnderPoint(viewPoint:Point):ObjectReturns an object under the specified point of a view.
ParametersviewPoint:Point — Coordinates of a point on a view. The upper-left corner of a view has coordinates (0, 0). |
Object — the nearest object under specified point on a view. The object can be either a face (Face) or a sprite (Sprite3D). If there are no objects under the point or the view isn't on stage, the method returns null. |
| projectPoint | () | method |
public function projectPoint(point:Point3D):Point3DProjects a point from global coordinate system to a view.
Parameterspoint:Point3D — coordinates of a point in global coordinate system |
Point3D — an instance of Point3D class, which contains coordinates of projected point on a view and z-coordinate of the point in camera's coordinate system. If the view has no camera assigned or the assigned camera is not in a scene, the method returns null. |
| projectViewPointToPlane | () | method |
public function projectViewPointToPlane(viewPoint:Point, planeNormal:Point3D, planeOffset:Number, result:Point3D = null):Point3DProjects a 2d point of the viewport on a 3d plane.
ParametersviewPoint:Point — coordinates of a point on the view |
|
planeNormal:Point3D — a normal of the plane in global coordinate system |
|
planeOffset:Number — offset of the plane in global coordinate system |
|
result:Point3D (default = null) — the result will be stored in this parameter. If value of null is specified, the method will create a new instance of Point3D and return it as the result. |
Point3D — an instance of Point3D given as the result parameter, or a new instance if the parameter is null. If the line of sight is parallel to the specified plane, the result contains NaNs. If the view doesn't have a camera, or the camera isn't on a scene, the method returns null. |