@xeokit/xeokit-sdk 2.6.77-slim-rc4 → 2.6.77

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.
@@ -36,6 +36,7 @@ const Renderer = function (scene, options) {
36
36
 
37
37
  let postSortDrawableList = [];
38
38
  let postCullDrawableList = [];
39
+ let uiDrawableList = [];
39
40
 
40
41
  let drawableListDirty = true;
41
42
  let stateSortDirty = true;
@@ -288,14 +289,20 @@ const Renderer = function (scene, options) {
288
289
 
289
290
  function cullDrawableList() {
290
291
  let lenDrawableList = 0;
292
+ let lenUiList = 0;
291
293
  for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
292
294
  const drawable = postSortDrawableList[i];
293
295
  drawable.rebuildRenderFlags();
294
296
  if (!drawable.renderFlags.culled) {
295
- postCullDrawableList[lenDrawableList++] = drawable;
297
+ if (drawable.isUI) {
298
+ uiDrawableList[lenUiList++] = drawable;
299
+ } else {
300
+ postCullDrawableList[lenDrawableList++] = drawable;
301
+ }
296
302
  }
297
303
  }
298
304
  postCullDrawableList.length = lenDrawableList;
305
+ uiDrawableList.length = lenUiList;
299
306
  }
300
307
 
301
308
  function draw(params) {
@@ -539,6 +546,8 @@ const Renderer = function (scene, options) {
539
546
  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
540
547
  }
541
548
 
549
+ const renderDrawables = function(drawables) {
550
+
542
551
  let normalDrawSAOBinLen = 0;
543
552
  let normalEdgesOpaqueBinLen = 0;
544
553
  let normalFillTransparentBinLen = 0;
@@ -562,10 +571,9 @@ const Renderer = function (scene, options) {
562
571
  //------------------------------------------------------------------------------------------------------
563
572
  // Render normal opaque solids, defer others to bins to render after
564
573
  //------------------------------------------------------------------------------------------------------
574
+ for (let i = 0, len = drawables.length; i < len; i++) {
565
575
 
566
- for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
567
-
568
- drawable = postCullDrawableList[i];
576
+ drawable = drawables[i];
569
577
 
570
578
  if (drawable.culled === true || drawable.visible === false) {
571
579
  continue;
@@ -863,6 +871,14 @@ const Renderer = function (scene, options) {
863
871
  gl.disable(gl.BLEND);
864
872
  }
865
873
 
874
+ };
875
+
876
+ renderDrawables(postCullDrawableList);
877
+ if (uiDrawableList.length > 0) {
878
+ gl.clear(gl.DEPTH_BUFFER_BIT);
879
+ renderDrawables(uiDrawableList);
880
+ }
881
+
866
882
  const endTime = Date.now();
867
883
  const frameStats = stats.frame;
868
884
 
@@ -1072,8 +1088,9 @@ const Renderer = function (scene, options) {
1072
1088
  const includeEntityIds = params.includeEntityIds;
1073
1089
  const excludeEntityIds = params.excludeEntityIds;
1074
1090
 
1075
- for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
1076
- const drawable = postCullDrawableList[i];
1091
+ const renderDrawables = function(drawables) {
1092
+ for (let i = 0, len = drawables.length; i < len; i++) {
1093
+ const drawable = drawables[i];
1077
1094
  if (drawable.culled === true || drawable.visible === false) {
1078
1095
  continue;
1079
1096
  }
@@ -1088,6 +1105,13 @@ const Renderer = function (scene, options) {
1088
1105
  }
1089
1106
  drawable.drawPickMesh(frameCtx);
1090
1107
  }
1108
+ };
1109
+
1110
+ renderDrawables(postCullDrawableList);
1111
+ if (uiDrawableList.length > 0) {
1112
+ gl.clear(gl.DEPTH_BUFFER_BIT);
1113
+ renderDrawables(uiDrawableList);
1114
+ }
1091
1115
 
1092
1116
  const pix = pickBuffer.read(0, 0);
1093
1117
  const pickID = pix[0] + (pix[1] << 8) + (pix[2] << 16) + (pix[3] << 24);
@@ -77,7 +77,7 @@ export declare class DotBIMLoaderPlugin extends Plugin {
77
77
  *
78
78
  * Default value is {@link DotBIMDefaultDataSource}, which loads via an XMLHttpRequest.
79
79
  *
80
- * @type {IXKTDefaultDataSource}
80
+ * @type {IDotBIMDefaultDataSource}
81
81
  */
82
82
  set dataSource(arg: IDotBIMDefaultDataSource);
83
83
 
@@ -86,7 +86,7 @@ export declare class DotBIMLoaderPlugin extends Plugin {
86
86
  *
87
87
  * Default value is {@link DotBIMDefaultDataSource}, which loads via an XMLHttpRequest.
88
88
  *
89
- * @type {IXKTDefaultDataSource}
89
+ * @type {IDotBIMDefaultDataSource}
90
90
  */
91
91
  get dataSource(): IDotBIMDefaultDataSource;
92
92
 
@@ -104,13 +104,6 @@ export declare class DotBIMLoaderPlugin extends Plugin {
104
104
  */
105
105
  get objectDefaults(): IFCObjectDefaults;
106
106
 
107
- /**
108
- * Loads a .BIM model from a file into this DotBIMLoaderPlugin's {@link Viewer}.
109
- *
110
- * @param {LoadBIMModel} params Loading parameters.
111
- * @returns {VBOSceneModel} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
112
- */
113
-
114
107
  /**
115
108
  * Loads a .BIM model from a file into this DotBIMLoaderPlugin's {@link Viewer}.
116
109
  *
@@ -0,0 +1,50 @@
1
+ import { Viewer } from "../../viewer";
2
+
3
+ export declare type TransformControlHandlers = {
4
+ /** Optional callback for translation change. */
5
+ onPosition?: (position: number[]) => void;
6
+
7
+ /** Optional callback for rotation change. */
8
+ onQuaternion?: (quaternion: number[]) => void;
9
+
10
+ /** Optional callback for screen scale change. */
11
+ onScreenScale?: (scale: number[]) => void;
12
+ };
13
+
14
+ /**
15
+ * TransformControl is a {@link Viewer} tool for interactive transformation manipulation.
16
+ */
17
+ export declare class TransformControl {
18
+ /**
19
+ * @constructor
20
+ * @param {Viewer} viewer The Viewer.
21
+ */
22
+ constructor(viewer: Viewer);
23
+
24
+ /**
25
+ * Destroys this TransformControl.
26
+ */
27
+ destroy(): void;
28
+
29
+ /**
30
+ * Sets handlers for user interactions.
31
+ * If not provided then TransformControl is not visible.
32
+ *
33
+ * @param {TransformControlHandlers} transformation handlers.
34
+ */
35
+ setHandlers(handlers?: TransformControlHandlers): void;
36
+
37
+ /**
38
+ * Sets the TransformControl's position.
39
+ *
40
+ * @param {number[]} position to set
41
+ */
42
+ setPosition(position: number[]): boolean;
43
+
44
+ /**
45
+ * Sets the TransformControl's quaternion.
46
+ *
47
+ * @param {number[]} quaternion to set
48
+ */
49
+ setQuaternion(quaternion: number[]): boolean;
50
+ }
@@ -0,0 +1 @@
1
+ export * from "./TransformControl";
@@ -14,6 +14,7 @@ export * from "./OBJLoaderPlugin";
14
14
  export * from "./SectionPlanesPlugin";
15
15
  export * from "./STLLoaderPlugin";
16
16
  export * from "./StoreyViewsPlugin";
17
+ export * from "./TransformControl";
17
18
  export * from "./TreeViewPlugin";
18
19
  export * from "./ViewCullPlugin";
19
20
  export * from "./XKTLoaderPlugin";