Class WebVRFreeCamera
Hierarchy
-
FreeCamera
- WebVRFreeCamera
Implements
Index
Constructors
Properties
- apply
Gravity - camera
Direction - camera
Rotation - check
Collisions - controllers
- device
Position - device
Rotation Quaternion - device
Scale Factor - ellipsoid
- ellipsoid
Offset - ignore
Parent Scaling - inputs
- inverse
Rotation Speed - invert
Rotation - locked
Target - no
Rotation Constraint - on
Collide - on
Controller Mesh Loaded Observable - on
Controllers Attached Observable - on
Pose Updated From Device Observable - raw
Pose - rig
Parenting - rotation
- rotation
Quaternion - speed
- update
UpVector From Rotation
Accessors
Methods
Constructors
constructor
-
Instantiates a WebVRFreeCamera.
Parameters
-
name: string
The name of the WebVRFreeCamera
-
position: Vector3
The starting anchor position for the camera
-
scene: Scene
The scene the camera belongs to
-
Optional webVROptions: WebVROptions
a set of customizable options for the webVRCamera
Returns WebVRFreeCamera
-
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.
controllersSearch playground for controllers
References to the webVR controllers for the vrDevice.
device PositionSearch playground for devicePosition
Represents device position in babylon space.
device Rotation QuaternionSearch playground for deviceRotationQuaternion
Represents device rotation in babylon space.
device Scale FactorSearch playground for deviceScaleFactor
The scale of the device to be used when translating from device space to babylon space.
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
-
-
on Controller Mesh Loaded ObservableSearch playground for onControllerMeshLoadedObservable
Emits an event when a controller's mesh has been loaded;
on Controllers Attached ObservableSearch playground for onControllersAttachedObservable
Emits an event when a controller is attached.
on Pose Updated From Device ObservableSearch playground for onPoseUpdatedFromDeviceObservable
Emits an event when the HMD's pose has been updated.
raw PoseSearch playground for rawPose
The rawPose of the vrDevice.
rig ParentingSearch playground for rigParenting
If the rig cameras be used as parent instead of this camera.
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
-
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
-
left Controller
-
The controller corresponding to the users left hand.
Returns Nullable<WebVRController>
right Controller
-
The controller corresponding to the users right hand.
Returns Nullable<WebVRController>
target
Methods
attach ControlSearch playground for attachControl
-
WebVR's attach control will start broadcasting frames to the device. Note that in certain browsers (chrome for example) this function must be called within a user-interaction callback. Example:
scene.onPointerDown = function() { camera.attachControl(canvas); }
Parameters
-
Optional noPreventDefault: boolean
prevent the default html element operation when attaching the vrDevice
Returns void
-
detach ControlSearch playground for detachControl
-
Detach the current controls from the specified dom element.
Returns void
device Distance ToRoom GroundSearch playground for deviceDistanceToRoomGround
-
Gets the device distance from the ground in meters.
Returns number
the distance in meters from the vrDevice to ground in device space. If standing matrix is not supported for the vrDevice 0 is returned.
disposeSearch playground for dispose
-
Disposes the camera
Returns void
get Class NameSearch playground for getClassName
-
Returns string
the name of this class
get Controller ByNameSearch playground for getControllerByName
-
Gets a vrController by name.
Parameters
-
name: string
The name of the controller to retreive
Returns Nullable<WebVRController>
the controller matching the name specified or null if not found
-
get Forward RaySearch playground for getForwardRay
-
Casts a ray forward from the vrCamera's gaze.
Parameters
-
Optional length: number
Length of the ray (default: 100)
Returns Ray
the ray corresponding to the gaze
-
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
init ControllersSearch playground for initControllers
-
Initializes the controllers and their meshes
Returns void
reset ToCurrent RotationSearch playground for resetToCurrentRotation
-
Calls resetPose on the vrDisplay See: https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/resetPose
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
updateSearch playground for update
-
Updates the current device position and rotation in the babylon world
Returns void
update From DeviceSearch playground for updateFromDevice
-
Updates the poseControlled values based on the input device pose.
Parameters
-
poseData: DevicePose
Pose coming from the device
Returns void
-
use Standing MatrixSearch playground for useStandingMatrix
-
Enables the standing matrix when supported. This can be used to position the user's view the correct height from the ground.
Parameters
-
Optional callback: (bool: boolean) => void
will be called when the standing matrix is set. Callback parameter is if the standing matrix is supported.
-
-
Parameters
-
bool: boolean
Returns void
-
-
-
Returns void
-
use Standing Matrix AsyncSearch playground for useStandingMatrixAsync
-
Enables the standing matrix when supported. This can be used to position the user's view the correct height from the ground.
Returns Promise<boolean>
A promise with a boolean set to if the standing matrix is supported.
This represents a WebVR camera. The WebVR camera is Babylon's simple interface to interaction with Windows Mixed Reality, HTC Vive and Oculus Rift.
https://doc.babylonjs.com/how_to/webvr_camera