import {SkyboxesPlugin} from '@xeokit/xeokit-sdk/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js'
SkyboxesPlugin
Extends:
Viewer plugin that manages skyboxes
Example:
// Create a Viewer
const viewer = new Viewer({
canvasId: "myCanvas"
});
// Add a GLTFModelsPlugin
var gltfLoaderPlugin = new GLTFModelsPlugin(viewer, {
id: "GLTFModels" // Default value
});
// Add a SkyboxesPlugin
var skyboxesPlugin = new SkyboxesPlugin(viewer, {
id: "Skyboxes" // Default value
});
// Load a glTF model
const model = gltfLoaderPlugin.load({
id: "myModel",
src: "./models/gltf/mygltfmodel.gltf"
});
// Create three directional World-space lights. "World" means that they will appear as if part
// of the world, instead of "View", where they move with the user's head.
skyboxesPlugin.createLight({
id: "keyLight",
dir: [0.8, -0.6, -0.8],
color: [1.0, 0.3, 0.3],
intensity: 1.0,
space: "world"
});
skyboxesPlugin.createLight({
id: "fillLight",
dir: [-0.8, -0.4, -0.4],
color: [0.3, 1.0, 0.3],
intensity: 1.0,
space: "world"
});
skyboxesPlugin.createDirLight({
id: "rimLight",
dir: [0.2, -0.8, 0.8],
color: [0.6, 0.6, 0.6],
intensity: 1.0,
space: "world"
});
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
skyboxes: {} |
Method Summary
Public Methods | ||
public |
clear() Destroys all skyboxes. |
|
public |
createSkybox(id: String, params: Object): Skybox Creates a skybox. |
|
public |
destroy() Destroys this plugin. |
|
public |
destroySkybox(id: *) Destroys a skybox. |
Inherited Summary
From class Plugin | ||
public |
ID for this Plugin, unique within its Viewer. |
|
public |
The Viewer that contains this Plugin. |
|
public |
destroy() Destroys this Plugin and removes it from its Viewer. |
|
public |
Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Fires an event on this Plugin. |
|
public |
Returns true if there are any subscribers to the given event on this Plugin. |
|
public |
Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Cancels an event subscription that was previously made with Plugin#on or Plugin#once. |
|
public |
Subscribes to an event on this Plugin. |
|
public |
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd. |
|
public |
scheduleTask(task: *) Schedule a task to perform on the next browser interval |
|
public |
Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin. |
Public Constructors
public constructor() source
Creates this Plugin and installs it into the given Viewer.