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:
{
"skybox": {
"faceMapping": [
{ "fileName": "right.jpg", "transform": { "flipY": true } }
]
}
}Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkSkyboxReader characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ISkyboxReaderInitialValues | No | (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
| Argument | Type | Required | Description |
|---|---|---|---|
busy | Boolean | Yes |
isBusy
Get the current status of the reader. True means busy and False means idle.
loadData
Load the object data.
| Argument | Type | Required | Description |
|---|---|---|---|
option | ISkyboxReaderOptions | No |
newInstance
Method used to create a new instance of vtkSkyboxReader
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ISkyboxReaderInitialValues | No | for pre-setting some of its content |
onBusy
| Argument | Type | Required | Description |
|---|---|---|---|
callback | Yes |
parseAsArrayBuffer
Unzip the given buffer and build one vtkTexture per camera position it contains. Returns false when no content is given.
| Argument | Type | Required | Description |
|---|---|---|---|
content | ArrayBuffer | Yes | The content to parse. |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
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.
| Argument | Type | Required | Description |
|---|---|---|---|
faceMapping | Array[ISkyboxFaceMapping] | Yes |
setPosition
Select the camera position to expose as the output texture. Ignored when the name is not one of getPositions().
| Argument | Type | Required | Description |
|---|---|---|---|
name | String | Yes |
setUrl
Set the url of the zip to load and fetch it.
| Argument | Type | Required | Description |
|---|---|---|---|
url | String | Yes | the url of the zip to load. |
option | ISkyboxReaderOptions | No | The Skybox reader options. |