DeviceOrientationCamera

This is a camera specifically designed to react to device orientation events such as a modern mobile device being tilted forward or back and left or right.

Hierarchy

Index

Constructors

constructor

Find examples in Playground

Properties

angularSensibility

Find examples in Playground
angularSensibility: number

Sets the input sensibility for a mouse input. (default is 2000.0) Higher values reduce sensitivity.

applyGravity

Find examples in Playground
applyGravity: boolean

Enable or disable gravity on the camera.

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

Enable or disable collisions of the camera with the rest of the scene objects.

collisionMask

Find examples in Playground
collisionMask: number

Define a collision mask to limit the list of object the camera can collide with

disablePointerInputWhenUsingDeviceOrientation

Find examples in Playground
disablePointerInputWhenUsingDeviceOrientation: boolean

Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)

ellipsoid

Find examples in Playground
ellipsoid: Vector3

Define the collision ellipsoid of the camera. This is helpful to simulate a camera body like the player body around the camera

see

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

ellipsoidOffset

Find examples in Playground
ellipsoidOffset: Vector3

Define an offset for the position of the ellipsoid around the camera. This can be helpful to determine the center of the body near the gravity center of the body instead of its head.

inputs

Find examples in Playground

Define the input manager associated to the camera.

keysDown

Find examples in Playground
keysDown: number[]

Gets or Set the list of keyboard keys used to control the backward move of the camera.

keysLeft

Find examples in Playground
keysLeft: number[]

Gets or Set the list of keyboard keys used to control the left strafe move of the camera.

keysRight

Find examples in Playground
keysRight: number[]

Gets or Set the list of keyboard keys used to control the right strafe move of the camera.

keysUp

Find examples in Playground
keysUp: number[]

Gets or Set the list of keyboard keys used to control the forward move of the camera.

lockedTarget

Find examples in Playground
lockedTarget: any

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

noRotationConstraint

Find examples in Playground
noRotationConstraint: boolean

Add cconstraint 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 collide with a mesh in the scene.

Type declaration

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

updateUpVectorFromRotation

Find examples in Playground
updateUpVectorFromRotation: boolean

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

Methods

attachControl

Find examples in Playground
  • attachControl(element: HTMLElement, noPreventDefault?: boolean): void

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

enableHorizontalDragging

Find examples in Playground
  • enableHorizontalDragging(dragFactor?: number): void
  • Enabled turning on the y axis when the orientation sensor is active

    Parameters

    • Optional dragFactor: number

      the factor that controls the turn speed (default: 1/300)

    Returns void

getClassName

Find examples in Playground
  • getClassName(): string
  • Gets the current instance class name ("DeviceOrientationCamera"). This helps avoiding instanceof at run time.

    Returns string

    the class name

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

resetToCurrentRotation

Find examples in Playground
  • resetToCurrentRotation(axis?: Axis): void
  • Reset the camera to its default orientation on the specified axis only.

    Parameters

    • Optional axis: Axis

      The axis to reset

    Returns void

setTarget

Find examples in Playground
  • Defines the target the camera should look at.

    Parameters

    • target: Vector3

      Defines the new target as a Vector or a mesh

    Returns void

storeState

Find examples in Playground
  • Store current camera state of the camera (fov, position, rotation, etc..)

    Returns Camera

    the camera

Generated using TypeDoc