VRDeviceOrientationArcRotateCamera

Camera used to simulate VR rendering (based on ArcRotateCamera)

see

http://doc.babylonjs.com/babylon101/cameras#vr-device-orientation-cameras

Hierarchy

Index

Constructors

constructor

Find examples in Playground
  • Creates a new VRDeviceOrientationArcRotateCamera

    Parameters

    • name: string

      defines camera name

    • alpha: number

      defines the camera rotation along the logitudinal axis

    • beta: number

      defines the camera rotation along the latitudinal axis

    • radius: number

      defines the camera distance from its target

    • target: Vector3

      defines the camera target

    • scene: Scene

      defines the scene the camera belongs to

    • Optional compensateDistortion: boolean

      defines if the camera needs to compensate the lens distorsion

    • Optional vrCameraMetrics: VRCameraMetrics

      defines the vr metrics associated to the camera

    Returns VRDeviceOrientationArcRotateCamera

Properties

allowUpsideDown

Find examples in Playground
allowUpsideDown: boolean

Allows the camera to be completely reversed. If false the camera can not arrive upside down.

alpha

Find examples in Playground
alpha: number

Defines the rotation angle of the camera along the longitudinal axis.

beta

Find examples in Playground
beta: number

Defines the rotation angle of the camera along the latitudinal axis.

cameraDirection

Find examples in Playground
cameraDirection: Vector3

Define the current direction the camera is moving to

cameraRotation

Find examples in Playground
cameraRotation: Vector2

Define the current rotation the camera is rotating to

checkCollisions

Find examples in Playground
checkCollisions: boolean

Defines whether the camera should check collision with the objects oh the scene.

see

http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#how-can-i-do-this

collisionRadius

Find examples in Playground
collisionRadius: Vector3

Defines the collision radius of the camera. This simulates a sphere around the camera.

see

http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity#arcrotatecamera

inertialAlphaOffset

Find examples in Playground
inertialAlphaOffset: number

Current inertia value on the longitudinal axis. The bigger this number the longer it will take for the camera to stop.

inertialBetaOffset

Find examples in Playground
inertialBetaOffset: number

Current inertia value on the latitudinal axis. The bigger this number the longer it will take for the camera to stop.

inertialPanningX

Find examples in Playground
inertialPanningX: number

Defines the current inertia value used during panning of the camera along the X axis.

inertialPanningY

Find examples in Playground
inertialPanningY: number

Defines the current inertia value used during panning of the camera along the Y axis.

inertialRadiusOffset

Find examples in Playground
inertialRadiusOffset: number

Current inertia value on the radius axis. The bigger this number the longer it will take for the camera to stop.

inputs

Find examples in Playground

Defines the input associated to the camera.

inverseRotationSpeed

Find examples in Playground
inverseRotationSpeed: number

Speed multiplier for inverse camera panning

invertRotation

Find examples in Playground
invertRotation: boolean

Reverses mouselook direction to 'natural' panning as opposed to traditional direct panning

lockedTarget

Find examples in Playground
lockedTarget: any

Define the current target of the camera as an object or a position.

lowerAlphaLimit

Find examples in Playground
lowerAlphaLimit: Nullable<number>

Minimum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.

lowerBetaLimit

Find examples in Playground
lowerBetaLimit: number

Minimum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.

lowerRadiusLimit

Find examples in Playground
lowerRadiusLimit: Nullable<number>

Minimum allowed distance of the camera to the target (The camera can not get closer). This can help limiting how the Camera is able to move in the scene.

noRotationConstraint

Find examples in Playground
noRotationConstraint: boolean

Add constraint to the camera to prevent it to move freely in all directions and around all axis.

onCollide

Find examples in Playground
onCollide: function

Event raised when the camera is colliding with a mesh.

Type declaration

onMeshTargetChangedObservable

Find examples in Playground
onMeshTargetChangedObservable: Observable<Nullable<AbstractMesh>>

Observable triggered when the mesh target has been changed on the camera.

panningAxis

Find examples in Playground
panningAxis: Vector3

Defines the allowed panning axis.

panningDistanceLimit

Find examples in Playground
panningDistanceLimit: Nullable<number>

Defines the maximum distance the camera can pan. This could help keeping the cammera always in your scene.

panningInertia

Find examples in Playground
panningInertia: number

Defines the value of the inertia used during panning. 0 would mean stop inertia and one would mean no decelleration at all.

panningOriginTarget

Find examples in Playground
panningOriginTarget: Vector3

Defines the target of the camera before paning.

pinchToPanMaxDistance

Find examples in Playground
pinchToPanMaxDistance: number

Defines the distance used to consider the camera in pan mode vs pinch/zoom. Basically if your fingers moves away from more than this distance you will be considered in pinch mode.

radius

Find examples in Playground
radius: number

Defines the radius of the camera from it s target point.

rotation

Find examples in Playground
rotation: Vector3

Define the current rotation of the camera

rotationQuaternion

Find examples in Playground
rotationQuaternion: Quaternion

Define the current rotation of the camera as a quaternion to prevent Gimbal lock

speed

Find examples in Playground
speed: number

Define the current speed of the camera

targetScreenOffset

Find examples in Playground
targetScreenOffset: Vector2

Defines a screen offset for the camera position.

updateUpVectorFromRotation

Find examples in Playground
updateUpVectorFromRotation: boolean

When set, the up vector of the camera will be updated by the rotation of the camera

upperAlphaLimit

Find examples in Playground
upperAlphaLimit: Nullable<number>

Maximum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.

upperBetaLimit

Find examples in Playground
upperBetaLimit: number

Maximum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.

upperRadiusLimit

Find examples in Playground
upperRadiusLimit: Nullable<number>

Maximum allowed distance of the camera to the target (The camera can not get further). This can help limiting how the Camera is able to move in the scene.

useInputToRestoreState

Find examples in Playground
useInputToRestoreState: boolean

Define if double tap/click is used to restore the previously saved state of the camera.

zoomOnFactor

Find examples in Playground
zoomOnFactor: number

Defines how much the radius should be scaled while zomming on a particular mesh (through the zoomOn function)

Accessors

angularSensibilityX

Find examples in Playground
  • get angularSensibilityX(): number
  • set angularSensibilityX(value: number): any
  • Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.

    Returns number

  • Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.

    Parameters

    • value: number

    Returns any

angularSensibilityY

Find examples in Playground
  • get angularSensibilityY(): number
  • set angularSensibilityY(value: number): any
  • Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.

    Returns number

  • Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.

    Parameters

    • value: number

    Returns any

autoRotationBehavior

Find examples in Playground

bouncingBehavior

Find examples in Playground

framingBehavior

Find examples in Playground

keysDown

Find examples in Playground
  • get keysDown(): number[]
  • set keysDown(value: number[]): any
  • Gets or Set the list of keyboard keys used to control beta angle in a negative direction.

    Returns number[]

  • Gets or Set the list of keyboard keys used to control beta angle in a negative direction.

    Parameters

    • value: number[]

    Returns any

keysLeft

Find examples in Playground
  • get keysLeft(): number[]
  • set keysLeft(value: number[]): any
  • Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.

    Returns number[]

  • Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.

    Parameters

    • value: number[]

    Returns any

keysRight

Find examples in Playground
  • get keysRight(): number[]
  • set keysRight(value: number[]): any
  • Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.

    Returns number[]

  • Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.

    Parameters

    • value: number[]

    Returns any

keysUp

Find examples in Playground
  • get keysUp(): number[]
  • set keysUp(value: number[]): any
  • Gets or Set the list of keyboard keys used to control beta angle in a positive direction.

    Returns number[]

  • Gets or Set the list of keyboard keys used to control beta angle in a positive direction.

    Parameters

    • value: number[]

    Returns any

panningSensibility

Find examples in Playground
  • get panningSensibility(): number
  • set panningSensibility(value: number): any

pinchDeltaPercentage

Find examples in Playground
  • get pinchDeltaPercentage(): number
  • set pinchDeltaPercentage(value: number): any
  • Gets or Set the pointer pinch delta percentage or how fast is the camera zooming. It will be used instead of pinchDeltaPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.

    Returns number

  • Gets or Set the pointer pinch delta percentage or how fast is the camera zooming. It will be used instead of pinchDeltaPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.

    Parameters

    • value: number

    Returns any

pinchPrecision

Find examples in Playground
  • get pinchPrecision(): number
  • set pinchPrecision(value: number): any
  • Gets or Set the pointer pinch precision or how fast is the camera zooming.

    Returns number

  • Gets or Set the pointer pinch precision or how fast is the camera zooming.

    Parameters

    • value: number

    Returns any

position

Find examples in Playground

target

Find examples in Playground
  • Defines the target point of the camera. The camera looks towards it form the radius distance.

    Returns Vector3

  • Defines the target point of the camera. The camera looks towards it form the radius distance.

    Parameters

    Returns any

upVector

Find examples in Playground
  • The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up()) Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up. DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.

    Returns Vector3

  • The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up()) Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up. DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.

    Parameters

    Returns any

useAutoRotationBehavior

Find examples in Playground
  • get useAutoRotationBehavior(): boolean
  • set useAutoRotationBehavior(value: boolean): any

useBouncingBehavior

Find examples in Playground
  • get useBouncingBehavior(): boolean
  • set useBouncingBehavior(value: boolean): any

useFramingBehavior

Find examples in Playground
  • get useFramingBehavior(): boolean
  • set useFramingBehavior(value: boolean): any

useNaturalPinchZoom

Find examples in Playground
  • get useNaturalPinchZoom(): boolean
  • set useNaturalPinchZoom(value: boolean): any
  • Gets or Set the pointer use natural pinch zoom to override the pinch precision and pinch delta percentage. When useNaturalPinchZoom is true, multi touch zoom will zoom in such that any object in the plane at the camera's target point will scale perfectly with finger motion.

    Returns boolean

  • Gets or Set the pointer use natural pinch zoom to override the pinch precision and pinch delta percentage. When useNaturalPinchZoom is true, multi touch zoom will zoom in such that any object in the plane at the camera's target point will scale perfectly with finger motion.

    Parameters

    • value: boolean

    Returns any

wheelDeltaPercentage

Find examples in Playground
  • get wheelDeltaPercentage(): number
  • set wheelDeltaPercentage(value: number): any
  • Gets or Set the mouse wheel delta percentage or how fast is the camera zooming. It will be used instead of pinchDeltaPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.

    Returns number

  • Gets or Set the mouse wheel delta percentage or how fast is the camera zooming. It will be used instead of pinchDeltaPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.

    Parameters

    • value: number

    Returns any

wheelPrecision

Find examples in Playground
  • get wheelPrecision(): number
  • set wheelPrecision(value: number): any
  • Gets or Set the mouse wheel precision or how fast is the camera zooming.

    Returns number

  • Gets or Set the mouse wheel precision or how fast is the camera zooming.

    Parameters

    • value: number

    Returns any

Methods

attachControl

Find examples in Playground
  • attachControl(element: HTMLElement, noPreventDefault?: boolean, useCtrlForPanning?: boolean, panningMouseButton?: number): void
  • Attached controls to the current camera.

    Parameters

    • element: HTMLElement

      Defines the element the controls should be listened from

    • Optional noPreventDefault: boolean

      Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)

    • Optional useCtrlForPanning: boolean

      Defines whether ctrl is used for paning within the controls

    • Optional panningMouseButton: number

      Defines whether panning is allowed through mouse click button

    Returns void

createRigCamera

Find examples in Playground
  • createRigCamera(name: string, cameraIndex: number): Camera
  • override

    Override Camera.createRigCamera

    Parameters

    • name: string
    • cameraIndex: number

    Returns Camera

detachControl

Find examples in Playground
  • detachControl(element: HTMLElement): void
  • Detach the current controls from the camera. The camera will stop reacting to inputs.

    Parameters

    • element: HTMLElement

      Defines the element to stop listening the inputs from

    Returns void

dispose

Find examples in Playground
  • dispose(): void
  • Destroy the camera and release the current resources hold by it.

    Returns void

focusOn

Find examples in Playground
  • focusOn(meshesOrMinMaxVectorAndDistance: AbstractMesh[] | object, doNotUpdateMaxZ?: boolean): void
  • Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius. The target will be changed but the radius

    Parameters

    • meshesOrMinMaxVectorAndDistance: AbstractMesh[] | object

      Defines the mesh or bounding info to focus on

    • Optional doNotUpdateMaxZ: boolean

      Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)

    Returns void

getClassName

Find examples in Playground
  • getClassName(): string

getFrontPosition

Find examples in Playground
  • getFrontPosition(distance: number): Vector3
  • Gets the position in front of the camera at a given distance.

    Parameters

    • distance: number

      The distance from the camera we want the position to be

    Returns Vector3

    the position

getTarget

Find examples in Playground
  • Return the current target position of the camera. This value is expressed in local space.

    Returns Vector3

    the target position

rebuildAnglesAndRadius

Find examples in Playground
  • rebuildAnglesAndRadius(): void

setMatUp

Find examples in Playground
  • setMatUp(): void
  • Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.

    Returns void

setPosition

Find examples in Playground
  • setPosition(position: Vector3): void
  • Use a position to define the current camera related information like alpha, beta and radius

    Parameters

    • position: Vector3

      Defines the position to set the camera at

    Returns void

setTarget

Find examples in Playground
  • setTarget(target: AbstractMesh | Vector3, toBoundingCenter?: boolean, allowSamePosition?: boolean): void
  • Defines the target the camera should look at. This will automatically adapt alpha beta and radius to fit within the new target.

    Parameters

    • target: AbstractMesh | Vector3

      Defines the new target as a Vector or a mesh

    • Optional toBoundingCenter: boolean

      In case of a mesh target, defines whether to target the mesh position or its bounding information center

    • Optional allowSamePosition: boolean

      If false, prevents reapplying the new computed position if it is identical to the current one (optim)

    Returns void

storeState

Find examples in Playground

zoomOn

Find examples in Playground
  • zoomOn(meshes?: AbstractMesh[], doNotUpdateMaxZ?: boolean): void
  • Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.

    Parameters

    • Optional meshes: AbstractMesh[]

      Defines the mesh to zoom on

    • Optional doNotUpdateMaxZ: boolean

      Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)

    Returns void

Generated using TypeDoc