| Package | alternativa.engine3d.core |
| Class | public class Camera3D |
| Inheritance | Camera3D Object3D |
A newly created camera is directed along parent's Z axis.
To render an image seen by a camera, the camera must be assigned to a view — an instance of the alternativa.engine3d.display.View class.
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | children : Set
A set of child objects.
| Object3D | |
![]() | coords : Point3D
Object coordinates.
| Object3D | |
| currentSector : Sector
[read-only] A sector containing the camera.
| Camera3D | ||
| farClipping : Boolean Whether or not far clipping is enabled.
| Camera3D | ||
| farClippingDistance : Number Distance to the far clipping plane in the camera's coordinate system.
| Camera3D | ||
| focalLength : Number [read-only] Camera's focal distance.
| Camera3D | ||
| fov : Number FOV in radians for perspective projection.
| Camera3D | ||
![]() | mobility : int Mobility level.
| Object3D | |
![]() | mouseEnabled : Boolean = true Specifies whether this object receives mouse messages.
| Object3D | |
![]() | name : String Object name.
| Object3D | |
| nearClipping : Boolean Whether or not near clipping is enabled.
| Camera3D | ||
| nearClippingDistance : Number Distance to the near clipping plane in a camera's coordinate system.
| Camera3D | ||
| orthographic : Boolean Determines whether orthographic (true) or perspective (false) projection is used.
| Camera3D | ||
![]() | parent : Object3D
Parent object.
| Object3D | |
![]() | rotationX : Number X-axis rotation angle in radians.
| Object3D | |
![]() | rotationY : Number Y-axis rotation angle in radians.
| Object3D | |
![]() | rotationZ : Number Z-axis rotation angle in radians.
| Object3D | |
![]() | scaleX : Number X-axis scale coefficient.
| Object3D | |
![]() | scaleY : Number Y-axis scale coefficient.
| Object3D | |
![]() | scaleZ : Number Z-axis scale coefficient.
| Object3D | |
![]() | scene : Scene3D
Scene containing given object.
| Object3D | |
![]() | transformation : Matrix3D
Full (global) transformation matrix of an object.
| Object3D | |
| view : View
A view to which an image from the camera is rendered.
| Camera3D | ||
| viewClipping : Boolean Whether or not clipping by view pyramid is enabled.
| Camera3D | ||
![]() | x : Number X coordinate.
| Object3D | |
![]() | y : Number Y coordinate.
| Object3D | |
![]() | z : Number Z coordinate.
| Object3D | |
| zoom : Number Image zoom coefficient in orthographic mode.
| Camera3D | ||
| Method | Defined by | ||
|---|---|---|---|
|
Camera3D(name:String = null)
Creates a new camera instance.
| Camera3D | ||
![]() |
Adds a child object.
| Object3D | |
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| Object3D | |
![]() |
Clones object.
| Object3D | |
![]() |
dispatchEvent(event:Event):Boolean
Dispatches an event.
| Object3D | |
![]() |
forEach(func:Function):void
Calls the specified function for the object an all its children, passing the current object as an argument.
| Object3D | |
![]() |
getChildByName(name:String, deep:Boolean = false):Object3D
Gets a child object with the given name.
| Object3D | |
![]() |
Transforms a point form global coordinate system to an object's coordinate system
| Object3D | |
![]() |
hasEventListener(type:String):Boolean
Checks if there are registered event listeners for events of the specified type.
| Object3D | |
![]() |
Transforms a point from local coordinate system of an object to global coordinate system.
| Object3D | |
![]() |
Delete child object.
| Object3D | |
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes an event listener.
| Object3D | |
![]() |
toString():String
Get string representation of object.
| Object3D | |
![]() |
willTrigger(type:String):Boolean
| Object3D | |
| Method | Defined by | ||
|---|---|---|---|
|
addToScene(scene:Scene3D):void
Method is being called when adding object to scene.
| Camera3D | ||
|
clonePropertiesFrom(source:Object3D):void
Copies the source object's properties.
| Camera3D | ||
|
Creates` empty object without inner structure.
| Camera3D | ||
|
defaultName():String
Default object name.
| Camera3D | ||
|
removeFromScene(scene:Scene3D):void
Method is being called whed deleting object from a scene.
| Camera3D | ||
| currentSector | property |
currentSector:Sector [read-only]A sector containing the camera.
For proper method's behavior the scene must be rebuilt by calling the Scene.calculate() method after the following properties have changed: Scene.splitters, Scene.sectors, Scene.planeOffsetThreshold.
public function get currentSector():Sector
See also
| farClipping | property |
farClipping:Boolean [read-write]Whether or not far clipping is enabled. When the property is set to true, all geometry with Z-coordinate in the camera coordinates system greater than specified value is not rendered. If the property is set to false, geometry is not clipped.
The default value is false.
public function get farClipping():Boolean
public function set farClipping(value:Boolean):void
See also
| farClippingDistance | property |
farClippingDistance:Number [read-write]Distance to the far clipping plane in the camera's coordinate system. If a negative value is specified, the property is set to zero.
The default value is 1.
public function get farClippingDistance():Number
public function set farClippingDistance(value:Number):void
See also
| focalLength | property |
focalLength:Number [read-only]Camera's focal distance. The value is calculated by formula f = d/tan(fov/2), where d is a half of the view diagonal. If the camera is not connected to a view, the value is NaN.
public function get focalLength():Number
See also
| fov | property |
fov:Number [read-write]FOV in radians for perspective projection. When FOV is changed, the focal length of a camera is calculated using the formula f = d/tan(fov/2), where d is half diagonal of the view. FOV is limited by the range [0, PI] radians.
public function get fov():Number
public function set fov(value:Number):void
See also
| nearClipping | property |
nearClipping:Boolean [read-write]Whether or not near clipping is enabled. When the property is set to true, all geometry with Z-coordinate in a camera coordinates system less than specified value is not rendered. If the property is set to false, geometry is not clipped.
The default value is false.
public function get nearClipping():Boolean
public function set nearClipping(value:Boolean):void
See also
| nearClippingDistance | property |
nearClippingDistance:Number [read-write]Distance to the near clipping plane in a camera's coordinate system. If a negative value is specified, the property is set to zero.
The default value is 1.
public function get nearClippingDistance():Number
public function set nearClippingDistance(value:Number):void
See also
| orthographic | property |
orthographic:Boolean [read-write]Determines whether orthographic (true) or perspective (false) projection is used.
The default value is false.
public function get orthographic():Boolean
public function set orthographic(value:Boolean):void
| view | property |
view:View [read-write]A view to which an image from the camera is rendered.
Implementation public function get view():View
public function set view(value:View):void
| viewClipping | property |
viewClipping:Boolean [read-write]Whether or not clipping by view pyramid is enabled. When the property is set to true, geometry is clipped by view pyramid. If value of false is specified, no clipping occurs. This can improve performance when the whole scene is in the view pyramid.
If there are objects behind the camera, it's not recommended to turn off view clipping and near clipping simultaneously, since it will cause rendering artifacts and, in case of using texture materials, the procedure of adaptive triangulation may fall into an endless cycle.
The default value is true.
public function get viewClipping():Boolean
public function set viewClipping(value:Boolean):void
See also
| zoom | property |
zoom:Number [read-write]Image zoom coefficient in orthographic mode.
Implementation public function get zoom():Number
public function set zoom(value:Number):void
| Camera3D | () | constructor |
public function Camera3D(name:String = null)Creates a new camera instance.
Parametersname:String (default = null) — camera name |
| addToScene | () | method |
protected override function addToScene(scene:Scene3D):voidMethod is being called when adding object to scene. Descendants may redefine method for making specific actions.
Parametersscene:Scene3D — scene, which object is being added to |
| clonePropertiesFrom | () | method |
protected override function clonePropertiesFrom(source:Object3D):voidCopies the source object's properties. This method is being used in clone() method and must be redefined in its descendants to get a right object. Every descendant must copy only the properties that were introduced in the descendant's class. Inherited properties are copied by calling super.clonePropertiesFrom(source).
Parameterssource:Object3D — object, which properties are being copied |
| createEmptyObject | () | method |
protected override function createEmptyObject():Object3DCreates` empty object without inner structure. For example, if geometrical primitive, when added, forms a bunch of vertices, faces and surfaces, this method doesn't create them. This method is being used in clone() and has to be redefined in descendants in order to get the right object.
ReturnsObject3D — a new empty object |
| defaultName | () | method |
protected override function defaultName():StringDefault object name.
ReturnsString — default object name |
| removeFromScene | () | method |
protected override function removeFromScene(scene:Scene3D):voidMethod is being called whed deleting object from a scene.Descendants may redefine method for making specific actions.
Parametersscene:Scene3D — scena, from which the object is being deleted from |