CubemapProjection
Projection based on cubemap images, accepts both multiple or single images.
class CubemapProjection extends Projection<{
uTexture: UniformTextureCube | UniformCanvasCube
}>
Extends
- Projection<{
uTexture: UniformTextureCube | UniformCanvasCube
}>
Properties
A 3D triangle mesh for projection. It's null
until loading the src
.
Source URL to panorama image/video.
Properties for the video element.
Setting false
will treat panorama source as an image, true
will use default properties.
Methods
Apply texture to current projection.
Return active texture.
Release all resources projection has.
This is automatically called on projection change & View360's destroy call
Update projection.
Update camera to match projection's settings.
Update control to match projection's settings.
Constructor
new CubemapProjection(options: CubemapProjectionOptions): CubemapProjection
Parameters
Options
Properties
mesh
meshnull | TriangleMesh<{ uTexture: UniformCanvasCube | UniformTextureCube }>
A 3D triangle mesh for projection. It's null
until loading the src
.
src
srcstring | HTMLElement | (string | HTMLElement)[]
Source URL to panorama image/video.
video
videoundefined | boolean | Partial<VideoConfig>
Properties for the video element.
Setting false
will treat panorama source as an image, true
will use default properties.
Default properties
autoplay: true
muted: true
loop: false
volume: 1
Methods
applyTexture
applyTexturevoid
applyTexture(ctx: WebGLContext, texture: Texture2D): void
Apply texture to current projection.
Parameters
WebGLContext
Instance of the WebGLContext helper
Texture2D
New texture to apply
getTexture
getTexturenull | Texture2D | TextureCube
getTexture(): null | Texture2D | TextureCube
Return active texture.
releaseAllResources
releaseAllResourcesvoid
releaseAllResources(ctx: WebGLContext): void
Release all resources projection has.
This is automatically called on projection change & View360's destroy call
Parameters
WebGLContext
update
updatevoid
update(camera: Camera): void
Update projection.
Parameters
Instance of the camera to reference
updateCamera
updateCameravoid
updateCamera(camera: Camera): void
Update camera to match projection's settings.
Parameters
Instance of the camera to update
updateControl
updateControlvoid
updateControl(control: PanoControl): void
Update control to match projection's settings.
Parameters
Instance of the control to update