import {AxisGizmoPlugin} from '@xeokit/xeokit-sdk/src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js'
AxisGizmoPlugin
Extends:
Viewer plugin that shows the axii of the World-space coordinate system.
Usage
import {Viewer} from "../src/viewer/Viewer.js";
import {GLTFLoaderPlugin} from "../src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js";
import {AxisGizmoPlugin} from "../src/plugins/AxisGizmoPlugin/AxisGizmoPlugin.js";
const viewer = new Viewer({
canvasId: "myCanvas"
});
const gltfLoader = new GLTFLoaderPlugin(viewer);
new AxisGizmoPlugin(viewer, {size: [250, 250]});
const model = gltfLoader.load({
id: "myModel",
src: "./models/gltf/schependomlaan/scene.gltf",
metaModelSrc: "./metaModels/schependomlaan/metaModel.json",
edges: true
});
const scene = viewer.scene;
const camera = scene.camera;
camera.orbitPitch(20);
model.on("loaded", () => {
viewer.cameraFlight.jumpTo(modelNode);
scene.on("tick", () => {
camera.orbitYaw(0.4);
})
});
Constructor Summary
Public Constructor | ||
public |
constructor(viewer: Viewer, cfg: Object) |
Method Summary
Public Methods | ||
public |
destroy() Destroys this AxisGizmoPlugin. |
|
public |
setVisible(visible: *) Shows or hides this helper |
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 at this Plugin. |
|
public |
Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin. |
|
public |
Subscribes to an event fired at this Plugin. |
|
public |
Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin. |
Public Constructors
public constructor(viewer: Viewer, cfg: Object) source
Creates this Plugin and installs it into the given Viewer.
Override:
Plugin#constructorPublic Methods
public setVisible(visible: *) source
Shows or hides this helper
Params:
Name | Type | Attribute | Description |
visible | * |