WebVRCamera

WebVRCamera

This class represents the WebVRCamera that extends original camera.
it takes device provided projectionMatrix, viewMatrix and transformMatrix as input
The view matrix and projection matrix as output
The other configuration should not been used in this class.

Constructor

new WebVRCamera(HMDProjectionMatrixopt, HMDViewMatrixopt, viewTransformopt)

Parameters:
Name Type Attributes Description
HMDProjectionMatrix Matrix4 <optional>

The projection matrix that provided by VR device

HMDViewMatrix Matrix4 <optional>

The viewMatrix provided by the VR device

viewTransform Vector3 <optional>

the transform matrix applied on VR provided view Matrix.

Methods

copy(source)

Copy the settings of a source camera to this camera.

Parameters:
Name Type Description
source Camera

pack(sceneBounds)

Compress this camera's near and far frustum planes to be smaller if possible,
using the given bounds as a measure.

Parameters:
Name Type Description
sceneBounds BoundingVolume

The scene bounds.

setProjectionMatrixPerspective(HMDProjectionMatrix)

Set the injectedProjectionMatrix to the projectionMatrix provided by the HMD

Parameters:
Name Type Description
HMDProjectionMatrix Matrix4

setProjectionMode(projectionMode)

Sets the projection mode of the camera. (Camera.Perspective / Camera.Parallel)

Parameters:
Name Type Description
projectionMode ProjectionMode

The new projection mode - Camera.Perspective or Camera.Parallel

setToObliqueMatrix(clipPlane)

Clip using an oblique frustum different from the the view frustum

Parameters:
Name Type Description
clipPlane Vector4

Clipping plane. (nx, ny, nz, constant)

setViewMatrix(HMDViewMatrix, transformMatrix)

Set the injectedViewMatrix to the ViewMatrix provided by the HMD

Parameters:
Name Type Description
HMDViewMatrix Matrix4

the view matrix provided by HMD.

transformMatrix Matrix4

updateModelViewMatrix()

Updates the value of our model view matrix.

updateProjectionMatrix()

Updates the value of our projection matrix.