Constructor
new VRWebgl(videonon-null, playernon-null, canvasnon-null, gl, projectionMode, hfovopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
video |
HTMLMediaElement | |||
player |
shaka.Player | |||
canvas |
HTMLCanvasElement | |||
gl |
WebGLRenderingContext | |||
projectionMode |
string | |||
hfov |
number |
<optional> |
180 | Horizontal field of view of the content, in degrees. Only used by the fisheye projection. |
- Implements:
- Source:
Members
geometry_ :?{vertices: !Array<number>, textureCoords: !Array<number>, indices: !Array<number>}
Type:
- ?{vertices: !Array<number>, textureCoords: !Array<number>, indices: !Array<number>}
- Source:
modelViewMatrixUniform_ :WebGLUniformLocation
Type:
- WebGLUniformLocation
- Source:
projectionMatrixUniform_ :WebGLUniformLocation
Type:
- WebGLUniformLocation
- Source:
Methods
getAspectRatio_() → {number}
Returns the aspect ratio of the displayed viewport, so that the
perspective projection does not stretch the image. The canvas is
displayed at the size of the video container, so the client size is
what the user sees. In stereoscopic mode each eye gets half of the
width.
- Source:
Returns:
- Type
- number
getCubeInsetU_() → {number}
Returns a horizontal inset of half a texel, so that the cube faces are
not sampled at the exact edge they share with the adjacent face of the
atlas. Otherwise the edges of the cube can become visible while moving
the view.
- Source:
Returns:
- Type
- number
getCubeInsetV_() → {number}
Returns a vertical inset of half a texel, see getCubeInsetU_.
- 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
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}
updateViewPort_()
- Source: