WebVRFreeCamera

NodeCameraTargetCameraFreeCamera

Description

class WebVRFreeCamera extends FreeCamera

Constructor

new WebVRFreeCamera(name, position, scene, webVROptions)

Parameters

Name Type Description
name string
position Vector3
scene Scene

Members

rawPose : Nullable<DevicePose>

devicePosition : Vector3

deviceRotationQuaternion : Quaternion

deviceScaleFactor : number

controllers : Array<WebVRController>

onControllersAttachedObservable : Observable<WebVRController[]>

onControllerMeshLoadedObservable : Observable<WebVRController>

rigParenting : boolean

deviceDistanceToRoomGround : () => number

useStandingMatrix : (callback: (bool: boolean) => void) => void

Parameters

Name Type Description
optional callback bool boolean

|

leftController : Nullable<WebVRController>

rightController : Nullable<WebVRController>

Methods

dispose() void

getControllerByName(name) Nullable<WebVRController>

Parameters

Name Type Description
name string

getForwardRay(length) Ray

Parameters

Name Type Description
optional length number

updateFromDevice(poseData) void

Parameters

Name Type Description
poseData DevicePose

attachControl(element, noPreventDefault) void

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); }
     * @param {HTMLElement} element

     * @memberOf [WebVRFreeCamera](/classes/3.1/WebVRFreeCamera)

Parameters

Name Type Description
element HTMLElement
optional noPreventDefault boolean

detachControl(element) void

Parameters

Name Type Description
element HTMLElement

getClassName() string

resetToCurrentRotation() void

update() void

initControllers() void