Camera

NodeCamera

Description

class Camera extends Node

Constructor

new Camera(name, position, scene)

Parameters

Name Type Description
name string
position Vector3
scene Scene

Members

inputs : CameraInputsManager<Camera>

static PERSPECTIVE_CAMERA : number

static ORTHOGRAPHIC_CAMERA : number

static FOVMODE_VERTICAL_FIXED : number

static FOVMODE_HORIZONTAL_FIXED : number

static RIG_MODE_NONE : number

static RIG_MODE_STEREOSCOPIC_ANAGLYPH : number

static RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : number

static RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED : number

static RIG_MODE_STEREOSCOPIC_OVERUNDER : number

static RIG_MODE_VR : number

static RIG_MODE_WEBVR : number

static ForceAttachControlToAlwaysPreventDefault : boolean

static UseAlternateWebVRRendering : boolean

position : Vector3

upVector : Vector3

orthoLeft : Nullable<number>

orthoRight : Nullable<number>

orthoBottom : Nullable<number>

orthoTop : Nullable<number>

fov : number

minZ : number

maxZ : number

inertia : number

mode : number

isIntermediate : boolean

viewport : Viewport

layerMask : number

fovMode : number

cameraRigMode : number

interaxialDistance : number

isStereoscopicSideBySide : boolean

customRenderTargets : RenderTargetTexture[]

onViewMatrixChangedObservable : Observable<Camera>

onProjectionMatrixChangedObservable : Observable<Camera>

onAfterCheckInputsObservable : Observable<Camera>

onRestoreStateObservable : Observable<Camera>

globalPosition : Vector3

rigCameras : Camera[]

rigPostProcess : Nullable<PostProcess>

leftCamera : Nullable<FreeCamera>

rightCamera : Nullable<FreeCamera>

Methods

storeState() Camera

Store current camera state (fov, position, etc..)

restoreState() boolean

Restored camera state. You must call storeState() first

getClassName() string

toString(fullDetails) string

Parameters

Name Type Description
optional fullDetails boolean

getActiveMeshes() SmartArray<AbstractMesh>

isActiveMesh(mesh) boolean

Parameters

Name Type Description
mesh Mesh

attachControl(element, noPreventDefault) void

Parameters

Name Type Description
element HTMLElement
optional noPreventDefault boolean

detachControl(element) void

Parameters

Name Type Description
element HTMLElement

update() void

attachPostProcess(postProcess, insertAt) number

Parameters

Name Type Description
postProcess PostProcess
optional insertAt Nullable<number>

detachPostProcess(postProcess) void

Parameters

Name Type Description
postProcess PostProcess

getWorldMatrix() Matrix

getViewMatrix(force) Matrix

Parameters

Name Type Description
optional force boolean

freezeProjectionMatrix(projection) void

Parameters

Name Type Description
optional projection Matrix

unfreezeProjectionMatrix() void

getProjectionMatrix(force) Matrix

Parameters

Name Type Description
optional force boolean

getTranformationMatrix() Matrix

isInFrustum(target) boolean

Parameters

Name Type Description
target ICullable

isCompletelyInFrustum(target) boolean

Parameters

Name Type Description
target ICullable

getForwardRay(length, transform, origin) Ray

Parameters

Name Type Description
optional length number
optional transform Matrix
optional origin Vector3

dispose() void

getLeftTarget() Nullable<Vector3>

getRightTarget() Nullable<Vector3>

setCameraRigMode(mode, rigParams) void

Parameters

Name Type Description
mode number
rigParams any

setCameraRigParameter(name, value) void

Parameters

Name Type Description
name string
value any

createRigCamera(name, cameraIndex) Nullable<Camera>

needs to be overridden by children so sub has required properties to be copied

Parameters

Name Type Description
name string
cameraIndex number

serialize() any

clone(name) Camera

Parameters

Name Type Description
name string

getDirection(localAxis) Vector3

Parameters

Name Type Description
localAxis Vector3

getDirectionToRef(localAxis, result) void

Parameters

Name Type Description
localAxis Vector3
result Vector3

static GetConstructorFromName(type, name, scene, interaxial_distance, isStereoscopicSideBySide) () => Camera

Parameters

Name Type Description
type string
name string
scene Scene
optional interaxial_distance number

computeWorldMatrix() Matrix

static Parse(parsedCamera, scene) Camera

Parameters

Name Type Description
parsedCamera any
scene Scene