VRCamera

VRCamera

Stereographic camera. Used for VR. The position of the camera corresponds to the midpoint between the two eyes.

Constructor

new VRCamera(parameters)

Source:

Constructor.

Parameters:
Name Type Description
parameters Object

the parameters of the camera. This parameters are

  • {number} fov - the field of view
  • {number} minDist - the minimal distance we ray-march
  • {number} maxDist - the maximal distance we ray-march
  • {number} maxSteps - the maximal number of steps during the ray-marching
  • {number} threshold - the threshold to stop the ray-marching
  • {TeleportationSet} set - the underlying subgroup of the geometry (to create the position)
  • {number} ipDist - the interpupillary distance

Classes

VRCamera

Members

chaseThreeCamera

Source:

In VR mode the position of the Three.js camera (in the euclidean Three.js scene) is directly controlled by the VR headset. This method update the position of the observer in the geometry accordingly. Every displacement is the Three.js scene is interpreted as a tangent vector. We move the observer by following the geodesic in this direction. The method also update the left and right eyes positions. The method should be called at each frame.

fakeCameras :Array.<Object>

Source:

Two fake copies of the cameras meant to be passed to the shader as uniforms.

Type:
  • Array.<Object>

ipDist

Source:

Half the interpupillary distance

isStereoOff :boolean

Source:

True if stereo is off

Type:
  • boolean

isStereoOn :boolean

Source:

True if stereo is on

Type:
  • boolean

Methods

(private) _chaseThreeCamera()

Source:

sidedShader(shaderBuilder, side)

Source:

build the GLSL code needed to declare the camera

Parameters:
Name Type Description
shaderBuilder ShaderBuilder

the shader builder

side number

the side (left of right) (used for stereographic camera)

switchStereo()

Source:

Turn the stereo mode on or off

updateFakeCamerasPosition()

Source:

Update the fake camera position. Shift the left and right camera from the current position using parallel transport.