Configs
Manages global configurations for all Viewers.
Example
In the example below, we'll disable xeokit's double-precision support, which gives a performance and memory boost on low-power devices, but also means that we can no longer render double-precision models without jittering.
That's OK if we know that we're not going to view models that are geographically vast, or offset far from the World coordinate origin.
import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
// Access xeoit-sdk global configs.
// We typically set configs only before we create any Viewers.
const configs = new Configs();
// Disable 64-bit precision for extra speed.
// Only set this config once, before you create any Viewers.
configs.doublePrecisionEnabled = false;
// Create a Viewer, to which our configs apply
const viewer = new Viewer({
canvasId: "myCanvas"
});
viewer.camera.eye = [-3.933, 2.855, 27.018];
viewer.camera.look = [4.400, 3.724, 8.899];
viewer.camera.up = [-0.018, 0.999, 0.039];
const xktLoader = new XKTLoaderPlugin(viewer);
const model = xktLoader.load({
src: "../assets/models/xkt/v8/ifc/Duplex.ifc.xkt"
});
Constructor Summary
Public Constructor | ||
public |
Creates a Configs. |
Member Summary
Public Members | ||
public set |
Sets whether double precision mode is enabled for Viewers. |
|
public get |
Gets whether double precision mode is enabled for all Viewers. |
|
public set |
Sets the maximum data texture height. |
|
public get |
maxDataTextureHeight: * | number: * Sets maximum data texture height. |
|
public set |
Sets the maximum batched geometry VBO size. |
|
public get |
Gets the maximum batched geometry VBO size. |
Public Constructors
Public Members
public set doublePrecisionEnabled: Boolean source
Sets whether double precision mode is enabled for Viewers.
When double precision mode is enabled (default), Viewers will accurately render models that contain double-precision coordinates, without jittering.
Internally, double precision incurs extra performance and memory overhead, so if we're certain that we're not going to render models that rely on double-precision coordinates, then it's a good idea to disable it, especially on low-power devices.
This should only be set once, before creating any Viewers.
public get doublePrecisionEnabled: Boolean: * source
Gets whether double precision mode is enabled for all Viewers.
public set maxDataTextureHeight source
Sets the maximum data texture height.
Should be a multiple of 1024. Default is 4096, which is the maximum allowed value.
public set maxGeometryBatchSize source
Sets the maximum batched geometry VBO size.
Default value is 5000000, which is the maximum size.
Minimum size is 100000.