Skip to content

SkyboxReader ​

Introduction ​

vtkSkyboxReader reads a zip file containing one or more camera positions, each holding the six jpg images composing a skybox texture. The mapping of the images onto the cube faces comes either from setFaceMapping() or from an index.json embedded in the zip:

json
{
  "skybox": {
    "faceMapping": [
      { "fileName": "right.jpg", "transform": { "flipY": true } }
    ]
  }
}

Methods ​

extend ​

Method used to decorate a given object (publicAPI+model) with vtkSkyboxReader characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesISkyboxReaderInitialValuesNo(default: {})

getFaceMapping ​

getPosition ​

Camera position currently exposed as the output texture.

getPositions ​

Camera positions found in the loaded zip.

getReadyPromise ​

Promise resolving with this reader once the images are all decoded.

getUrl ​

Get the url of the zip to load.

invokeBusy ​

ArgumentTypeRequiredDescription
busyBooleanYes

isBusy ​

Get the current status of the reader. True means busy and False means idle.

loadData ​

Load the object data.

ArgumentTypeRequiredDescription
optionISkyboxReaderOptionsNo

newInstance ​

Method used to create a new instance of vtkSkyboxReader

ArgumentTypeRequiredDescription
initialValuesISkyboxReaderInitialValuesNofor pre-setting some of its content

onBusy ​

ArgumentTypeRequiredDescription
callbackYes

parseAsArrayBuffer ​

Unzip the given buffer and build one vtkTexture per camera position it contains. Returns false when no content is given.

ArgumentTypeRequiredDescription
contentArrayBufferYesThe content to parse.

requestData ​

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setFaceMapping ​

Set which image of a position folder goes on which cube face, and how it must be transformed. Overridden by the index.json of the zip when it declares a face mapping.

ArgumentTypeRequiredDescription
faceMappingArray[ISkyboxFaceMapping]Yes

setPosition ​

Select the camera position to expose as the output texture. Ignored when the name is not one of getPositions().

ArgumentTypeRequiredDescription
nameStringYes

setUrl ​

Set the url of the zip to load and fetch it.

ArgumentTypeRequiredDescription
urlStringYesthe url of the zip to load.
optionISkyboxReaderOptionsNoThe Skybox reader options.