@xeokit/xeokit-sdk 2.4.0-alpha-105 → 2.4.0-alpha-106
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 +1 -1
- package/dist/xeokit-sdk.es.js +1 -1
- package/dist/xeokit-sdk.es5.js +1 -1
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
- package/src/viewer/scene/model/dtx/triangles/renderers/TrianglesDataTextureEdgesRenderer.js +1 -1
- package/src/viewer/scene/LineSet/LineSet.new.js +0 -160
- package/src/viewer/scene/model/MeshClusteringManager.js +0 -31
package/package.json
CHANGED
|
@@ -338,7 +338,7 @@ export class TrianglesDataTextureEdgesRenderer {
|
|
|
338
338
|
// get XYZ offset
|
|
339
339
|
src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
|
|
340
340
|
|
|
341
|
-
src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz
|
|
341
|
+
src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
|
|
342
342
|
|
|
343
343
|
src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");
|
|
344
344
|
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import {Component} from '../Component.js';
|
|
2
|
-
import {math} from "../math/math.js";
|
|
3
|
-
import {SceneModel} from "../model";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A set of 3D line segments.
|
|
7
|
-
*
|
|
8
|
-
* * Creates a set of 3D line segments.
|
|
9
|
-
* * Registered by {@link LineSet#id} in {@link Scene#lineSets}.
|
|
10
|
-
* * Configure color using the {@link LinesMaterial} located at {@link Scene#linesMaterial}.
|
|
11
|
-
* * {@link BCFViewpointsPlugin} will save and load Linesets in BCF viewpoints.
|
|
12
|
-
*
|
|
13
|
-
* ## Usage
|
|
14
|
-
*
|
|
15
|
-
* In the example below, we'll load the Schependomlaan model, then use
|
|
16
|
-
* a ````LineSet```` to show a grid underneath the model.
|
|
17
|
-
*
|
|
18
|
-
* [<img src="http://xeokit.github.io/xeokit-sdk/assets/images/LineSet_grid.png">](/examples/#LineSet_grid)
|
|
19
|
-
*
|
|
20
|
-
* [[Run this example](/examples/#LineSet_grid)]
|
|
21
|
-
*
|
|
22
|
-
* ````javascript
|
|
23
|
-
* import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
|
|
24
|
-
*
|
|
25
|
-
* const viewer = new Viewer({
|
|
26
|
-
* canvasId: "myCanvas",
|
|
27
|
-
* transparent: true
|
|
28
|
-
* });
|
|
29
|
-
*
|
|
30
|
-
* const camera = viewer.camera;
|
|
31
|
-
*
|
|
32
|
-
* viewer.camera.eye = [-2.56, 8.38, 8.27];
|
|
33
|
-
* viewer.camera.look = [13.44, 3.31, -14.83];
|
|
34
|
-
* viewer.camera.up = [0.10, 0.98, -0.14];
|
|
35
|
-
*
|
|
36
|
-
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
37
|
-
*
|
|
38
|
-
* const model = xktLoader.load({
|
|
39
|
-
* id: "myModel",
|
|
40
|
-
* src: "../assets/models/xkt/v8/ifc/Schependomlaan.ifc.xkt",
|
|
41
|
-
* position: [0,1,0],
|
|
42
|
-
* edges: true,
|
|
43
|
-
* saoEnabled: true
|
|
44
|
-
* });
|
|
45
|
-
*
|
|
46
|
-
* const geometryArrays = buildGridGeometry({
|
|
47
|
-
* size: 100,
|
|
48
|
-
* divisions: 30
|
|
49
|
-
* });
|
|
50
|
-
*
|
|
51
|
-
* new LineSet(viewer.scene, {
|
|
52
|
-
* positions: geometryArrays.positions,
|
|
53
|
-
* indices: geometryArrays.indices
|
|
54
|
-
* });
|
|
55
|
-
* ````
|
|
56
|
-
*/
|
|
57
|
-
class LineSet extends Component {
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Creates a new LineSet.
|
|
61
|
-
*
|
|
62
|
-
* Registers the LineSet in {@link Scene#lineSets}; causes Scene to fire a "lineSetCreated" event.
|
|
63
|
-
*
|
|
64
|
-
* @constructor
|
|
65
|
-
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this ````LineSet```` as well.
|
|
66
|
-
* @param {*} [cfg] ````LineSet```` configuration
|
|
67
|
-
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
68
|
-
* @param {Number[]} cfg.positions World-space 3D vertex positions.
|
|
69
|
-
* @param {Number[]} [cfg.indices] Indices to connect ````positions```` into line segments. Note that these are separate line segments, not a polyline.
|
|
70
|
-
* @param {Number[]} [cfg.color=[0,0,0]] The color of this ````LineSet````. This is both emissive and diffuse.
|
|
71
|
-
* @param {Boolean} [cfg.visible=true] Indicates whether or not this ````LineSet```` is visible.
|
|
72
|
-
* @param {Number} [cfg.opacity=1.0] ````LineSet````'s initial opacity factor.
|
|
73
|
-
*/
|
|
74
|
-
constructor(owner, cfg = {}) {
|
|
75
|
-
|
|
76
|
-
super(owner, cfg);
|
|
77
|
-
|
|
78
|
-
this._positions = cfg.positions || [];
|
|
79
|
-
|
|
80
|
-
this._origin = math.vec3(cfg.origin || [0, 0, 0]);
|
|
81
|
-
|
|
82
|
-
if (cfg.indices) {
|
|
83
|
-
this._indices = cfg.indices;
|
|
84
|
-
} else {
|
|
85
|
-
this._indices = [];
|
|
86
|
-
for (let i = 0, len = (this._positions.length / 3) - 1; i < len; i += 2) {
|
|
87
|
-
this._indices.push(i);
|
|
88
|
-
this._indices.push(i + 1);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
this._sceneModel = new SceneModel(this, { id: `${this.id}.lineset.scenemodel`});
|
|
92
|
-
this._sceneModel.createMesh({
|
|
93
|
-
id: `${this.id}.lineset.mesh`,
|
|
94
|
-
primitive: "lines",
|
|
95
|
-
positions: cfg.positions,
|
|
96
|
-
indices: cfg.indices,
|
|
97
|
-
color: cfg.color || [0, 0, 0],
|
|
98
|
-
clippable: false,
|
|
99
|
-
collidable: true
|
|
100
|
-
});
|
|
101
|
-
this._sceneModel.createEntity({
|
|
102
|
-
id: `${this.id}.lineset.entity`,
|
|
103
|
-
meshIds: [`${this.id}.lineset.mesh`]
|
|
104
|
-
});
|
|
105
|
-
this._sceneModel.finalize();
|
|
106
|
-
this.scene._lineSetCreated(this);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Sets if this ````LineSet```` is visible.
|
|
111
|
-
*
|
|
112
|
-
* Default value is ````true````.
|
|
113
|
-
*
|
|
114
|
-
* @param {Boolean} visible Set ````true```` to make this ````LineSet```` visible.
|
|
115
|
-
*/
|
|
116
|
-
set visible(visible) {
|
|
117
|
-
this._sceneModel.visible = visible;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Gets if this ````LineSet```` is visible.
|
|
122
|
-
*
|
|
123
|
-
* Default value is ````true````.
|
|
124
|
-
*
|
|
125
|
-
* @returns {Boolean} Returns ````true```` if visible.
|
|
126
|
-
*/
|
|
127
|
-
get visible() {
|
|
128
|
-
return this._sceneModel.visible;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Gets the 3D World-space vertex positions of the lines in this ````LineSet````.
|
|
133
|
-
*
|
|
134
|
-
* @returns {Number[]}
|
|
135
|
-
*/
|
|
136
|
-
get positions() {
|
|
137
|
-
return this._positions;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Gets the vertex indices of the lines in this ````LineSet````.
|
|
142
|
-
*
|
|
143
|
-
* @returns {Number[]}
|
|
144
|
-
*/
|
|
145
|
-
get indices() {
|
|
146
|
-
return this._indices;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Destroys this ````LineSet````.
|
|
151
|
-
*
|
|
152
|
-
* Removes the ```LineSet```` from {@link Scene#lineSets}; causes Scene to fire a "lineSetDestroyed" event.
|
|
153
|
-
*/
|
|
154
|
-
destroy() {
|
|
155
|
-
super.destroy();
|
|
156
|
-
this.scene._lineSetDestroyed(this);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export {LineSet};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export class MeshClusteringManager {
|
|
2
|
-
|
|
3
|
-
constructor(sceneModel) {
|
|
4
|
-
this.sceneModel = sceneModel;
|
|
5
|
-
this.meshes = [];
|
|
6
|
-
this.entities = [];
|
|
7
|
-
this.clusteredMeshes = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
addMeshCfg(meshCfg) {
|
|
11
|
-
this.meshes.push(meshCfg);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
addEntityCfg(entityCfg) {
|
|
15
|
-
this.entities.push(entityCfg);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
doClustering() {
|
|
19
|
-
this.clusteredMeshes = this.meshes;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
finalize() {
|
|
23
|
-
this.doClustering();
|
|
24
|
-
for (let i = 0, len = this.clusteredMeshes.length; i < len; i++) {
|
|
25
|
-
this.sceneModel.addMesh(this.clusteredMeshes[i]);
|
|
26
|
-
}
|
|
27
|
-
for (let i = 0, len = this.entities.length; i < len; i++) {
|
|
28
|
-
this.sceneModel.addEntity(this.entities[i]);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|