@xeokit/xeokit-sdk 2.3.0-beta-15 → 2.3.0-beta-16

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.
@@ -15999,22 +15999,6 @@ const Renderer = function (scene, options) {
15999
15999
  gl.depthMask(false);
16000
16000
  }
16001
16001
 
16002
- // Transparent X-ray edges
16003
-
16004
- if (xrayEdgesTransparentBinLen > 0) {
16005
- for (i = 0; i < xrayEdgesTransparentBinLen; i++) {
16006
- xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);
16007
- }
16008
- }
16009
-
16010
- // Transparent X-ray fill
16011
-
16012
- if (xrayedFillTransparentBinLen > 0) {
16013
- for (i = 0; i < xrayedFillTransparentBinLen; i++) {
16014
- xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);
16015
- }
16016
- }
16017
-
16018
16002
  // Transparent color edges
16019
16003
 
16020
16004
  if (normalFillTransparentBinLen > 0 || normalEdgesTransparentBinLen > 0) {
@@ -16035,6 +16019,23 @@ const Renderer = function (scene, options) {
16035
16019
  drawable.drawColorTransparent(frameCtx);
16036
16020
  }
16037
16021
  }
16022
+
16023
+ // Transparent X-ray edges
16024
+
16025
+ if (xrayEdgesTransparentBinLen > 0) {
16026
+ for (i = 0; i < xrayEdgesTransparentBinLen; i++) {
16027
+ xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);
16028
+ }
16029
+ }
16030
+
16031
+ // Transparent X-ray fill
16032
+
16033
+ if (xrayedFillTransparentBinLen > 0) {
16034
+ for (i = 0; i < xrayedFillTransparentBinLen; i++) {
16035
+ xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);
16036
+ }
16037
+ }
16038
+
16038
16039
  gl.disable(gl.BLEND);
16039
16040
  if (!alphaDepthMask) {
16040
16041
  gl.depthMask(true);
@@ -46506,29 +46507,29 @@ function transformAndOctEncodeNormals(worldNormalMatrix, normals, lenNormals, co
46506
46507
  function octEncodeNormals(normals) { // http://jcgt.org/published/0003/02/01/
46507
46508
  const lenNormals = normals.length;
46508
46509
  const compressedNormals = new Int8Array(lenNormals);
46509
- let oct, best, currentCos, bestCos;
46510
+ let oct, dec, best, currentCos, bestCos;
46510
46511
  for (let i = 0; i < lenNormals; i += 3) {
46511
46512
  // Test various combinations of ceil and floor to minimize rounding errors
46512
46513
  best = oct = octEncodeNormal(normals, i, "floor", "floor");
46513
- octDecodeVec2(oct);
46514
- currentCos = bestCos = dot(normals, i);
46514
+ dec = octDecodeVec2(oct);
46515
+ currentCos = bestCos = dot(normals, i, dec);
46515
46516
  oct = octEncodeNormal(normals, i, "ceil", "floor");
46516
- octDecodeVec2(oct);
46517
- currentCos = dot(normals, i);
46517
+ dec = octDecodeVec2(oct);
46518
+ currentCos = dot(normals, i, dec);
46518
46519
  if (currentCos > bestCos) {
46519
46520
  best = oct;
46520
46521
  bestCos = currentCos;
46521
46522
  }
46522
46523
  oct = octEncodeNormal(normals, i, "floor", "ceil");
46523
- octDecodeVec2(oct);
46524
- currentCos = dot(normals, i);
46524
+ dec = octDecodeVec2(oct);
46525
+ currentCos = dot(normals, i, dec);
46525
46526
  if (currentCos > bestCos) {
46526
46527
  best = oct;
46527
46528
  bestCos = currentCos;
46528
46529
  }
46529
46530
  oct = octEncodeNormal(normals, i, "ceil", "ceil");
46530
- octDecodeVec2(oct);
46531
- currentCos = dot(normals, i);
46531
+ dec = octDecodeVec2(oct);
46532
+ currentCos = dot(normals, i, dec);
46532
46533
  if (currentCos > bestCos) {
46533
46534
  best = oct;
46534
46535
  bestCos = currentCos;
@@ -46602,8 +46603,8 @@ function octDecodeVec2(oct) { // Decode an oct-encoded normal
46602
46603
  /**
46603
46604
  * @private
46604
46605
  */
46605
- function dot(p, vec3) { // Dot product of a normal in an array against a candidate decoding
46606
- return p[0] * vec3[0] + p[1] * vec3[1] + p[2] * vec3[2];
46606
+ function dot(array, i, vec3) {
46607
+ return array[i] * vec3[0] + array[i + 1] * vec3[1] + array[i + 2] * vec3[2];
46607
46608
  }
46608
46609
 
46609
46610
  const tempMat4$2 = math.mat4();
@@ -15995,22 +15995,6 @@ const Renderer = function (scene, options) {
15995
15995
  gl.depthMask(false);
15996
15996
  }
15997
15997
 
15998
- // Transparent X-ray edges
15999
-
16000
- if (xrayEdgesTransparentBinLen > 0) {
16001
- for (i = 0; i < xrayEdgesTransparentBinLen; i++) {
16002
- xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);
16003
- }
16004
- }
16005
-
16006
- // Transparent X-ray fill
16007
-
16008
- if (xrayedFillTransparentBinLen > 0) {
16009
- for (i = 0; i < xrayedFillTransparentBinLen; i++) {
16010
- xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);
16011
- }
16012
- }
16013
-
16014
15998
  // Transparent color edges
16015
15999
 
16016
16000
  if (normalFillTransparentBinLen > 0 || normalEdgesTransparentBinLen > 0) {
@@ -16031,6 +16015,23 @@ const Renderer = function (scene, options) {
16031
16015
  drawable.drawColorTransparent(frameCtx);
16032
16016
  }
16033
16017
  }
16018
+
16019
+ // Transparent X-ray edges
16020
+
16021
+ if (xrayEdgesTransparentBinLen > 0) {
16022
+ for (i = 0; i < xrayEdgesTransparentBinLen; i++) {
16023
+ xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);
16024
+ }
16025
+ }
16026
+
16027
+ // Transparent X-ray fill
16028
+
16029
+ if (xrayedFillTransparentBinLen > 0) {
16030
+ for (i = 0; i < xrayedFillTransparentBinLen; i++) {
16031
+ xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);
16032
+ }
16033
+ }
16034
+
16034
16035
  gl.disable(gl.BLEND);
16035
16036
  if (!alphaDepthMask) {
16036
16037
  gl.depthMask(true);
@@ -46502,29 +46503,29 @@ function transformAndOctEncodeNormals(worldNormalMatrix, normals, lenNormals, co
46502
46503
  function octEncodeNormals(normals) { // http://jcgt.org/published/0003/02/01/
46503
46504
  const lenNormals = normals.length;
46504
46505
  const compressedNormals = new Int8Array(lenNormals);
46505
- let oct, best, currentCos, bestCos;
46506
+ let oct, dec, best, currentCos, bestCos;
46506
46507
  for (let i = 0; i < lenNormals; i += 3) {
46507
46508
  // Test various combinations of ceil and floor to minimize rounding errors
46508
46509
  best = oct = octEncodeNormal(normals, i, "floor", "floor");
46509
- octDecodeVec2(oct);
46510
- currentCos = bestCos = dot(normals, i);
46510
+ dec = octDecodeVec2(oct);
46511
+ currentCos = bestCos = dot(normals, i, dec);
46511
46512
  oct = octEncodeNormal(normals, i, "ceil", "floor");
46512
- octDecodeVec2(oct);
46513
- currentCos = dot(normals, i);
46513
+ dec = octDecodeVec2(oct);
46514
+ currentCos = dot(normals, i, dec);
46514
46515
  if (currentCos > bestCos) {
46515
46516
  best = oct;
46516
46517
  bestCos = currentCos;
46517
46518
  }
46518
46519
  oct = octEncodeNormal(normals, i, "floor", "ceil");
46519
- octDecodeVec2(oct);
46520
- currentCos = dot(normals, i);
46520
+ dec = octDecodeVec2(oct);
46521
+ currentCos = dot(normals, i, dec);
46521
46522
  if (currentCos > bestCos) {
46522
46523
  best = oct;
46523
46524
  bestCos = currentCos;
46524
46525
  }
46525
46526
  oct = octEncodeNormal(normals, i, "ceil", "ceil");
46526
- octDecodeVec2(oct);
46527
- currentCos = dot(normals, i);
46527
+ dec = octDecodeVec2(oct);
46528
+ currentCos = dot(normals, i, dec);
46528
46529
  if (currentCos > bestCos) {
46529
46530
  best = oct;
46530
46531
  bestCos = currentCos;
@@ -46598,8 +46599,8 @@ function octDecodeVec2(oct) { // Decode an oct-encoded normal
46598
46599
  /**
46599
46600
  * @private
46600
46601
  */
46601
- function dot(p, vec3) { // Dot product of a normal in an array against a candidate decoding
46602
- return p[0] * vec3[0] + p[1] * vec3[1] + p[2] * vec3[2];
46602
+ function dot(array, i, vec3) {
46603
+ return array[i] * vec3[0] + array[i + 1] * vec3[1] + array[i + 2] * vec3[2];
46603
46604
  }
46604
46605
 
46605
46606
  const tempMat4$2 = math.mat4();