Reference Source
public class | source

AxisGizmoPlugin

Extends:

Plugin → AxisGizmoPlugin

Viewer plugin that shows the axii of the World-space coordinate system.

Usage

[Run this example]

import {Viewer, XKTLoaderPlugin, AxisGizmoPlugin} from "xeokit-sdk.es.js";

const viewer = new Viewer({
    canvasId: "myCanvas"
});

viewer.camera.eye = [-2.56, 8.38, 8.27];
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.10, 0.98, -0.14];

const xktLoader = new XKTLoaderPlugin(viewer);

new AxisGizmoPlugin(viewer, {
    canvasId: "myAxisGizmoCanvas"
});

const model = xktLoader.load({
    id: "myModel",
    src: "../assets/models/xkt/Schependomlaan.xkt",
    edges: true
});

Constructor Summary

Public Constructor
public

constructor(viewer: Viewer, cfg: Object)

Method Summary

Public Methods
public

Destroys this AxisGizmoPlugin.

public

setVisible(visible: *)

Shows or hides this AxisGizmoPlugin.

Inherited Summary

From class Plugin
public

ID for this Plugin, unique within its Viewer.

public

The Viewer that contains this Plugin.

public

Destroys this Plugin and removes it from its Viewer.

public

error(msg: String)

Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.

public

fire(event: String, value: Object)

Fires an event at this Plugin.

public

log(msg: String)

Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.

public

on(event: String, callback: Function)

Subscribes to an event fired at this Plugin.

public

warn(msg: String)

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#constructor

Params:

NameTypeAttributeDescription
viewer Viewer

The Viewer.

cfg Object

Plugin configuration.

cfg.id String
  • optional
  • default: "AxisGizmo"

Optional ID for this plugin, so that we can find it within Viewer#plugins.

cfg.canvasId String
  • optional

ID of an existing HTML canvas to display the AxisGizmo - either this or canvasElement is mandatory. When both values are given, the element reference is always preferred to the ID.

cfg.canvasElement HTMLCanvasElement
  • optional

Reference of an existing HTML canvas to display the AxisGizmo - either this or canvasId is mandatory. When both values are given, the element reference is always preferred to the ID.

Public Methods

public destroy() source

Destroys this AxisGizmoPlugin.

Override:

Plugin#destroy

public setVisible(visible: *) source

Shows or hides this AxisGizmoPlugin.

Params:

NameTypeAttributeDescription
visible *