Class DeviceOrientationCamera
Hierarchy
-
FreeCamera
- DeviceOrientationCamera
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates a new device orientation camera
Parameters
-
name: string
The name of the camera
-
position: Vector3
The start position camera
-
scene: Scene
The scene the camera belongs to
Returns DeviceOrientationCamera
-
Properties
apply GravitySearch playground for applyGravity
Enable or disable gravity on the camera.
camera DirectionSearch playground for cameraDirection
Define the current direction the camera is moving to
camera RotationSearch playground for cameraRotation
Define the current rotation the camera is rotating to
check CollisionsSearch playground for checkCollisions
Enable or disable collisions of the camera with the rest of the scene objects.
ellipsoidSearch playground for ellipsoid
Define the collision ellipsoid of the camera. This is helpful to simulate a camera body like the player body around the camera
ellipsoid OffsetSearch playground for ellipsoidOffset
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.
ignore Parent ScalingSearch playground for ignoreParentScaling
Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera
inputsSearch playground for inputs
Define the input manager associated to the camera.
inverse Rotation SpeedSearch playground for inverseRotationSpeed
Speed multiplier for inverse camera panning
invert RotationSearch playground for invertRotation
Reverses mouselook direction to 'natural' panning as opposed to traditional direct panning
locked TargetSearch playground for lockedTarget
Define the current target of the camera as an object or a position.
no Rotation ConstraintSearch playground for noRotationConstraint
Add constraint to the camera to prevent it to move freely in all directions and around all axis.
on CollideSearch playground for onCollide
Event raised when the camera collide with a mesh in the scene.
Type declaration
-
-
Parameters
-
collidedMesh: AbstractMesh
Returns void
-
-
rotationSearch playground for rotation
Define the current rotation of the camera
rotation QuaternionSearch playground for rotationQuaternion
Define the current rotation of the camera as a quaternion to prevent Gimbal lock
speedSearch playground for speed
Define the current speed of the camera
update UpVector From RotationSearch playground for updateUpVectorFromRotation
When set, the up vector of the camera will be updated by the rotation of the camera
Accessors
angular Sensibility
-
Gets the input sensibility for a mouse input. (default is 2000.0) Higher values reduce sensitivity.
Returns number
-
Sets the input sensibility for a mouse input. (default is 2000.0) Higher values reduce sensitivity.
Parameters
-
value: number
Returns any
-
collision Mask
-
Define a collision mask to limit the list of object the camera can collide with
Returns number
-
Define a collision mask to limit the list of object the camera can collide with
Parameters
-
mask: number
Returns any
-
disable Pointer Input When Using Device Orientation
-
Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
Returns boolean
-
Gets or sets a boolean indicating that pointer input must be disabled on first orientation sensor update (Default: true)
Parameters
-
value: boolean
Returns any
-
keys Down
-
Gets or Set the list of keyboard keys used to control the backward move of the camera.
Returns number[]
-
Gets or Set the list of keyboard keys used to control the backward move of the camera.
Parameters
-
value: number[]
Returns any
-
keys Downward
-
Gets or Set the list of keyboard keys used to control the downward move of the camera.
Returns number[]
-
Gets or Set the list of keyboard keys used to control the downward move of the camera.
Parameters
-
value: number[]
Returns any
-
keys Left
-
Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
Returns number[]
-
Gets or Set the list of keyboard keys used to control the left strafe move of the camera.
Parameters
-
value: number[]
Returns any
-
keys Right
-
Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
Returns number[]
-
Gets or Set the list of keyboard keys used to control the right strafe move of the camera.
Parameters
-
value: number[]
Returns any
-
keys Up
-
Gets or Set the list of keyboard keys used to control the forward move of the camera.
Returns number[]
-
Gets or Set the list of keyboard keys used to control the forward move of the camera.
Parameters
-
value: number[]
Returns any
-
keys Upward
-
Gets or Set the list of keyboard keys used to control the upward move of the camera.
Returns number[]
-
Gets or Set the list of keyboard keys used to control the upward move of the camera.
Parameters
-
value: number[]
Returns any
-
target
Methods
attach ControlSearch playground for attachControl
-
Attach the input controls to a specific dom element to get the input from.
Parameters
-
Optional noPreventDefault: boolean
Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Returns void
-
-
Attach the input controls to a specific dom element to get the input from.
Parameters
-
ignored: any
defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
-
Optional noPreventDefault: boolean
Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) BACK COMPAT SIGNATURE ONLY.
Returns void
-
detach ControlSearch playground for detachControl
-
Detach the current controls from the specified dom element.
Returns void
-
Detach the current controls from the specified dom element.
Parameters
-
ignored: any
defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
Returns void
-
disposeSearch playground for dispose
-
Destroy the camera and release the current resources hold by it.
Returns void
enable Horizontal DraggingSearch playground for enableHorizontalDragging
-
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
-
get Class NameSearch playground for getClassName
-
Gets the current instance class name ("DeviceOrientationCamera"). This helps avoiding instanceof at run time.
Returns string
the class name
get Front PositionSearch playground for getFrontPosition
-
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
-
get TargetSearch playground for getTarget
-
Return the current target position of the camera. This value is expressed in local space.
Returns Vector3
the target position
reset ToCurrent RotationSearch playground for resetToCurrentRotation
-
Reset the camera to its default orientation on the specified axis only.
Parameters
-
Optional axis: Axis
The axis to reset
Returns void
-
set TargetSearch playground for setTarget
-
Defines the target the camera should look at.
Parameters
-
target: Vector3
Defines the new target as a Vector or a mesh
Returns void
-
store StateSearch playground for storeState
-
Store current camera state of the camera (fov, position, rotation, etc..)
Returns Camera
the camera
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.