@xeokit/xeokit-sdk 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/xeokit-sdk.cjs.js +66286 -66051
- package/dist/xeokit-sdk.es.js +66286 -66051
- package/dist/xeokit-sdk.es5.js +16813 -16750
- package/dist/xeokit-sdk.min.cjs.js +2 -2
- package/dist/xeokit-sdk.min.es.js +2 -2
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
- package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +7 -0
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +1 -1
- package/types/viewer/scene/geometry/VBOGeometry.d.ts +63 -0
- package/types/viewer/scene/geometry/builders/buildBoxGeometry.d.ts +22 -0
- package/types/viewer/scene/geometry/builders/buildBoxLinesGeometry.d.ts +22 -0
- package/types/viewer/scene/geometry/builders/buildCylinderGeometry.d.ts +28 -0
- package/types/viewer/scene/geometry/builders/buildGridGeometry.d.ts +18 -0
- package/types/viewer/scene/geometry/builders/buildPlaneGeometry.d.ts +22 -0
- package/types/viewer/scene/geometry/builders/buildSphereGeometry.d.ts +22 -0
- package/types/viewer/scene/geometry/builders/buildTorusGeometry.d.ts +26 -0
- package/types/viewer/scene/geometry/builders/buildVectorTextGeometry.d.ts +22 -0
- package/types/viewer/scene/geometry/builders/index.d.ts +8 -0
- package/types/viewer/scene/geometry/index.d.ts +2 -0
- package/types/viewer/scene/scene/Scene.d.ts +1 -1
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ export declare type ReadableGeometryConfiguration = {
|
|
|
31
31
|
*
|
|
32
32
|
* ReadableGeometry uses more memory than {@link VBOGeometry}, which only stores its geometry data in GPU memory.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
export declare class ReadableGeometry extends Geometry {
|
|
35
35
|
/**
|
|
36
36
|
* constructor
|
|
37
37
|
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Component } from "../Component";
|
|
2
|
+
import { Geometry } from "./Geometry";
|
|
3
|
+
|
|
4
|
+
export declare type VBOGeometryConfiguration = {
|
|
5
|
+
/** Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Optional map of user-defined metadata to attach to this Geometry. */
|
|
8
|
+
meta?: {[key: string]: any};
|
|
9
|
+
/** The primitive type. */
|
|
10
|
+
primitive?: "points" | "lines"| "line-loop"| "line-strip"| "triangles"| "triangle-strip" | "triangle-fan";
|
|
11
|
+
/** Positions array. */
|
|
12
|
+
positions?: number[];
|
|
13
|
+
/** Vertex normal vectors array. */
|
|
14
|
+
normals?: number[];
|
|
15
|
+
/** UVs array. */
|
|
16
|
+
uv?: number[];
|
|
17
|
+
/** Vertex colors. */
|
|
18
|
+
colors?: number[];
|
|
19
|
+
/** Indices array. */
|
|
20
|
+
indices?: number[];
|
|
21
|
+
/** When a {@link Mesh} renders this Geometry as wireframe, this indicates the threshold angle (in degrees) between the face normals of adjacent triangles below which the edge is discarded.*/
|
|
22
|
+
edgeThreshold?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @desc A {@link Geometry} that keeps its geometry data solely in GPU memory, without retaining it in browser memory.
|
|
27
|
+
*
|
|
28
|
+
* VBOGeometry uses less memory than {@link ReadableGeometry}, which keeps its geometry data in both browser and GPU memory.
|
|
29
|
+
*/
|
|
30
|
+
export declare class VBOGeometry extends Geometry {
|
|
31
|
+
/**
|
|
32
|
+
* @constructor
|
|
33
|
+
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
|
34
|
+
* @param {VBOGeometryConfiguration} cfg Configs
|
|
35
|
+
*/
|
|
36
|
+
constructor(owner: Component, cfg?: VBOGeometryConfiguration);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Gets the primitive type.
|
|
40
|
+
*/
|
|
41
|
+
get primitive(): "points" | "lines"| "line-loop"| "line-strip"| "triangles"| "triangle-strip" | "triangle-fan";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the local-space axis-aligned 3D boundary (AABB).
|
|
45
|
+
*
|
|
46
|
+
* The AABB is represented by a six-element Float64Array containing the min/max extents of the axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
|
|
47
|
+
*/
|
|
48
|
+
get aabb(): Number[];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Gets the local-space oriented 3D boundary (OBB).
|
|
52
|
+
*
|
|
53
|
+
* The OBB is represented by a 32-element Float64Array containing the eight vertices of the box, where each vertex is a homogeneous coordinate having [x,y,z,w] elements.
|
|
54
|
+
*/
|
|
55
|
+
get obb(): Number[];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Approximate number of triangles in this VBOGeometry.
|
|
59
|
+
*
|
|
60
|
+
* Will be zero if {@link VBOGeometry#primitive} is not 'triangles', 'triangle-strip' or 'triangle-fan'.
|
|
61
|
+
*/
|
|
62
|
+
get numTriangles(): Number;
|
|
63
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildBoxGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D point indicating the center position. */
|
|
7
|
+
center?: number[];
|
|
8
|
+
/* Half-size on the X-axis. */
|
|
9
|
+
xSize?: number;
|
|
10
|
+
/* Half-size on the Y-axis. */
|
|
11
|
+
ySize?: number;
|
|
12
|
+
/* Half-size on the Z-axis. */
|
|
13
|
+
zSize?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @desc Creates box-shaped {@link Geometry}.
|
|
18
|
+
*
|
|
19
|
+
* @param {buildBoxGeometryConfiguration} [cfg] Configs
|
|
20
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
21
|
+
*/
|
|
22
|
+
export function buildBoxGeometry(cfg: buildBoxGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildBoxLinesGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D point indicating the center position. */
|
|
7
|
+
center?: number[];
|
|
8
|
+
/* Half-size on the X-axis. */
|
|
9
|
+
xSize?: number;
|
|
10
|
+
/* Half-size on the Y-axis. */
|
|
11
|
+
ySize?: number;
|
|
12
|
+
/* Half-size on the Z-axis.*/
|
|
13
|
+
zSize?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @desc Creates a box-shaped lines {@link Geometry}.
|
|
18
|
+
*
|
|
19
|
+
* @param {buildBoxLinesGeometryConfiguration} [cfg] Configs
|
|
20
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
21
|
+
*/
|
|
22
|
+
export function buildBoxLinesGeometry(cfg: buildBoxLinesGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildCylinderGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D point indicating the center position. */
|
|
7
|
+
center?: number[];
|
|
8
|
+
/* Radius of top. */
|
|
9
|
+
radiusTop?: number;
|
|
10
|
+
/* Radius of bottom. */
|
|
11
|
+
radiusBottom?: number;
|
|
12
|
+
/* Height. */
|
|
13
|
+
height?: number;
|
|
14
|
+
/* Number of horizontal segments. */
|
|
15
|
+
radialSegments?: number;
|
|
16
|
+
/* Number of vertical segments. */
|
|
17
|
+
heightSegments?: number;
|
|
18
|
+
/* Whether or not the cylinder has solid caps on the ends. */
|
|
19
|
+
openEnded?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @desc Creates a cylinder-shaped {@link Geometry}.
|
|
24
|
+
*
|
|
25
|
+
* @param {buildCylinderGeometryConfiguration} [cfg] Configs
|
|
26
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
27
|
+
*/
|
|
28
|
+
export function buildCylinderGeometry(cfg: buildCylinderGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildGridGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* Dimension on the X and Z-axis. */
|
|
7
|
+
size?: number;
|
|
8
|
+
/* Number of divisions on X and Z axis.. */
|
|
9
|
+
divisions?: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @desc Creates a grid-shaped {@link Geometry}.
|
|
14
|
+
*
|
|
15
|
+
* @param {buildGridGeometryConfiguration} [cfg] Configs
|
|
16
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
17
|
+
*/
|
|
18
|
+
export function buildGridGeometry(cfg: buildGridGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildPlaneGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* Dimension on the X-axis. */
|
|
7
|
+
xSize?: number;
|
|
8
|
+
/* Dimension on the Z-axis. */
|
|
9
|
+
zSize?: number;
|
|
10
|
+
/* Number of segments on the X-axis. */
|
|
11
|
+
xSegments?: number;
|
|
12
|
+
/* Number of segments on the Z-axis. */
|
|
13
|
+
zSegments?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @desc Creates a plane-shaped {@link Geometry}.
|
|
18
|
+
*
|
|
19
|
+
* @param {buildPlaneGeometryConfiguration} [cfg] Configs
|
|
20
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
21
|
+
*/
|
|
22
|
+
export function buildPlaneGeometry(cfg: buildPlaneGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildSphereGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D point indicating the center position. */
|
|
7
|
+
center?: number[];
|
|
8
|
+
/* Radius. */
|
|
9
|
+
radius?: number;
|
|
10
|
+
/* Number of latitudinal bands. */
|
|
11
|
+
heightSegments?: number;
|
|
12
|
+
/* Number of longitudinal bands. */
|
|
13
|
+
widthSegments?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @desc Creates a sphere-shaped {@link Geometry}.
|
|
18
|
+
*
|
|
19
|
+
* @param {buildSphereGeometryConfiguration} [cfg] Configs
|
|
20
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
21
|
+
*/
|
|
22
|
+
export function buildSphereGeometry(cfg: buildSphereGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildTorusGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D point indicating the center position. */
|
|
7
|
+
center?: number[];
|
|
8
|
+
/* The overall radius. */
|
|
9
|
+
radius?: number;
|
|
10
|
+
/* The tube radius. */
|
|
11
|
+
tube?: number;
|
|
12
|
+
/* The number of radial segments. */
|
|
13
|
+
radialSegments?: number;
|
|
14
|
+
/* The number of tubular segments. */
|
|
15
|
+
tubeSegments?: number;
|
|
16
|
+
/* The length of the arc in radians, where Math.PI*2 is a closed torus. */
|
|
17
|
+
arc?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @desc Creates a torus-shaped {@link Geometry}.
|
|
22
|
+
*
|
|
23
|
+
* @param {buildTorusGeometryConfiguration} [cfg] Configs
|
|
24
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
25
|
+
*/
|
|
26
|
+
export function buildTorusGeometry(cfg: buildTorusGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Geometry } from "../Geometry";
|
|
2
|
+
|
|
3
|
+
export declare type buildVectorTextGeometryConfiguration = {
|
|
4
|
+
/* Optional ID for the {@link Geometry}, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/* 3D point indicating the center position. */
|
|
7
|
+
center?: number[];
|
|
8
|
+
/* 3D point indicating the top left corner. */
|
|
9
|
+
origin?: number[];
|
|
10
|
+
/* Size of each character. */
|
|
11
|
+
size?: number;
|
|
12
|
+
/* The text. */
|
|
13
|
+
text?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @desc Creates wireframe vector text {@link Geometry}.
|
|
18
|
+
*
|
|
19
|
+
* @param {buildVectorTextGeometryConfiguration} [cfg] Configs
|
|
20
|
+
* @returns {Object} Configuration for a {@link Geometry} subtype.
|
|
21
|
+
*/
|
|
22
|
+
export function buildVectorTextGeometry(cfg: buildVectorTextGeometryConfiguration): Geometry;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./buildBoxGeometry";
|
|
2
|
+
export * from "./buildBoxLinesGeometry";
|
|
3
|
+
export * from "./buildCylinderGeometry";
|
|
4
|
+
export * from "./buildGridGeometry";
|
|
5
|
+
export * from "./buildPlaneGeometry";
|
|
6
|
+
export * from "./buildSphereGeometry";
|
|
7
|
+
export * from "./buildTorusGeometry";
|
|
8
|
+
export * from "./buildVectorTextGeometry";
|
|
@@ -63,7 +63,7 @@ export declare class Scene extends Component {
|
|
|
63
63
|
* @param callback Called fired on the event
|
|
64
64
|
* @param scope Scope for the callback
|
|
65
65
|
*/
|
|
66
|
-
on(event: "objectVisibility", callback: (entity: VBOSceneModel | Mesh | Node) => void, scope?: any): string;
|
|
66
|
+
on(event: "objectVisibility" | "objectXRayed" | "objectHighlighted" | "objectSelected", callback: (entity: VBOSceneModel | Mesh | Node) => void, scope?: any): string;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Fired on each game loop iteration.
|