Class: shaka.ui.VRWebgl

Constructor

new VRWebgl(videonon-null, playernon-null, canvasnon-null, gl, projectionMode)

Parameters:
Name Type Description
video HTMLMediaElement
player shaka.Player
canvas HTMLCanvasElement
gl WebGLRenderingContext
projectionMode string
Implements:
Source:

Members

ANIMATION_DURATION_ :number

Type:
  • number
Source:

canvas_ :HTMLCanvasElement

Type:
  • HTMLCanvasElement
Source:

cont_ :number

Type:
  • number
Source:

currentQuaternion_ :Float32Array

Type:
  • Float32Array
Source:

diff_ :Float32Array

Type:
  • Float32Array
Source:

fieldOfView_ :number

Type:
  • number
Source:

geometry_ :?{vertices: !Array.<number>, textureCoords: !Array.<number>, indices: !Array.<number>}

Type:
  • ?{vertices: !Array.<number>, textureCoords: !Array.<number>, indices: !Array.<number>}
Source:

gl_ :WebGLRenderingContext

Type:
  • WebGLRenderingContext
Source:

identityMatrix_ :Float32Array

Type:
  • Float32Array
Source:

originalQuaternion_ :Float32Array

Type:
  • Float32Array
Source:

positionY_ :number

Type:
  • number
Source:

previousCanvasHeight_ :number

Type:
  • number
Source:

previousCanvasWidth_ :number

Type:
  • number
Source:

projectionMatrix_ :Float32Array

Type:
  • Float32Array
Source:

projectionMode_ :string

Type:
  • string
Source:

shaderProgram_ :WebGLProgram

Type:
  • WebGLProgram
Source:

stereoscopicMode_ :boolean

Type:
  • boolean
Source:

texture_ :WebGLTexture

Type:
  • WebGLTexture
Source:

textureCoordAttribute_ :number

Type:
  • number
Source:

vertexPositionAttribute_ :number

Type:
  • number
Source:

verticesBuffer_ :WebGLBuffer

Type:
  • WebGLBuffer
Source:

verticesIndexBuffer_ :WebGLBuffer

Type:
  • WebGLBuffer
Source:

verticesTextureCoordBuffer_ :WebGLBuffer

Type:
  • WebGLBuffer
Source:

video_ :HTMLVideoElement

Type:
  • HTMLVideoElement
Source:

viewMatrix_ :Float32Array

Type:
  • Float32Array
Source:

viewProjectionMatrix_ :Float32Array

Type:
  • Float32Array
Source:

Methods

getFieldOfView() → {number}

Source:
Returns:
Type
number

getGLShader_(glType) → {WebGLShader}

Read and generate WebGL shader
Parameters:
Name Type Description
glType number Type of shader requested.
Source:
Returns:
Type
WebGLShader

getNorth() → {number}

Source:
Returns:
Type
number

getProjectionMode() → {string}

Source:
Returns:
Type
string

init_()

Source:

initGL_()

Source:

initGLBuffers_()

Source:

initGLShaders_()

Source:

initGLTexture_()

Source:

initMatrices_()

Source:

isStereoscopicModeEnabled() → {boolean}

Returns true if stereoscopic mode is enabled.
Source:
Returns:
Type
boolean

release()

Request that this object release all internal references.
Implements:
Source:

renderGL_(textureUpdateopt)

Parameters:
Name Type Attributes Default Description
textureUpdate boolean <optional>
true
Source:

reset(firstTimeopt)

Parameters:
Name Type Attributes Default Description
firstTime boolean <optional>
true
Source:

rotateViewGlobal(yawnon-null, pitchnon-null, rollnon-null)

Rotate the view matrix global
Parameters:
Name Type Description
yaw number Yaw.
pitch number Pitch.
roll number Roll.
Source:

setFieldOfView(fieldOfView)

Parameters:
Name Type Description
fieldOfView number
Source:

setMatrixUniforms_()

Source:

toEulerAngles_(quatnon-null) → {{pitch: number, yaw: number, roll: number}}

Parameters:
Name Type Description
quat Float32Array
Source:
Returns:
as radians
Type
{pitch: number, yaw: number, roll: number}

toggleStereoscopicMode()

Toogle stereoscopic mode
Source:

updateViewPort_()

Source:

zoom(amount)

Parameters:
Name Type Description
amount number
Source: