x_ite 16.0.4 → 16.1.0
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/LICENSES/CC-BY-4.0.txt +268 -0
- package/LICENSES/CC-BY-NC-4.0.txt +252 -0
- package/LICENSES/CC0-1.0.txt +105 -0
- package/README.md +7 -7
- package/dist/assets/components/AnnotationComponent.js +1 -1
- package/dist/assets/components/AnnotationComponent.min.js +1 -1
- package/dist/assets/components/CADGeometryComponent.js +1 -1
- package/dist/assets/components/CADGeometryComponent.min.js +1 -1
- package/dist/assets/components/CubeMapTexturingComponent.js +1 -1
- package/dist/assets/components/CubeMapTexturingComponent.min.js +1 -1
- package/dist/assets/components/DISComponent.js +1 -1
- package/dist/assets/components/DISComponent.min.js +1 -1
- package/dist/assets/components/EventUtilitiesComponent.js +1 -1
- package/dist/assets/components/EventUtilitiesComponent.min.js +1 -1
- package/dist/assets/components/GaussianSplatsComponent.js +3 -3
- package/dist/assets/components/GaussianSplatsComponent.min.js +2 -2
- package/dist/assets/components/Geometry2DComponent.js +1 -1
- package/dist/assets/components/Geometry2DComponent.min.js +1 -1
- package/dist/assets/components/Geometry3DComponent.js +1 -1
- package/dist/assets/components/Geometry3DComponent.min.js +1 -1
- package/dist/assets/components/GeospatialComponent.js +1 -1
- package/dist/assets/components/GeospatialComponent.min.js +1 -1
- package/dist/assets/components/HAnimComponent.js +1 -1
- package/dist/assets/components/HAnimComponent.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensorComponent.js +1 -1
- package/dist/assets/components/KeyDeviceSensorComponent.min.js +1 -1
- package/dist/assets/components/LayoutComponent.js +1 -3
- package/dist/assets/components/LayoutComponent.min.js +2 -2
- package/dist/assets/components/NURBSComponent.js +1 -1
- package/dist/assets/components/NURBSComponent.min.js +1 -1
- package/dist/assets/components/ParticleSystemsComponent.js +4 -3
- package/dist/assets/components/ParticleSystemsComponent.min.js +2 -2
- package/dist/assets/components/PickingComponent.js +1 -1
- package/dist/assets/components/PickingComponent.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysicsComponent.js +1 -1
- package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
- package/dist/assets/components/ScriptingComponent.js +1 -1
- package/dist/assets/components/ScriptingComponent.min.js +1 -1
- package/dist/assets/components/TextComponent.js +1 -1
- package/dist/assets/components/TextComponent.min.js +1 -1
- package/dist/assets/components/TextureProjectionComponent.js +6 -6
- package/dist/assets/components/TextureProjectionComponent.min.js +2 -2
- package/dist/assets/components/Texturing3DComponent.js +9 -9
- package/dist/assets/components/Texturing3DComponent.min.js +2 -2
- package/dist/assets/components/VolumeRenderingComponent.js +3 -5
- package/dist/assets/components/VolumeRenderingComponent.min.js +2 -2
- package/dist/assets/components/WebXRComponent.js +1 -1
- package/dist/assets/components/WebXRComponent.min.js +1 -1
- package/dist/assets/components/X_ITEComponent.js +1 -1
- package/dist/assets/components/X_ITEComponent.min.js +1 -1
- package/dist/assets/images/background-dark.svg +20 -0
- package/dist/assets/images/background-light.svg +20 -0
- package/dist/assets/lib/README.md +0 -1
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +8 -8
- package/dist/x_ite.js +710 -455
- package/dist/x_ite.min.js +2 -2
- package/dist/x_ite.min.mjs +2 -2
- package/dist/x_ite.mjs +710 -455
- package/dist/x_ite.zip +0 -0
- package/package.json +4 -4
package/dist/x_ite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v16.0
|
|
1
|
+
/* X_ITE v16.1.0 */
|
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
3
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
4
4
|
module.exports = factory();
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
return /******/ (() => { // webpackBootstrap
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/
|
|
15
|
+
/***/ 548
|
|
16
16
|
(module, exports) {
|
|
17
17
|
|
|
18
18
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
|
|
@@ -1017,7 +1017,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
1017
1017
|
|
|
1018
1018
|
/***/ },
|
|
1019
1019
|
|
|
1020
|
-
/***/
|
|
1020
|
+
/***/ 174
|
|
1021
1021
|
(module) {
|
|
1022
1022
|
|
|
1023
1023
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -2013,7 +2013,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
2013
2013
|
|
|
2014
2014
|
/***/ },
|
|
2015
2015
|
|
|
2016
|
-
/***/
|
|
2016
|
+
/***/ 246
|
|
2017
2017
|
(module) {
|
|
2018
2018
|
|
|
2019
2019
|
/**
|
|
@@ -18846,7 +18846,7 @@ const Legacy_default_ = Legacy;
|
|
|
18846
18846
|
|
|
18847
18847
|
/* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
|
|
18848
18848
|
;// ./src/x_ite/BROWSER_VERSION.js
|
|
18849
|
-
const BROWSER_VERSION_default_ = "16.0
|
|
18849
|
+
const BROWSER_VERSION_default_ = "16.1.0";
|
|
18850
18850
|
;
|
|
18851
18851
|
|
|
18852
18852
|
/* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
|
|
@@ -19974,17 +19974,22 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
|
|
|
19974
19974
|
this .intersectionObserver ?.disconnect ();
|
|
19975
19975
|
|
|
19976
19976
|
if (!autoUpdate .getValue ())
|
|
19977
|
+
{
|
|
19978
|
+
this .wasLive = undefined;
|
|
19977
19979
|
return;
|
|
19980
|
+
}
|
|
19978
19981
|
|
|
19979
19982
|
const
|
|
19980
19983
|
browser = this .getBrowser (),
|
|
19981
19984
|
element = browser .getElement ();
|
|
19982
19985
|
|
|
19986
|
+
this .wasLive ??= browser .isLive ();
|
|
19987
|
+
|
|
19983
19988
|
this .checkUpdateListener = () => this .checkUpdate ();
|
|
19984
19989
|
|
|
19985
19990
|
document .addEventListener ("visibilitychange", this .checkUpdateListener);
|
|
19986
19991
|
|
|
19987
|
-
this .intersectionObserver
|
|
19992
|
+
this .intersectionObserver = new IntersectionObserver (entries =>
|
|
19988
19993
|
{
|
|
19989
19994
|
this .isIntersecting = entries .some (entry => entry .isIntersecting);
|
|
19990
19995
|
|
|
@@ -19998,17 +20003,30 @@ Object .assign (Object .setPrototypeOf (BrowserOptions .prototype, Base_X3DBaseN
|
|
|
19998
20003
|
if (!this ._AutoUpdate .getValue ())
|
|
19999
20004
|
return;
|
|
20000
20005
|
|
|
20001
|
-
|
|
20006
|
+
if (this .isIntersecting === undefined)
|
|
20007
|
+
return;
|
|
20008
|
+
|
|
20009
|
+
const
|
|
20010
|
+
browser = this .getBrowser (),
|
|
20011
|
+
hidden = document .webkitHidden ?? document .hidden;
|
|
20012
|
+
|
|
20013
|
+
// 👆 Only webkitHidden is reliable in Electron.
|
|
20014
|
+
// https://github.com/electron/electron/issues/28677
|
|
20002
20015
|
|
|
20003
|
-
if ((!
|
|
20016
|
+
if ((!hidden && this .isIntersecting) || browser .getPose ())
|
|
20004
20017
|
{
|
|
20005
|
-
if (
|
|
20018
|
+
if (this .wasLive)
|
|
20006
20019
|
browser .beginUpdate ();
|
|
20020
|
+
|
|
20021
|
+
this .wasLive = undefined;
|
|
20007
20022
|
}
|
|
20008
20023
|
else
|
|
20009
20024
|
{
|
|
20010
|
-
|
|
20011
|
-
|
|
20025
|
+
// If this branch is processed a second time, ignore browser is live state,
|
|
20026
|
+
// because isLive is now false.
|
|
20027
|
+
this .wasLive ??= browser .isLive ();
|
|
20028
|
+
|
|
20029
|
+
browser .endUpdate ();
|
|
20012
20030
|
}
|
|
20013
20031
|
},
|
|
20014
20032
|
set_ContentScale__ (contentScale)
|
|
@@ -20467,7 +20485,7 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
|
|
|
20467
20485
|
layer .addEventListener ("mousedown", () => this .hide ());
|
|
20468
20486
|
layer .addEventListener ("contextmenu", () => this .hide ());
|
|
20469
20487
|
|
|
20470
|
-
root .
|
|
20488
|
+
root .append (layer);
|
|
20471
20489
|
|
|
20472
20490
|
this [_hide] = () =>
|
|
20473
20491
|
{
|
|
@@ -20496,16 +20514,16 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
|
|
|
20496
20514
|
|
|
20497
20515
|
ul .addEventListener ("contextmenu", () => this .hide ());
|
|
20498
20516
|
|
|
20499
|
-
root .
|
|
20517
|
+
root .append (ul);
|
|
20500
20518
|
|
|
20501
20519
|
const background = document .createElement ("div");
|
|
20502
20520
|
|
|
20503
20521
|
background .classList .add ("context-menu-background");
|
|
20504
20522
|
|
|
20505
|
-
ul .
|
|
20523
|
+
ul .append (background);
|
|
20506
20524
|
|
|
20507
20525
|
for (const k in menu .items)
|
|
20508
|
-
ul .
|
|
20526
|
+
ul .append (this .createItem (menu .items [k], "context-menu-root", k, level + 1));
|
|
20509
20527
|
|
|
20510
20528
|
// Show
|
|
20511
20529
|
// Must animate children because of blurish background.
|
|
@@ -20544,20 +20562,32 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
|
|
|
20544
20562
|
submenu .style .display = "block";
|
|
20545
20563
|
|
|
20546
20564
|
const
|
|
20547
|
-
width
|
|
20548
|
-
position
|
|
20565
|
+
width = submenu .clientWidth + ul .clientWidth,
|
|
20566
|
+
position = parentRect .left + width > window .innerWidth ? "right" : "left",
|
|
20567
|
+
windowHeight = (window .visualViewport ?.height ?? window .innerHeight);
|
|
20549
20568
|
|
|
20550
20569
|
// Background
|
|
20551
20570
|
submenu .children [0] .style .height = `${submenu .clientHeight}px`;
|
|
20552
20571
|
|
|
20553
20572
|
submenu .style [position] = `${ul .clientWidth - 28}px`;
|
|
20554
20573
|
|
|
20555
|
-
if (submenu .clientHeight >=
|
|
20574
|
+
if (submenu .clientHeight >= windowHeight)
|
|
20556
20575
|
{
|
|
20557
20576
|
submenu .style .top = `${-submenu .closest ("li") .getBoundingClientRect () .top}px`;
|
|
20558
|
-
submenu .style .maxHeight = "
|
|
20577
|
+
submenu .style .maxHeight = "100dvh";
|
|
20559
20578
|
submenu .style .overflowY = "scroll";
|
|
20560
20579
|
}
|
|
20580
|
+
else
|
|
20581
|
+
{
|
|
20582
|
+
// Submenu goes out of page.
|
|
20583
|
+
|
|
20584
|
+
const bottom = submenu .getBoundingClientRect () .top + submenu .clientHeight - (window .scrollY + windowHeight - 20);
|
|
20585
|
+
|
|
20586
|
+
if (bottom > 0)
|
|
20587
|
+
{
|
|
20588
|
+
this .offset (submenu, { top: submenu .getBoundingClientRect () .top - bottom });
|
|
20589
|
+
}
|
|
20590
|
+
}
|
|
20561
20591
|
|
|
20562
20592
|
submenu .style .display = "";
|
|
20563
20593
|
};
|
|
@@ -20903,7 +20933,6 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
|
|
|
20903
20933
|
callback: event =>
|
|
20904
20934
|
{
|
|
20905
20935
|
browser .setBrowserOption ("Timings", event .target .checked);
|
|
20906
|
-
browser .getSurface () .focus ();
|
|
20907
20936
|
},
|
|
20908
20937
|
},
|
|
20909
20938
|
"fullscreen": {
|
|
@@ -21148,7 +21177,6 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
|
|
|
21148
21177
|
callback: () =>
|
|
21149
21178
|
{
|
|
21150
21179
|
browser .bindViewpoint (browser .getActiveLayer (), viewpoint);
|
|
21151
|
-
browser .getSurface () .focus ();
|
|
21152
21180
|
},
|
|
21153
21181
|
};
|
|
21154
21182
|
}
|
|
@@ -21175,7 +21203,6 @@ Object .assign (Object .setPrototypeOf (ContextMenu .prototype, Base_X3DBaseNode
|
|
|
21175
21203
|
{
|
|
21176
21204
|
browser ._viewer = viewer;
|
|
21177
21205
|
browser .setDescription (gettext(this .getViewerName (viewer)));
|
|
21178
|
-
browser .getSurface () .focus ();
|
|
21179
21206
|
},
|
|
21180
21207
|
};
|
|
21181
21208
|
}
|
|
@@ -23775,7 +23802,7 @@ const X3DBBoxNode_default_ = X3DBBoxNode;
|
|
|
23775
23802
|
|
|
23776
23803
|
|
|
23777
23804
|
|
|
23778
|
-
function X3DBoundedObject (executionContext)
|
|
23805
|
+
function X3DBoundedObject (/* executionContext */)
|
|
23779
23806
|
{
|
|
23780
23807
|
this .addType (Base_X3DConstants .X3DBoundedObject);
|
|
23781
23808
|
|
|
@@ -30339,8 +30366,8 @@ Object .assign (Object .setPrototypeOf (JSONParser .prototype, Parser_X3DParser
|
|
|
30339
30366
|
createCDATA (document, element, str)
|
|
30340
30367
|
{
|
|
30341
30368
|
const
|
|
30342
|
-
|
|
30343
|
-
cdata =
|
|
30369
|
+
root = helper.parseXML ("<xml></xml>",),
|
|
30370
|
+
cdata = root .createCDATASection (str);
|
|
30344
30371
|
|
|
30345
30372
|
element .append (cdata);
|
|
30346
30373
|
},
|
|
@@ -30385,7 +30412,6 @@ Object .assign (Object .setPrototypeOf (JSONParser .prototype, Parser_X3DParser
|
|
|
30385
30412
|
this .convertToDOM (object [key] [childkey], childkey, child);
|
|
30386
30413
|
|
|
30387
30414
|
element .append (child);
|
|
30388
|
-
element .append (document .createTextNode ("\n"));
|
|
30389
30415
|
}
|
|
30390
30416
|
}
|
|
30391
30417
|
}
|
|
@@ -30396,7 +30422,6 @@ Object .assign (Object .setPrototypeOf (JSONParser .prototype, Parser_X3DParser
|
|
|
30396
30422
|
this .convertToDOM (object [key], key, child);
|
|
30397
30423
|
|
|
30398
30424
|
element .append (child);
|
|
30399
|
-
element .append (document .createTextNode ("\n"));
|
|
30400
30425
|
}
|
|
30401
30426
|
}
|
|
30402
30427
|
},
|
|
@@ -31133,7 +31158,7 @@ const Plane3_default_ = Plane3;
|
|
|
31133
31158
|
|
|
31134
31159
|
/* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
|
|
31135
31160
|
;// ./src/standard/Math/Geometry/Triangle3.js
|
|
31136
|
-
/* provided dependency */ var libtess = __webpack_require__(
|
|
31161
|
+
/* provided dependency */ var libtess = __webpack_require__(246);
|
|
31137
31162
|
|
|
31138
31163
|
|
|
31139
31164
|
const Triangle3 =
|
|
@@ -32659,6 +32684,7 @@ Object .assign (X3DRenderObject .prototype,
|
|
|
32659
32684
|
projectionMatrix = new Numbers_Matrix4 (),
|
|
32660
32685
|
viewProjectionMatrix = new Numbers_Matrix4 (),
|
|
32661
32686
|
viewMatrix = new Numbers_Matrix4 (),
|
|
32687
|
+
userPosition = new Numbers_Vector3 (),
|
|
32662
32688
|
localOrientation = new Numbers_Rotation4 (),
|
|
32663
32689
|
rotation = new Numbers_Rotation4 ();
|
|
32664
32690
|
|
|
@@ -32703,7 +32729,7 @@ Object .assign (X3DRenderObject .prototype,
|
|
|
32703
32729
|
|
|
32704
32730
|
viewMatrix
|
|
32705
32731
|
.assign (viewpointNode .getModelMatrix ())
|
|
32706
|
-
.translate (viewpointNode .getUserPosition ())
|
|
32732
|
+
.translate (viewpointNode .getUserPosition (userPosition))
|
|
32707
32733
|
.rotate (rotation)
|
|
32708
32734
|
.inverse ()
|
|
32709
32735
|
.multLeft (viewpointNode .getCameraSpaceMatrix ());
|
|
@@ -33173,6 +33199,7 @@ Object .assign (X3DRenderObject .prototype,
|
|
|
33173
33199
|
const
|
|
33174
33200
|
projectionMatrix = new Numbers_Matrix4 (),
|
|
33175
33201
|
viewProjectionMatrix = new Numbers_Matrix4 (),
|
|
33202
|
+
userPosition = new Numbers_Vector3 (),
|
|
33176
33203
|
translation = new Numbers_Vector3 (),
|
|
33177
33204
|
rotation = new Numbers_Rotation4 ();
|
|
33178
33205
|
|
|
@@ -33220,7 +33247,7 @@ Object .assign (X3DRenderObject .prototype,
|
|
|
33220
33247
|
|
|
33221
33248
|
viewProjectionMatrix
|
|
33222
33249
|
.assign (viewpointNode .getModelMatrix ())
|
|
33223
|
-
.translate (viewpointNode .getUserPosition ())
|
|
33250
|
+
.translate (viewpointNode .getUserPosition (userPosition))
|
|
33224
33251
|
.rotate (down)
|
|
33225
33252
|
.inverse ()
|
|
33226
33253
|
.multRight (projectionMatrix)
|
|
@@ -38080,7 +38107,6 @@ const Background_default_ = Background;
|
|
|
38080
38107
|
|
|
38081
38108
|
|
|
38082
38109
|
|
|
38083
|
-
|
|
38084
38110
|
function X3DLayerNode (executionContext, defaultViewpoint, groupNode)
|
|
38085
38111
|
{
|
|
38086
38112
|
Core_X3DNode .call (this, executionContext);
|
|
@@ -38284,16 +38310,13 @@ Object .assign (Object .setPrototypeOf (X3DLayerNode .prototype, Core_X3DNode .p
|
|
|
38284
38310
|
{
|
|
38285
38311
|
return this .viewpointStack;
|
|
38286
38312
|
},
|
|
38287
|
-
viewAll (transitionTime
|
|
38313
|
+
viewAll ({ transitionTime, factor, straighten })
|
|
38288
38314
|
{
|
|
38289
38315
|
const
|
|
38290
38316
|
viewpointNode = this .getViewpoint (),
|
|
38291
|
-
bbox = this .getBBox (new Geometry_Box3 ())
|
|
38317
|
+
bbox = this .getBBox (new Geometry_Box3 ());
|
|
38292
38318
|
|
|
38293
|
-
|
|
38294
|
-
return;
|
|
38295
|
-
|
|
38296
|
-
viewpointNode .lookAt (this, bbox .center, viewpointNode .getLookAtDistance (bbox), transitionTime, factor, straighten);
|
|
38319
|
+
viewpointNode .lookAtBBox ({ layerNode: this, bbox, transitionTime, factor, straighten });
|
|
38297
38320
|
},
|
|
38298
38321
|
straightenView ()
|
|
38299
38322
|
{
|
|
@@ -38353,7 +38376,7 @@ Object .assign (Object .setPrototypeOf (X3DLayerNode .prototype, Core_X3DNode .p
|
|
|
38353
38376
|
viewpointNode .resetUserOffsets ();
|
|
38354
38377
|
|
|
38355
38378
|
if (viewpointNode ._viewAll .getValue ())
|
|
38356
|
-
viewpointNode .viewAll (this .getBBox (new Geometry_Box3 ()));
|
|
38379
|
+
viewpointNode .viewAll (this, this .getBBox (new Geometry_Box3 ()));
|
|
38357
38380
|
|
|
38358
38381
|
viewpointNode .update ();
|
|
38359
38382
|
},
|
|
@@ -38987,7 +39010,7 @@ Object .assign (Object .setPrototypeOf (TimeSensor .prototype, Core_X3DSensorNod
|
|
|
38987
39010
|
this ._cycleTime = time;
|
|
38988
39011
|
this ._fraction_changed = this .fraction;
|
|
38989
39012
|
},
|
|
38990
|
-
set_resume (pauseInterval)
|
|
39013
|
+
set_resume (/* pauseInterval */)
|
|
38991
39014
|
{
|
|
38992
39015
|
this .setRange (this .fraction, this ._range [1], this ._range [2], false);
|
|
38993
39016
|
},
|
|
@@ -39490,13 +39513,10 @@ function X3DViewpointNode (executionContext)
|
|
|
39490
39513
|
|
|
39491
39514
|
// Private properties
|
|
39492
39515
|
|
|
39493
|
-
this .descriptions
|
|
39494
|
-
this .
|
|
39495
|
-
this .
|
|
39496
|
-
this .
|
|
39497
|
-
this .modelMatrix = new Numbers_Matrix4 ();
|
|
39498
|
-
this .cameraSpaceMatrix = new Numbers_Matrix4 (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1);
|
|
39499
|
-
this .viewMatrix = new Numbers_Matrix4 (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -10, 1);
|
|
39516
|
+
this .descriptions = [ ];
|
|
39517
|
+
this .modelMatrix = new Numbers_Matrix4 ();
|
|
39518
|
+
this .cameraSpaceMatrix = new Numbers_Matrix4 (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 10, 1);
|
|
39519
|
+
this .viewMatrix = new Numbers_Matrix4 (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -10, 1);
|
|
39500
39520
|
|
|
39501
39521
|
const
|
|
39502
39522
|
browser = this .getBrowser (),
|
|
@@ -39644,36 +39664,52 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39644
39664
|
{
|
|
39645
39665
|
this ._centerOfRotation = value;
|
|
39646
39666
|
},
|
|
39647
|
-
getUserPosition ()
|
|
39667
|
+
getUserPosition (value = new Numbers_Vector3 ())
|
|
39648
39668
|
{
|
|
39649
|
-
return
|
|
39669
|
+
return value .assign (this .getPosition ())
|
|
39650
39670
|
.add (this ._positionOffset .getValue ());
|
|
39651
39671
|
},
|
|
39652
|
-
setUserPosition (
|
|
39672
|
+
setUserPosition: (() =>
|
|
39653
39673
|
{
|
|
39654
|
-
|
|
39655
|
-
|
|
39656
|
-
|
|
39657
|
-
|
|
39674
|
+
const positionOffset = new Numbers_Vector3 ();
|
|
39675
|
+
|
|
39676
|
+
return function (value)
|
|
39677
|
+
{
|
|
39678
|
+
this ._positionOffset = positionOffset .assign (value)
|
|
39679
|
+
.subtract (this .getPosition ());
|
|
39680
|
+
};
|
|
39681
|
+
})(),
|
|
39682
|
+
getUserOrientation (value = new Numbers_Rotation4 ())
|
|
39658
39683
|
{
|
|
39659
|
-
return
|
|
39684
|
+
return value .assign (this .getOrientation ())
|
|
39660
39685
|
.multRight (this ._orientationOffset .getValue ());
|
|
39661
39686
|
},
|
|
39662
|
-
setUserOrientation (
|
|
39687
|
+
setUserOrientation: (() =>
|
|
39663
39688
|
{
|
|
39664
|
-
|
|
39665
|
-
|
|
39666
|
-
|
|
39667
|
-
|
|
39689
|
+
const orientationOffset = new Numbers_Rotation4 ();
|
|
39690
|
+
|
|
39691
|
+
return function (value)
|
|
39692
|
+
{
|
|
39693
|
+
this ._orientationOffset = orientationOffset .assign (this .getOrientation ())
|
|
39694
|
+
.inverse ()
|
|
39695
|
+
.multRight (value);
|
|
39696
|
+
};
|
|
39697
|
+
})(),
|
|
39698
|
+
getUserCenterOfRotation (value = new Numbers_Vector3 ())
|
|
39668
39699
|
{
|
|
39669
|
-
return
|
|
39700
|
+
return value .assign (this .getCenterOfRotation ())
|
|
39670
39701
|
.add (this ._centerOfRotationOffset .getValue ());
|
|
39671
39702
|
},
|
|
39672
|
-
setUserCenterOfRotation (
|
|
39703
|
+
setUserCenterOfRotation: (() =>
|
|
39673
39704
|
{
|
|
39674
|
-
|
|
39675
|
-
|
|
39676
|
-
|
|
39705
|
+
const centerOfRotationOffset = new Numbers_Vector3 ();
|
|
39706
|
+
|
|
39707
|
+
return function (value)
|
|
39708
|
+
{
|
|
39709
|
+
this ._centerOfRotationOffset = centerOfRotationOffset .assign (value)
|
|
39710
|
+
.subtract (this .getCenterOfRotation ());
|
|
39711
|
+
};
|
|
39712
|
+
})(),
|
|
39677
39713
|
getFieldOfViewScale ()
|
|
39678
39714
|
{
|
|
39679
39715
|
return this ._fieldOfViewScale .getValue ();
|
|
@@ -39684,7 +39720,7 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39684
39720
|
},
|
|
39685
39721
|
getNearDistance (navigationInfoNode)
|
|
39686
39722
|
{
|
|
39687
|
-
return this .nearDistance ?? navigationInfoNode
|
|
39723
|
+
return this .nearDistance ?? navigationInfoNode .getNearValue ();
|
|
39688
39724
|
},
|
|
39689
39725
|
setNearDistance (value)
|
|
39690
39726
|
{
|
|
@@ -39692,8 +39728,7 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39692
39728
|
},
|
|
39693
39729
|
getFarDistance (navigationInfoNode)
|
|
39694
39730
|
{
|
|
39695
|
-
return this .farDistance
|
|
39696
|
-
?? (navigationInfoNode ? navigationInfoNode .getFarValue () || this .getMaxFarValue () : undefined);
|
|
39731
|
+
return this .farDistance ?? (navigationInfoNode .getFarValue () || this .getMaxFarValue ());
|
|
39697
39732
|
},
|
|
39698
39733
|
setFarDistance (value)
|
|
39699
39734
|
{
|
|
@@ -39765,7 +39800,7 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39765
39800
|
this .resetUserOffsets ();
|
|
39766
39801
|
|
|
39767
39802
|
if (this ._viewAll .getValue ())
|
|
39768
|
-
this .viewAll (layerNode .getBBox (new Geometry_Box3 ()));
|
|
39803
|
+
this .viewAll (layerNode, layerNode .getBBox (new Geometry_Box3 ()));
|
|
39769
39804
|
|
|
39770
39805
|
// Handle NavigationInfo.
|
|
39771
39806
|
|
|
@@ -39869,6 +39904,8 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39869
39904
|
|
|
39870
39905
|
this .set_nearDistance__ ();
|
|
39871
39906
|
this .set_farDistance__ ();
|
|
39907
|
+
|
|
39908
|
+
this .update ();
|
|
39872
39909
|
},
|
|
39873
39910
|
getRelativeTransformation: (() =>
|
|
39874
39911
|
{
|
|
@@ -39918,38 +39955,32 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39918
39955
|
return r;
|
|
39919
39956
|
};
|
|
39920
39957
|
})(),
|
|
39921
|
-
lookAtPoint (layerNode, point, transitionTime = 1, factor = 1, straighten = false)
|
|
39958
|
+
lookAtPoint ({ layerNode, point, transitionTime = 1, factor = 1, straighten = false })
|
|
39922
39959
|
{
|
|
39923
39960
|
this .getCameraSpaceMatrix () .multVecMatrix (point);
|
|
39924
39961
|
this .getModelMatrix () .copy () .inverse () .multVecMatrix (point);
|
|
39925
39962
|
|
|
39926
|
-
this .lookAt (layerNode, point, 0.5, transitionTime, factor, straighten);
|
|
39963
|
+
this .lookAt ({ layerNode, point, distance: 0.5, transitionTime, factor, straighten });
|
|
39927
39964
|
},
|
|
39928
|
-
lookAtBBox (layerNode, bbox, transitionTime
|
|
39965
|
+
lookAtBBox ({ layerNode, bbox, transitionTime, factor, straighten })
|
|
39929
39966
|
{
|
|
39930
39967
|
if (bbox .size .equals (Numbers_Vector3 .ZERO))
|
|
39931
39968
|
return;
|
|
39932
39969
|
|
|
39933
|
-
|
|
39970
|
+
const
|
|
39971
|
+
point = bbox .copy () .multRight (this .getModelMatrix () .copy () .inverse ()) .center .copy (),
|
|
39972
|
+
localBBox = bbox .copy () .multRight (this .getViewMatrix ()),
|
|
39973
|
+
distance = this .getLookAtDistance (layerNode, localBBox);
|
|
39934
39974
|
|
|
39935
|
-
this .lookAt (layerNode,
|
|
39975
|
+
this .lookAt ({ layerNode, point, distance, transitionTime, factor, straighten });
|
|
39976
|
+
|
|
39977
|
+
return localBBox;
|
|
39936
39978
|
},
|
|
39937
|
-
lookAt (layerNode, point, distance, transitionTime = 1, factor = 1, straighten = false)
|
|
39979
|
+
lookAt ({ layerNode, point, distance, transitionTime = 1, factor = 1, straighten = false })
|
|
39938
39980
|
{
|
|
39939
39981
|
this .timeSensor ._description = "lookAt";
|
|
39940
39982
|
|
|
39941
|
-
const
|
|
39942
|
-
offset = point .copy () .add (this .getUserOrientation () .multVecRot (new Numbers_Vector3 (0, 0, distance))) .subtract (this .getPosition ());
|
|
39943
|
-
|
|
39944
|
-
layerNode .getNavigationInfo () ._transitionStart = true;
|
|
39945
|
-
|
|
39946
|
-
this .timeSensor ._cycleInterval = transitionTime;
|
|
39947
|
-
this .timeSensor ._stopTime = Date .now () / 1000;
|
|
39948
|
-
this .timeSensor ._startTime = Date .now () / 1000;
|
|
39949
|
-
|
|
39950
|
-
this .timeSensor ._isActive .addInterest ("set_active__", this, layerNode .getNavigationInfo ());
|
|
39951
|
-
|
|
39952
|
-
this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (0, 1), new x_ite_Fields .SFVec2f (1, 0));
|
|
39983
|
+
const offset = point .copy () .add (this .getUserOrientation () .multVecRot (new Numbers_Vector3 (0, 0, distance))) .subtract (this .getPosition ());
|
|
39953
39984
|
|
|
39954
39985
|
const
|
|
39955
39986
|
translation = this ._positionOffset .getValue () .copy () .lerp (offset, factor),
|
|
@@ -39962,25 +39993,34 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39962
39993
|
rotation = this .getOrientation () .copy () .inverse () .multRight (this .straightenHorizon (this .getOrientation () .copy () .multRight (rotation)));
|
|
39963
39994
|
}
|
|
39964
39995
|
|
|
39996
|
+
layerNode .getNavigationInfo () ._transitionStart = true;
|
|
39997
|
+
|
|
39998
|
+
this .timeSensor ._cycleInterval = transitionTime;
|
|
39999
|
+
this .timeSensor ._stopTime = Date .now () / 1000;
|
|
40000
|
+
this .timeSensor ._startTime = Date .now () / 1000;
|
|
40001
|
+
|
|
40002
|
+
this .timeSensor ._isActive .addInterest ("set_active__", this, layerNode .getNavigationInfo ());
|
|
40003
|
+
|
|
40004
|
+
this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (0, 1), new x_ite_Fields .SFVec2f (1, 0));
|
|
40005
|
+
|
|
39965
40006
|
this .positionInterpolator ._keyValue = new x_ite_Fields .MFVec3f (this ._positionOffset, translation);
|
|
39966
40007
|
this .orientationInterpolator ._keyValue = new x_ite_Fields .MFRotation (this ._orientationOffset, rotation);
|
|
39967
40008
|
this .scaleInterpolator ._keyValue = new x_ite_Fields .MFVec3f (this ._scaleOffset, Numbers_Vector3 .ONE);
|
|
39968
40009
|
this .scaleOrientationInterpolator ._keyValue = new x_ite_Fields .MFRotation (this ._scaleOrientationOffset, this ._scaleOrientationOffset);
|
|
39969
40010
|
|
|
39970
|
-
const relative = this .getRelativeTransformation (this);
|
|
39971
|
-
|
|
39972
|
-
this ._fieldOfViewScale = 1;
|
|
39973
40011
|
this ._centerOfRotationOffset = point .copy () .subtract (this .getCenterOfRotation ());
|
|
39974
40012
|
this .nearDistance = distance * (0.125 / 10);
|
|
39975
40013
|
this .farDistance = this .nearDistance * this .getMaxFarValue () / 0.125;
|
|
39976
40014
|
|
|
39977
|
-
this .setInterpolators (this,
|
|
40015
|
+
this .setInterpolators (this, this .getRelativeTransformation (this));
|
|
39978
40016
|
},
|
|
39979
40017
|
straightenView (layerNode)
|
|
39980
40018
|
{
|
|
39981
40019
|
if (this .checkTransition ("straightenView"))
|
|
39982
40020
|
return;
|
|
39983
40021
|
|
|
40022
|
+
const rotation = this .getOrientation () .copy () .inverse () .multRight (this .straightenHorizon (this .getUserOrientation ()));
|
|
40023
|
+
|
|
39984
40024
|
layerNode .getNavigationInfo () ._transitionStart = true;
|
|
39985
40025
|
|
|
39986
40026
|
this .timeSensor ._cycleInterval = 1;
|
|
@@ -39991,26 +40031,20 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
39991
40031
|
|
|
39992
40032
|
this .easeInEaseOut ._easeInEaseOut = new x_ite_Fields .MFVec2f (new x_ite_Fields .SFVec2f (0, 1), new x_ite_Fields .SFVec2f (1, 0));
|
|
39993
40033
|
|
|
39994
|
-
const rotation = this .getOrientation () .copy () .inverse () .multRight (this .straightenHorizon (this .getUserOrientation ()));
|
|
39995
|
-
|
|
39996
40034
|
this .positionInterpolator ._keyValue = new x_ite_Fields .MFVec3f (this ._positionOffset, this ._positionOffset);
|
|
39997
40035
|
this .orientationInterpolator ._keyValue = new x_ite_Fields .MFRotation (this ._orientationOffset, rotation);
|
|
39998
40036
|
this .scaleInterpolator ._keyValue = new x_ite_Fields .MFVec3f (this ._scaleOffset, this ._scaleOffset);
|
|
39999
40037
|
this .scaleOrientationInterpolator ._keyValue = new x_ite_Fields .MFRotation (this ._scaleOrientationOffset, this ._scaleOrientationOffset);
|
|
40000
40038
|
|
|
40001
|
-
|
|
40002
|
-
|
|
40003
|
-
this ._fieldOfViewScale = 1;
|
|
40004
|
-
|
|
40005
|
-
this .setInterpolators (this, relative);
|
|
40039
|
+
this .setInterpolators (this, this .getRelativeTransformation (this));
|
|
40006
40040
|
},
|
|
40007
40041
|
straightenHorizon (orientation, upVector = this .getUpVector (true))
|
|
40008
40042
|
{
|
|
40009
40043
|
return orientation .straighten (upVector);
|
|
40010
40044
|
},
|
|
40011
|
-
viewAll (bbox)
|
|
40045
|
+
viewAll (layerNode, bbox)
|
|
40012
40046
|
{
|
|
40013
|
-
bbox .copy () .multRight (this .
|
|
40047
|
+
const center = bbox .copy () .multRight (this .getModelMatrix () .copy () .inverse ()) .center .copy ();
|
|
40014
40048
|
|
|
40015
40049
|
if (bbox .size .equals (Numbers_Vector3 .ZERO))
|
|
40016
40050
|
{
|
|
@@ -40020,17 +40054,20 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
40020
40054
|
else
|
|
40021
40055
|
{
|
|
40022
40056
|
const
|
|
40023
|
-
|
|
40024
|
-
|
|
40025
|
-
|
|
40026
|
-
|
|
40057
|
+
localBBox = bbox .copy () .multRight (this .getViewMatrix ()),
|
|
40058
|
+
direction = this .getUserPosition () .subtract (center) .normalize (),
|
|
40059
|
+
distance = this .getLookAtDistance (layerNode, localBBox),
|
|
40060
|
+
userPosition = center .copy () .add (direction .multiply (distance)),
|
|
40061
|
+
userOrientation = this .getLookAtRotation (userPosition, center);
|
|
40027
40062
|
|
|
40028
40063
|
this ._positionOffset = userPosition .subtract (this .getPosition ());
|
|
40029
40064
|
this ._orientationOffset = this .getOrientation () .copy () .inverse () .multRight (userOrientation);
|
|
40030
|
-
this ._centerOfRotationOffset =
|
|
40065
|
+
this ._centerOfRotationOffset = center .copy () .subtract (this .getCenterOfRotation ());
|
|
40031
40066
|
this ._fieldOfViewScale = 1;
|
|
40032
40067
|
this .nearDistance = distance * (0.125 / 10);
|
|
40033
40068
|
this .farDistance = this .nearDistance * this .getMaxFarValue () / 0.125;
|
|
40069
|
+
|
|
40070
|
+
return localBBox;
|
|
40034
40071
|
}
|
|
40035
40072
|
},
|
|
40036
40073
|
traverse (type, renderObject)
|
|
@@ -40067,17 +40104,24 @@ Object .assign (Object .setPrototypeOf (X3DViewpointNode .prototype, Core_X3DBin
|
|
|
40067
40104
|
|
|
40068
40105
|
this .modelMatrix .assign (renderObject .getModelViewMatrix () .get ());
|
|
40069
40106
|
},
|
|
40070
|
-
update ()
|
|
40107
|
+
update: (() =>
|
|
40071
40108
|
{
|
|
40072
|
-
|
|
40073
|
-
|
|
40074
|
-
|
|
40075
|
-
|
|
40109
|
+
const
|
|
40110
|
+
userPosition = new Numbers_Vector3 (),
|
|
40111
|
+
userOrientation = new Numbers_Rotation4 ();
|
|
40112
|
+
|
|
40113
|
+
return function ()
|
|
40114
|
+
{
|
|
40115
|
+
this .cameraSpaceMatrix .setTransform (this .getUserPosition (userPosition),
|
|
40116
|
+
this .getUserOrientation (userOrientation),
|
|
40117
|
+
this ._scaleOffset .getValue (),
|
|
40118
|
+
this ._scaleOrientationOffset .getValue ());
|
|
40076
40119
|
|
|
40077
|
-
|
|
40120
|
+
this .cameraSpaceMatrix .multRight (this .modelMatrix);
|
|
40078
40121
|
|
|
40079
|
-
|
|
40080
|
-
|
|
40122
|
+
this .viewMatrix .assign (this .cameraSpaceMatrix) .inverse ();
|
|
40123
|
+
};
|
|
40124
|
+
})()
|
|
40081
40125
|
});
|
|
40082
40126
|
|
|
40083
40127
|
Object .defineProperties (X3DViewpointNode, Core_X3DNode .getStaticProperties ("X3DViewpointNode", "Navigation", 1));
|
|
@@ -40097,6 +40141,8 @@ const X3DViewpointNode_default_ = X3DViewpointNode;
|
|
|
40097
40141
|
|
|
40098
40142
|
|
|
40099
40143
|
|
|
40144
|
+
const VIEW_ALL_SCALE_FACTOR = 1.1;
|
|
40145
|
+
|
|
40100
40146
|
function Viewpoint (executionContext)
|
|
40101
40147
|
{
|
|
40102
40148
|
Navigation_X3DViewpointNode .call (this, executionContext);
|
|
@@ -40131,15 +40177,15 @@ Object .assign (Object .setPrototypeOf (Viewpoint .prototype, Navigation_X3DView
|
|
|
40131
40177
|
{
|
|
40132
40178
|
const scale = relative .fieldOfView / this .getUserFieldOfView ();
|
|
40133
40179
|
|
|
40134
|
-
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (scale,
|
|
40180
|
+
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (scale, 1);
|
|
40135
40181
|
|
|
40136
40182
|
this ._fieldOfViewScale = scale;
|
|
40137
40183
|
}
|
|
40138
40184
|
else
|
|
40139
40185
|
{
|
|
40140
|
-
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (
|
|
40186
|
+
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (1, 1);
|
|
40141
40187
|
|
|
40142
|
-
this ._fieldOfViewScale =
|
|
40188
|
+
this ._fieldOfViewScale = 1;
|
|
40143
40189
|
}
|
|
40144
40190
|
},
|
|
40145
40191
|
getLogarithmicDepthBuffer ()
|
|
@@ -40198,17 +40244,38 @@ Object .assign (Object .setPrototypeOf (Viewpoint .prototype, Navigation_X3DView
|
|
|
40198
40244
|
width = viewport [2],
|
|
40199
40245
|
height = viewport [3],
|
|
40200
40246
|
size = nearValue * Math .tan (this .getUserFieldOfView () / 2) * 2,
|
|
40201
|
-
|
|
40247
|
+
ratio = width / height;
|
|
40202
40248
|
|
|
40203
|
-
if (
|
|
40204
|
-
return viewportSize .set (size *
|
|
40249
|
+
if (ratio > 1)
|
|
40250
|
+
return viewportSize .set (size * ratio, size);
|
|
40205
40251
|
|
|
40206
|
-
return viewportSize .set (size, size /
|
|
40252
|
+
return viewportSize .set (size, size / ratio);
|
|
40207
40253
|
};
|
|
40208
40254
|
})(),
|
|
40209
|
-
getLookAtDistance (bbox)
|
|
40255
|
+
getLookAtDistance (layerNode, bbox)
|
|
40210
40256
|
{
|
|
40211
|
-
|
|
40257
|
+
const
|
|
40258
|
+
viewport = layerNode .getViewport () .getRectangle (),
|
|
40259
|
+
bboxSize = bbox .size;
|
|
40260
|
+
|
|
40261
|
+
let size;
|
|
40262
|
+
|
|
40263
|
+
if (viewport [2] < viewport [3])
|
|
40264
|
+
{
|
|
40265
|
+
size = viewport [2] / viewport [3] < bboxSize .x / bboxSize .y
|
|
40266
|
+
? bboxSize .x
|
|
40267
|
+
: bboxSize .y * viewport [2] / viewport [3];
|
|
40268
|
+
}
|
|
40269
|
+
else
|
|
40270
|
+
{
|
|
40271
|
+
size = viewport [2] / viewport [3] < bboxSize .x / bboxSize .y
|
|
40272
|
+
? bboxSize .x * viewport [3] / viewport [2]
|
|
40273
|
+
: bboxSize .y;
|
|
40274
|
+
}
|
|
40275
|
+
|
|
40276
|
+
size *= VIEW_ALL_SCALE_FACTOR;
|
|
40277
|
+
|
|
40278
|
+
return (size / 2) / Math .tan (this .getUserFieldOfView () / 2) + bboxSize .z / 2;
|
|
40212
40279
|
},
|
|
40213
40280
|
getProjectionMatrixWithLimits (nearValue, farValue, viewport)
|
|
40214
40281
|
{
|
|
@@ -42065,6 +42132,8 @@ function eventsProcessed ()
|
|
|
42065
42132
|
return mesh .shapeNodes;
|
|
42066
42133
|
}
|
|
42067
42134
|
|
|
42135
|
+
// Actually shapeNodes are not always Shape nodes, it also can be a Switch nodes from variants
|
|
42136
|
+
// or a GaussianSplats node.
|
|
42068
42137
|
const shapeNodes = this .primitivesArray (mesh, skin, EXT_mesh_gpu_instancing);
|
|
42069
42138
|
|
|
42070
42139
|
// Name Shape nodes.
|
|
@@ -42075,8 +42144,13 @@ function eventsProcessed ()
|
|
|
42075
42144
|
|
|
42076
42145
|
if (name)
|
|
42077
42146
|
{
|
|
42078
|
-
for (const shapeNode of shapeNodes)
|
|
42147
|
+
for (const [i, shapeNode] of shapeNodes .entries ())
|
|
42148
|
+
{
|
|
42079
42149
|
scene .addNamedNode (scene .getUniqueName (name), shapeNode);
|
|
42150
|
+
|
|
42151
|
+
if (shapeNode .getGeometry ?.() && !shapeNode .getGeometry () .getName ())
|
|
42152
|
+
scene .addNamedNode (scene .getUniqueName (`${name}-Mesh-${i}`), shapeNode .getGeometry ());
|
|
42153
|
+
}
|
|
42080
42154
|
}
|
|
42081
42155
|
|
|
42082
42156
|
return mesh .shapeNodes = shapeNodes;
|
|
@@ -44851,6 +44925,7 @@ const GLB2Parser_default_ = GLB2Parser;
|
|
|
44851
44925
|
|
|
44852
44926
|
|
|
44853
44927
|
// http://paulbourke.net/dataformats/obj/
|
|
44928
|
+
// https://paulbourke.net/dataformats/mtl/
|
|
44854
44929
|
// https://people.sc.fsu.edu/~jburkardt/data/obj/obj.html
|
|
44855
44930
|
|
|
44856
44931
|
/*
|
|
@@ -44876,7 +44951,10 @@ const OBJParser_Grammar = Parser_Expressions ({
|
|
|
44876
44951
|
d: /\bd\b/y,
|
|
44877
44952
|
Tr: /\bTr\b/y,
|
|
44878
44953
|
illum: /\billum\b/y,
|
|
44954
|
+
map_Ka: /\bmap_Ka\b/y,
|
|
44879
44955
|
map_Kd: /\bmap_Kd\b/y,
|
|
44956
|
+
map_Ks: /\bmap_Ks\b/y,
|
|
44957
|
+
map_Ns: /\bmap_Ns\b/y,
|
|
44880
44958
|
o: /\bo\b/y,
|
|
44881
44959
|
v: /\bv\b/y,
|
|
44882
44960
|
vt: /\bvt\b/y,
|
|
@@ -44910,11 +44988,11 @@ function OBJParser (scene)
|
|
|
44910
44988
|
// Globals
|
|
44911
44989
|
|
|
44912
44990
|
this .geometryIndices = new Map ();
|
|
44991
|
+
this .numGeometries = 0;
|
|
44913
44992
|
this .smoothingGroup = -1;
|
|
44914
44993
|
this .smoothingGroups = new Map ();
|
|
44915
44994
|
this .groups = new Map ();
|
|
44916
44995
|
this .materials = new Map ();
|
|
44917
|
-
this .textures = new Map ();
|
|
44918
44996
|
this .lastIndex = 0;
|
|
44919
44997
|
}
|
|
44920
44998
|
|
|
@@ -45112,9 +45190,6 @@ Object .assign (Object .setPrototypeOf (OBJParser .prototype, Parser_X3DParser .
|
|
|
45112
45190
|
|
|
45113
45191
|
for (const [id, material] of parser .materials)
|
|
45114
45192
|
this .materials .set (id, material);
|
|
45115
|
-
|
|
45116
|
-
for (const [id, texture] of parser .textures)
|
|
45117
|
-
this .textures .set (id, texture);
|
|
45118
45193
|
}
|
|
45119
45194
|
catch (error)
|
|
45120
45195
|
{
|
|
@@ -45136,7 +45211,6 @@ Object .assign (Object .setPrototypeOf (OBJParser .prototype, Parser_X3DParser .
|
|
|
45136
45211
|
const
|
|
45137
45212
|
scene = this .getExecutionContext (),
|
|
45138
45213
|
material = this .materials .get (id) ?? this .createDefaultMaterial (id),
|
|
45139
|
-
texture = this .textures .get (id),
|
|
45140
45214
|
name = this .sanitizeName (id);
|
|
45141
45215
|
|
|
45142
45216
|
if (name)
|
|
@@ -45146,16 +45220,9 @@ Object .assign (Object .setPrototypeOf (OBJParser .prototype, Parser_X3DParser .
|
|
|
45146
45220
|
scene .addNamedNode (scene .getUniqueName (name), material);
|
|
45147
45221
|
scene .addExportedNode (scene .getUniqueExportName (name), material);
|
|
45148
45222
|
}
|
|
45149
|
-
|
|
45150
|
-
if (texture && !texture .getNodeName ())
|
|
45151
|
-
{
|
|
45152
|
-
scene .addNamedNode (scene .getUniqueName (name), texture);
|
|
45153
|
-
scene .addExportedNode (scene .getUniqueExportName (name), texture);
|
|
45154
|
-
}
|
|
45155
45223
|
}
|
|
45156
45224
|
|
|
45157
45225
|
this .material = material;
|
|
45158
|
-
this .texture = texture;
|
|
45159
45226
|
}
|
|
45160
45227
|
|
|
45161
45228
|
return true;
|
|
@@ -45253,8 +45320,6 @@ Object .assign (Object .setPrototypeOf (OBJParser .prototype, Parser_X3DParser .
|
|
|
45253
45320
|
id += this .group .getId ();
|
|
45254
45321
|
id += ".";
|
|
45255
45322
|
id += this .material .getId ();
|
|
45256
|
-
id += ".";
|
|
45257
|
-
id += this .texture ?.getId () ?? "";
|
|
45258
45323
|
|
|
45259
45324
|
return id;
|
|
45260
45325
|
},
|
|
@@ -45401,6 +45466,8 @@ Object .assign (Object .setPrototypeOf (OBJParser .prototype, Parser_X3DParser .
|
|
|
45401
45466
|
this .normalIndex = [ ];
|
|
45402
45467
|
this .coordIndex = [ ];
|
|
45403
45468
|
|
|
45469
|
+
scene .addNamedNode (scene .getUniqueName (`Geometry-${this .numGeometries ++}`), this .geometry);
|
|
45470
|
+
|
|
45404
45471
|
this .geometryIndices .set (this .geometry,
|
|
45405
45472
|
{
|
|
45406
45473
|
texCoordIndex: this .texCoordIndex,
|
|
@@ -45409,7 +45476,6 @@ Object .assign (Object .setPrototypeOf (OBJParser .prototype, Parser_X3DParser .
|
|
|
45409
45476
|
});
|
|
45410
45477
|
|
|
45411
45478
|
appearance .material = this .material;
|
|
45412
|
-
appearance .texture = this .texture;
|
|
45413
45479
|
this .geometry .creaseAngle = this .smoothingGroup ? Math .PI : 0;
|
|
45414
45480
|
this .shape .appearance = appearance;
|
|
45415
45481
|
this .shape .geometry = this .geometry;
|
|
@@ -45676,7 +45742,16 @@ Object .assign (MaterialParser .prototype,
|
|
|
45676
45742
|
if (this .illum ())
|
|
45677
45743
|
return true;
|
|
45678
45744
|
|
|
45679
|
-
if (this .
|
|
45745
|
+
if (this .map_X ("map_Ka", "ambientTexture"))
|
|
45746
|
+
return true;
|
|
45747
|
+
|
|
45748
|
+
if (this .map_X ("map_Kd", "diffuseTexture"))
|
|
45749
|
+
return true;
|
|
45750
|
+
|
|
45751
|
+
if (this .map_X ("map_Ks", "specularTexture"))
|
|
45752
|
+
return true;
|
|
45753
|
+
|
|
45754
|
+
if (this .map_X ("map_Ns", "shininessTexture"))
|
|
45680
45755
|
return true;
|
|
45681
45756
|
|
|
45682
45757
|
// Skip empty and unknown lines.
|
|
@@ -45855,32 +45930,44 @@ Object .assign (MaterialParser .prototype,
|
|
|
45855
45930
|
|
|
45856
45931
|
return false;
|
|
45857
45932
|
},
|
|
45858
|
-
|
|
45933
|
+
map_X (map_X, materialTexture)
|
|
45859
45934
|
{
|
|
45860
45935
|
this .comments ();
|
|
45861
45936
|
|
|
45862
|
-
if (OBJParser_Grammar
|
|
45937
|
+
if (OBJParser_Grammar [map_X] .parse (this))
|
|
45863
45938
|
{
|
|
45864
45939
|
this .whitespacesNoLineTerminator ();
|
|
45865
45940
|
|
|
45866
45941
|
if (OBJParser_Grammar .untilEndOfLine .parse (this))
|
|
45867
45942
|
{
|
|
45868
|
-
const string = this .result [0];
|
|
45943
|
+
const string = this .result [0] .trim ();
|
|
45869
45944
|
|
|
45870
45945
|
if (string .length && this .id .length)
|
|
45871
45946
|
{
|
|
45872
|
-
const paths = string .
|
|
45947
|
+
const paths = string .split (/\s+/);
|
|
45873
45948
|
|
|
45874
45949
|
if (paths .length)
|
|
45875
45950
|
{
|
|
45876
|
-
const
|
|
45877
|
-
scene = this .executionContext,
|
|
45878
|
-
texture = scene .createNode ("ImageTexture"),
|
|
45879
|
-
path = paths .at (-1) .replace (/\\/g, "/");
|
|
45951
|
+
const path = paths .at (-1) .replace (/\\/g, "/");
|
|
45880
45952
|
|
|
45881
|
-
texture .
|
|
45953
|
+
let texture = this .textures .get (string);
|
|
45882
45954
|
|
|
45883
|
-
|
|
45955
|
+
if (!texture)
|
|
45956
|
+
{
|
|
45957
|
+
const
|
|
45958
|
+
scene = this .executionContext,
|
|
45959
|
+
repeat = !string .match (/-clamp\s+on/);
|
|
45960
|
+
|
|
45961
|
+
texture = scene .createNode ("ImageTexture");
|
|
45962
|
+
|
|
45963
|
+
texture .url = [path];
|
|
45964
|
+
texture .repeatS = repeat;
|
|
45965
|
+
texture .repeatT = repeat;
|
|
45966
|
+
|
|
45967
|
+
this .textures .set (string, texture);
|
|
45968
|
+
}
|
|
45969
|
+
|
|
45970
|
+
this .material [materialTexture] = texture;
|
|
45884
45971
|
}
|
|
45885
45972
|
}
|
|
45886
45973
|
|
|
@@ -46743,7 +46830,9 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
|
|
|
46743
46830
|
transform .rotation = new Numbers_Rotation4 (1, 0, 0, Math .PI);
|
|
46744
46831
|
transform .children .push (gaussianSplats);
|
|
46745
46832
|
|
|
46746
|
-
scene .
|
|
46833
|
+
scene .getRootNodes () .push (transform);
|
|
46834
|
+
scene .addNamedNode (scene .getUniqueName ("GaussianSplats"), gaussianSplats);
|
|
46835
|
+
scene .addExportedNode (scene .getUniqueExportName ("GaussianSplats"), gaussianSplats);
|
|
46747
46836
|
}
|
|
46748
46837
|
else if (this .coordIndex) // IndexedFaceSet
|
|
46749
46838
|
{
|
|
@@ -46809,6 +46898,8 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
|
|
|
46809
46898
|
shape .geometry = geometry;
|
|
46810
46899
|
|
|
46811
46900
|
scene .getRootNodes () .push (shape);
|
|
46901
|
+
scene .addNamedNode (scene .getUniqueName ("Shape"), shape);
|
|
46902
|
+
scene .addExportedNode (scene .getUniqueExportName ("Shape"), shape);
|
|
46812
46903
|
}
|
|
46813
46904
|
else // PointSet
|
|
46814
46905
|
{
|
|
@@ -46844,6 +46935,8 @@ Object .assign (Object .setPrototypeOf (PLYAParser .prototype, Parser_X3DParser
|
|
|
46844
46935
|
shape .geometry = geometry;
|
|
46845
46936
|
|
|
46846
46937
|
scene .getRootNodes () .push (shape);
|
|
46938
|
+
scene .addNamedNode (scene .getUniqueName ("Shape"), shape);
|
|
46939
|
+
scene .addExportedNode (scene .getUniqueExportName ("Shape"), shape);
|
|
46847
46940
|
}
|
|
46848
46941
|
},
|
|
46849
46942
|
createColor ()
|
|
@@ -47763,7 +47856,7 @@ const Bezier_default_ = Bezier;
|
|
|
47763
47856
|
|
|
47764
47857
|
/* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
|
|
47765
47858
|
;// ./src/x_ite/Parser/SVGParser.js
|
|
47766
|
-
/* provided dependency */ var SVGParser_libtess = __webpack_require__(
|
|
47859
|
+
/* provided dependency */ var SVGParser_libtess = __webpack_require__(246);
|
|
47767
47860
|
|
|
47768
47861
|
|
|
47769
47862
|
|
|
@@ -48661,6 +48754,8 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
48661
48754
|
{
|
|
48662
48755
|
const geometryNode = scene .createNode ("IndexedTriangleSet");
|
|
48663
48756
|
|
|
48757
|
+
this .idAttribute (xmlElement .getAttribute ("id"), "-Fill", geometryNode, { named: true });
|
|
48758
|
+
|
|
48664
48759
|
this .fillGeometries .set (xmlElement, geometryNode);
|
|
48665
48760
|
|
|
48666
48761
|
shapeNode .geometry = geometryNode;
|
|
@@ -48688,6 +48783,8 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
48688
48783
|
{
|
|
48689
48784
|
const geometryNode = scene .createNode ("IndexedLineSet");
|
|
48690
48785
|
|
|
48786
|
+
this .idAttribute (xmlElement .getAttribute ("id"), "-Stroke", geometryNode, { named: true });
|
|
48787
|
+
|
|
48691
48788
|
this .strokeGeometries .set (xmlElement, geometryNode);
|
|
48692
48789
|
|
|
48693
48790
|
shapeNode .geometry = geometryNode;
|
|
@@ -48920,9 +49017,9 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
48920
49017
|
{
|
|
48921
49018
|
//console .debug ("pattern");
|
|
48922
49019
|
},
|
|
48923
|
-
idAttribute (attribute, node)
|
|
49020
|
+
idAttribute (attribute, suffix, node, { named, exported })
|
|
48924
49021
|
{
|
|
48925
|
-
if (attribute
|
|
49022
|
+
if (!attribute)
|
|
48926
49023
|
return;
|
|
48927
49024
|
|
|
48928
49025
|
const
|
|
@@ -48932,12 +49029,15 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
48932
49029
|
if (!name)
|
|
48933
49030
|
return;
|
|
48934
49031
|
|
|
48935
|
-
|
|
48936
|
-
|
|
49032
|
+
if (named)
|
|
49033
|
+
scene .addNamedNode (scene .getUniqueName (name + suffix), node);
|
|
49034
|
+
|
|
49035
|
+
if (exported)
|
|
49036
|
+
scene .addExportedNode (scene .getUniqueExportName (name), node);
|
|
48937
49037
|
},
|
|
48938
49038
|
viewBoxAttribute (attribute, defaultValue)
|
|
48939
49039
|
{
|
|
48940
|
-
if (attribute
|
|
49040
|
+
if (!attribute)
|
|
48941
49041
|
return defaultValue;
|
|
48942
49042
|
|
|
48943
49043
|
this .parseValue (attribute);
|
|
@@ -48981,7 +49081,7 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
48981
49081
|
{
|
|
48982
49082
|
// Returns length in pixel.
|
|
48983
49083
|
|
|
48984
|
-
if (attribute
|
|
49084
|
+
if (!attribute)
|
|
48985
49085
|
return defaultValue;
|
|
48986
49086
|
|
|
48987
49087
|
this .parseValue (attribute);
|
|
@@ -49065,7 +49165,7 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
49065
49165
|
},
|
|
49066
49166
|
pointsAttribute (attribute, points)
|
|
49067
49167
|
{
|
|
49068
|
-
if (attribute
|
|
49168
|
+
if (!attribute)
|
|
49069
49169
|
return false;
|
|
49070
49170
|
|
|
49071
49171
|
this .parseValue (attribute);
|
|
@@ -49097,7 +49197,7 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
49097
49197
|
},
|
|
49098
49198
|
dAttribute (attribute, contours)
|
|
49099
49199
|
{
|
|
49100
|
-
if (attribute
|
|
49200
|
+
if (!attribute)
|
|
49101
49201
|
return false;
|
|
49102
49202
|
|
|
49103
49203
|
this .parseValue (attribute);
|
|
@@ -49629,7 +49729,7 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
49629
49729
|
{
|
|
49630
49730
|
const matrix = new Numbers_Matrix3 ();
|
|
49631
49731
|
|
|
49632
|
-
if (attribute
|
|
49732
|
+
if (!attribute)
|
|
49633
49733
|
return matrix;
|
|
49634
49734
|
|
|
49635
49735
|
this .parseValue (attribute);
|
|
@@ -49881,7 +49981,7 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
49881
49981
|
},
|
|
49882
49982
|
styleAttribute (attribute)
|
|
49883
49983
|
{
|
|
49884
|
-
if (attribute
|
|
49984
|
+
if (!attribute)
|
|
49885
49985
|
return;
|
|
49886
49986
|
|
|
49887
49987
|
const values = attribute .split (";");
|
|
@@ -50263,7 +50363,7 @@ Object .assign (Object .setPrototypeOf (SVGParser .prototype, Parser_X3DParser .
|
|
|
50263
50363
|
|
|
50264
50364
|
// Set name.
|
|
50265
50365
|
|
|
50266
|
-
this .idAttribute (xmlElement .getAttribute ("id"), transformNode);
|
|
50366
|
+
this .idAttribute (xmlElement .getAttribute ("id"), "", transformNode, { named: true, exported: true });
|
|
50267
50367
|
|
|
50268
50368
|
// Add node to parent.
|
|
50269
50369
|
|
|
@@ -54358,7 +54458,7 @@ function Fonts_add (path, bold, italic)
|
|
|
54358
54458
|
{
|
|
54359
54459
|
style: italic ? "italic" : "normal",
|
|
54360
54460
|
weight: bold ? "700" : "400",
|
|
54361
|
-
display: "
|
|
54461
|
+
display: "swap",
|
|
54362
54462
|
}));
|
|
54363
54463
|
}
|
|
54364
54464
|
catch (error)
|
|
@@ -54455,7 +54555,7 @@ function X3DCoreContext (element)
|
|
|
54455
54555
|
{
|
|
54456
54556
|
const link = document .createElement ("link");
|
|
54457
54557
|
|
|
54458
|
-
link .integrity = "sha384-
|
|
54558
|
+
link .integrity = "sha384-FFe+A/LlgO2IEpOMp+dkCR3QO/mFR66blaOr+NTadcKHxnGzSm8EdCuwQ+HtDZHM";
|
|
54459
54559
|
link .rel = "stylesheet";
|
|
54460
54560
|
link .crossOrigin = "anonymous";
|
|
54461
54561
|
link .onload = resolve;
|
|
@@ -54467,6 +54567,7 @@ function X3DCoreContext (element)
|
|
|
54467
54567
|
|
|
54468
54568
|
const browser = this [_shadow] .querySelector (".x_ite-private-browser");
|
|
54469
54569
|
|
|
54570
|
+
// Must use display, because Firefox doesn't like visibility.
|
|
54470
54571
|
browser .style .display = "none";
|
|
54471
54572
|
|
|
54472
54573
|
stylesheet .then (() => browser .style .display = "");
|
|
@@ -55246,13 +55347,13 @@ Object .assign (Object .setPrototypeOf (TextureProperties .prototype, Core_X3DNo
|
|
|
55246
55347
|
{
|
|
55247
55348
|
const minificationFilters = new Map ([
|
|
55248
55349
|
["AVG_PIXEL_AVG_MIPMAP", ["LINEAR", "LINEAR_MIPMAP_LINEAR"]],
|
|
55249
|
-
["AVG_PIXEL", ["LINEAR", "LINEAR"]],
|
|
55250
55350
|
["AVG_PIXEL_NEAREST_MIPMAP", ["LINEAR", "LINEAR_MIPMAP_NEAREST"]],
|
|
55251
55351
|
["NEAREST_PIXEL_AVG_MIPMAP", ["NEAREST", "NEAREST_MIPMAP_LINEAR"]],
|
|
55252
55352
|
["NEAREST_PIXEL_NEAREST_MIPMAP", ["NEAREST", "NEAREST_MIPMAP_NEAREST"]],
|
|
55353
|
+
["AVG_PIXEL", ["LINEAR", "LINEAR"]],
|
|
55253
55354
|
["NEAREST_PIXEL", ["NEAREST", "NEAREST"]],
|
|
55254
55355
|
["NICEST", ["LINEAR", "LINEAR_MIPMAP_LINEAR"]],
|
|
55255
|
-
["FASTEST", ["NEAREST", "
|
|
55356
|
+
["FASTEST", ["NEAREST", "NEAREST_MIPMAP_NEAREST"]],
|
|
55256
55357
|
]);
|
|
55257
55358
|
|
|
55258
55359
|
return function (mipMaps = true)
|
|
@@ -55349,7 +55450,7 @@ Object .assign (X3DEnvironmentalEffectsContext .prototype,
|
|
|
55349
55450
|
backgroundTextureProperties ._boundaryModeR = "CLAMP_TO_EDGE";
|
|
55350
55451
|
backgroundTextureProperties ._minificationFilter = "NICEST";
|
|
55351
55452
|
backgroundTextureProperties ._magnificationFilter = "NICEST";
|
|
55352
|
-
|
|
55453
|
+
|
|
55353
55454
|
backgroundTextureProperties .setup ();
|
|
55354
55455
|
|
|
55355
55456
|
return backgroundTextureProperties;
|
|
@@ -55658,38 +55759,23 @@ Object .assign (Object .setPrototypeOf (IndexedFaceSet .prototype, Rendering_X3D
|
|
|
55658
55759
|
},
|
|
55659
55760
|
getTexCoordPerVertexIndex (index)
|
|
55660
55761
|
{
|
|
55661
|
-
|
|
55662
|
-
return this ._texCoordIndex [index];
|
|
55663
|
-
|
|
55664
|
-
return this ._coordIndex [index];
|
|
55762
|
+
return this ._texCoordIndex [index] ?? this ._coordIndex [index];
|
|
55665
55763
|
},
|
|
55666
55764
|
getColorPerVertexIndex (index)
|
|
55667
55765
|
{
|
|
55668
|
-
|
|
55669
|
-
return this ._colorIndex [index];
|
|
55670
|
-
|
|
55671
|
-
return this ._coordIndex [index];
|
|
55766
|
+
return this ._colorIndex [index] ?? this ._coordIndex [index];
|
|
55672
55767
|
},
|
|
55673
55768
|
getColorPerFaceIndex (index)
|
|
55674
55769
|
{
|
|
55675
|
-
|
|
55676
|
-
return this ._colorIndex [index];
|
|
55677
|
-
|
|
55678
|
-
return index;
|
|
55770
|
+
return this ._colorIndex [index] ?? index;
|
|
55679
55771
|
},
|
|
55680
55772
|
getNormalPerVertexIndex (index)
|
|
55681
55773
|
{
|
|
55682
|
-
|
|
55683
|
-
return this ._normalIndex [index];
|
|
55684
|
-
|
|
55685
|
-
return this ._coordIndex [index];
|
|
55774
|
+
return this ._normalIndex [index] ?? this ._coordIndex [index];
|
|
55686
55775
|
},
|
|
55687
55776
|
getNormalPerFaceIndex (index)
|
|
55688
55777
|
{
|
|
55689
|
-
|
|
55690
|
-
return this ._normalIndex [index];
|
|
55691
|
-
|
|
55692
|
-
return index;
|
|
55778
|
+
return this ._normalIndex [index] ?? index;
|
|
55693
55779
|
},
|
|
55694
55780
|
build ()
|
|
55695
55781
|
{
|
|
@@ -55963,11 +56049,13 @@ Object .assign (Object .setPrototypeOf (IndexedFaceSet .prototype, Rendering_X3D
|
|
|
55963
56049
|
// Determine polygon normal.
|
|
55964
56050
|
// We use Newell's method https://www.opengl.org/wiki/Calculating_a_Surface_Normal here:
|
|
55965
56051
|
|
|
55966
|
-
const
|
|
56052
|
+
const
|
|
56053
|
+
normal = new Numbers_Vector3 (),
|
|
56054
|
+
length = vertices .length;
|
|
55967
56055
|
|
|
55968
56056
|
coord .get1Point (coordIndex [vertices [0]], next);
|
|
55969
56057
|
|
|
55970
|
-
for (let i = 0
|
|
56058
|
+
for (let i = 0; i < length; ++ i)
|
|
55971
56059
|
{
|
|
55972
56060
|
const tmp = current;
|
|
55973
56061
|
current = next;
|
|
@@ -58931,17 +59019,11 @@ Object .assign (Object .setPrototypeOf (IndexedLineSet .prototype, Rendering_X3D
|
|
|
58931
59019
|
},
|
|
58932
59020
|
getColorPerVertexIndex (index)
|
|
58933
59021
|
{
|
|
58934
|
-
|
|
58935
|
-
return this ._colorIndex [index];
|
|
58936
|
-
|
|
58937
|
-
return this ._coordIndex [index];
|
|
59022
|
+
return this ._colorIndex [index] ?? this ._coordIndex [index];
|
|
58938
59023
|
},
|
|
58939
59024
|
getColorIndex (index)
|
|
58940
59025
|
{
|
|
58941
|
-
|
|
58942
|
-
return this ._colorIndex [index];
|
|
58943
|
-
|
|
58944
|
-
return index;
|
|
59026
|
+
return this ._colorIndex [index] ?? index;
|
|
58945
59027
|
},
|
|
58946
59028
|
getPolylineIndices ()
|
|
58947
59029
|
{
|
|
@@ -58953,7 +59035,9 @@ Object .assign (Object .setPrototypeOf (IndexedLineSet .prototype, Rendering_X3D
|
|
|
58953
59035
|
|
|
58954
59036
|
if (coordIndex .length)
|
|
58955
59037
|
{
|
|
58956
|
-
|
|
59038
|
+
const length = coordIndex .length;
|
|
59039
|
+
|
|
59040
|
+
for (let i = 0; i < length; ++ i)
|
|
58957
59041
|
{
|
|
58958
59042
|
const index = coordIndex [i];
|
|
58959
59043
|
|
|
@@ -58971,10 +59055,8 @@ Object .assign (Object .setPrototypeOf (IndexedLineSet .prototype, Rendering_X3D
|
|
|
58971
59055
|
}
|
|
58972
59056
|
}
|
|
58973
59057
|
|
|
58974
|
-
if (coordIndex [
|
|
58975
|
-
{
|
|
59058
|
+
if (coordIndex [length - 1] >= 0)
|
|
58976
59059
|
polylines .push (polyline);
|
|
58977
|
-
}
|
|
58978
59060
|
}
|
|
58979
59061
|
|
|
58980
59062
|
return polylines;
|
|
@@ -59013,9 +59095,13 @@ Object .assign (Object .setPrototypeOf (IndexedLineSet .prototype, Rendering_X3D
|
|
|
59013
59095
|
|
|
59014
59096
|
if (polyline .length > 1)
|
|
59015
59097
|
{
|
|
59016
|
-
|
|
59098
|
+
const l_end = polyline .length - 1;
|
|
59099
|
+
|
|
59100
|
+
for (let line = 0; line < l_end; ++ line)
|
|
59017
59101
|
{
|
|
59018
|
-
|
|
59102
|
+
const i_end = line + 2;
|
|
59103
|
+
|
|
59104
|
+
for (let l = line; l < i_end; ++ l)
|
|
59019
59105
|
{
|
|
59020
59106
|
const
|
|
59021
59107
|
i = polyline [l],
|
|
@@ -59360,7 +59446,6 @@ Object .assign (X3DLightingContext .prototype,
|
|
|
59360
59446
|
texture = new Texturing_ImageTexture (this .getPrivateScene ()),
|
|
59361
59447
|
textureProperties = new Texturing_TextureProperties (this .getPrivateScene ());
|
|
59362
59448
|
|
|
59363
|
-
textureProperties ._generateMipMaps = false;
|
|
59364
59449
|
textureProperties ._minificationFilter = "AVG_PIXEL";
|
|
59365
59450
|
textureProperties ._magnificationFilter = "AVG_PIXEL";
|
|
59366
59451
|
textureProperties ._boundaryModeS = "CLAMP_TO_BOUNDARY";
|
|
@@ -59427,7 +59512,7 @@ Object .assign (X3DLightingContext .prototype,
|
|
|
59427
59512
|
],
|
|
59428
59513
|
});
|
|
59429
59514
|
},
|
|
59430
|
-
filterEnvironmentTexture ({ name, texture, distribution, sampleCount,
|
|
59515
|
+
filterEnvironmentTexture ({ name, texture, distribution, sampleCount, roughnesses, flipX, cachedNode })
|
|
59431
59516
|
{
|
|
59432
59517
|
// Render the texture.
|
|
59433
59518
|
|
|
@@ -59461,7 +59546,7 @@ Object .assign (X3DLightingContext .prototype,
|
|
|
59461
59546
|
for (const target of filtered .getTargets ())
|
|
59462
59547
|
gl .texImage2D (target, 0, gl .RGBA, size, size, 0, gl .RGBA, gl .UNSIGNED_BYTE, data);
|
|
59463
59548
|
|
|
59464
|
-
if (
|
|
59549
|
+
if (roughnesses .length > 1)
|
|
59465
59550
|
{
|
|
59466
59551
|
gl .generateMipmap (filtered .getTarget ());
|
|
59467
59552
|
gl .texParameteri (filtered .getTarget (), gl .TEXTURE_MIN_FILTER, gl .LINEAR_MIPMAP_LINEAR);
|
|
@@ -59495,7 +59580,7 @@ Object .assign (X3DLightingContext .prototype,
|
|
|
59495
59580
|
gl .uniform1f (shaderNode .x3d_IntensityEXT, 1);
|
|
59496
59581
|
gl .uniform3f (shaderNode .x3d_FlipEXT, flipX ? -1 : 1, 1, 1);
|
|
59497
59582
|
|
|
59498
|
-
for (const [level,
|
|
59583
|
+
for (const [level, roughness] of roughnesses .entries ())
|
|
59499
59584
|
{
|
|
59500
59585
|
const mipSize = size >> level;
|
|
59501
59586
|
|
|
@@ -59505,7 +59590,7 @@ Object .assign (X3DLightingContext .prototype,
|
|
|
59505
59590
|
|
|
59506
59591
|
gl .viewport (0, 0, mipSize, mipSize);
|
|
59507
59592
|
gl .scissor (0, 0, mipSize, mipSize);
|
|
59508
|
-
gl .uniform1f (shaderNode .x3d_RoughnessEXT,
|
|
59593
|
+
gl .uniform1f (shaderNode .x3d_RoughnessEXT, roughness);
|
|
59509
59594
|
|
|
59510
59595
|
// Generate images.
|
|
59511
59596
|
|
|
@@ -59540,6 +59625,8 @@ const X3DLightingContext_default_ = X3DLightingContext;
|
|
|
59540
59625
|
|
|
59541
59626
|
|
|
59542
59627
|
|
|
59628
|
+
const OrthoViewpoint_VIEW_ALL_SCALE_FACTOR = 1.1;
|
|
59629
|
+
|
|
59543
59630
|
function OrthoViewpoint (executionContext)
|
|
59544
59631
|
{
|
|
59545
59632
|
Navigation_X3DViewpointNode .call (this, executionContext);
|
|
@@ -59616,15 +59703,14 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59616
59703
|
},
|
|
59617
59704
|
getRelativeTransformation (fromViewpointNode)
|
|
59618
59705
|
{
|
|
59619
|
-
const
|
|
59706
|
+
const
|
|
59707
|
+
relative = Navigation_X3DViewpointNode .prototype .getRelativeTransformation .call (this, fromViewpointNode),
|
|
59708
|
+
same = fromViewpointNode .constructor === this .constructor;
|
|
59620
59709
|
|
|
59621
|
-
|
|
59622
|
-
|
|
59623
|
-
|
|
59624
|
-
|
|
59625
|
-
relative .userMaximumX = fromViewpointNode .getUserMaximumX ();
|
|
59626
|
-
relative .userMaximumY = fromViewpointNode .getUserMaximumY ();
|
|
59627
|
-
}
|
|
59710
|
+
relative .userMinimumX = same ? fromViewpointNode .getUserMinimumX () : 0;
|
|
59711
|
+
relative .userMinimumY = same ? fromViewpointNode .getUserMinimumY () : 0;
|
|
59712
|
+
relative .userMaximumX = same ? fromViewpointNode .getUserMaximumX () : 0;
|
|
59713
|
+
relative .userMaximumY = same ? fromViewpointNode .getUserMaximumY () : 0;
|
|
59628
59714
|
|
|
59629
59715
|
return relative;
|
|
59630
59716
|
},
|
|
@@ -59642,13 +59728,13 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59642
59728
|
this .fieldOfViewOffsetInterpolator1 ._keyValue = new x_ite_Fields .MFFloat (offset1, this ._fieldOfViewOffset [1]);
|
|
59643
59729
|
this .fieldOfViewOffsetInterpolator2 ._keyValue = new x_ite_Fields .MFFloat (offset2, this ._fieldOfViewOffset [2]);
|
|
59644
59730
|
this .fieldOfViewOffsetInterpolator3 ._keyValue = new x_ite_Fields .MFFloat (offset3, this ._fieldOfViewOffset [3]);
|
|
59645
|
-
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (
|
|
59731
|
+
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (fromViewpointNode ._fieldOfViewScale .getValue (), 1);
|
|
59646
59732
|
|
|
59647
|
-
this ._fieldOfViewOffset [0] =
|
|
59648
|
-
this ._fieldOfViewOffset [1] =
|
|
59649
|
-
this ._fieldOfViewOffset [2] =
|
|
59650
|
-
this ._fieldOfViewOffset [3] =
|
|
59651
|
-
this ._fieldOfViewScale =
|
|
59733
|
+
this ._fieldOfViewOffset [0] = offset0;
|
|
59734
|
+
this ._fieldOfViewOffset [1] = offset1;
|
|
59735
|
+
this ._fieldOfViewOffset [2] = offset2;
|
|
59736
|
+
this ._fieldOfViewOffset [3] = offset3;
|
|
59737
|
+
this ._fieldOfViewScale = fromViewpointNode ._fieldOfViewScale .getValue ();
|
|
59652
59738
|
}
|
|
59653
59739
|
else
|
|
59654
59740
|
{
|
|
@@ -59656,7 +59742,7 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59656
59742
|
this .fieldOfViewOffsetInterpolator1 ._keyValue = new x_ite_Fields .MFFloat (this ._fieldOfViewOffset [1], this ._fieldOfViewOffset [1]);
|
|
59657
59743
|
this .fieldOfViewOffsetInterpolator2 ._keyValue = new x_ite_Fields .MFFloat (this ._fieldOfViewOffset [2], this ._fieldOfViewOffset [2]);
|
|
59658
59744
|
this .fieldOfViewOffsetInterpolator3 ._keyValue = new x_ite_Fields .MFFloat (this ._fieldOfViewOffset [3], this ._fieldOfViewOffset [3]);
|
|
59659
|
-
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (1,
|
|
59745
|
+
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (1, 1);
|
|
59660
59746
|
|
|
59661
59747
|
this ._fieldOfViewOffset = this ._fieldOfViewOffset .getValue ();
|
|
59662
59748
|
this ._fieldOfViewScale = 1;
|
|
@@ -59666,9 +59752,9 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59666
59752
|
{
|
|
59667
59753
|
return false;
|
|
59668
59754
|
},
|
|
59669
|
-
getFieldOfView ()
|
|
59755
|
+
getFieldOfView (value = new Numbers_Vector4 ())
|
|
59670
59756
|
{
|
|
59671
|
-
return
|
|
59757
|
+
return value .set (
|
|
59672
59758
|
this .getMinimumX (),
|
|
59673
59759
|
this .getMinimumY (),
|
|
59674
59760
|
this .getMaximumX (),
|
|
@@ -59679,9 +59765,9 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59679
59765
|
{
|
|
59680
59766
|
this ._fieldOfView = value;
|
|
59681
59767
|
},
|
|
59682
|
-
getUserFieldOfView ()
|
|
59768
|
+
getUserFieldOfView (value = new Numbers_Vector4 ())
|
|
59683
59769
|
{
|
|
59684
|
-
return
|
|
59770
|
+
return value .set (
|
|
59685
59771
|
this .getUserMinimumX (),
|
|
59686
59772
|
this .getUserMinimumY (),
|
|
59687
59773
|
this .getUserMaximumX (),
|
|
@@ -59743,13 +59829,13 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59743
59829
|
getScreenScale (point, viewport, screenScale)
|
|
59744
59830
|
{
|
|
59745
59831
|
const
|
|
59746
|
-
width
|
|
59747
|
-
height
|
|
59748
|
-
sizeX
|
|
59749
|
-
sizeY
|
|
59750
|
-
|
|
59832
|
+
width = viewport [2],
|
|
59833
|
+
height= viewport [3],
|
|
59834
|
+
sizeX = this .getUserSizeX (),
|
|
59835
|
+
sizeY = this .getUserSizeY (),
|
|
59836
|
+
ratio = width / height;
|
|
59751
59837
|
|
|
59752
|
-
if (
|
|
59838
|
+
if (ratio > sizeX / sizeY)
|
|
59753
59839
|
{
|
|
59754
59840
|
const s = sizeY / height;
|
|
59755
59841
|
|
|
@@ -59766,39 +59852,129 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59766
59852
|
{
|
|
59767
59853
|
const viewportSize = new Numbers_Vector2 ();
|
|
59768
59854
|
|
|
59769
|
-
return function (viewport
|
|
59855
|
+
return function (viewport /*, nearValue */)
|
|
59770
59856
|
{
|
|
59771
59857
|
const
|
|
59772
59858
|
width = viewport [2],
|
|
59773
59859
|
height = viewport [3],
|
|
59774
59860
|
sizeX = this .getUserSizeX (),
|
|
59775
59861
|
sizeY = this .getUserSizeY (),
|
|
59776
|
-
|
|
59862
|
+
ratio = width / height;
|
|
59777
59863
|
|
|
59778
|
-
if (
|
|
59779
|
-
return viewportSize .set (sizeY *
|
|
59864
|
+
if (ratio > sizeX / sizeY)
|
|
59865
|
+
return viewportSize .set (sizeY * ratio, sizeY);
|
|
59780
59866
|
|
|
59781
|
-
return viewportSize .set (sizeX, sizeX /
|
|
59867
|
+
return viewportSize .set (sizeX, sizeX / ratio);
|
|
59782
59868
|
};
|
|
59783
59869
|
})(),
|
|
59784
|
-
getLookAtDistance (bbox)
|
|
59870
|
+
getLookAtDistance (layerNode, bbox)
|
|
59785
59871
|
{
|
|
59786
59872
|
return bbox .size .norm () / 2 + 10;
|
|
59787
59873
|
},
|
|
59874
|
+
getViewAllScale (layerNode, bbox)
|
|
59875
|
+
{
|
|
59876
|
+
const
|
|
59877
|
+
viewport = layerNode .getViewport () .getRectangle (),
|
|
59878
|
+
width = viewport [2],
|
|
59879
|
+
height = viewport [3],
|
|
59880
|
+
ratio = width / height,
|
|
59881
|
+
bboxSize = bbox .size;
|
|
59882
|
+
|
|
59883
|
+
let sizeX, sizeY;
|
|
59884
|
+
|
|
59885
|
+
if (ratio > this .getSizeX () / this .getSizeY ())
|
|
59886
|
+
{
|
|
59887
|
+
sizeX = this .getSizeY () * ratio,
|
|
59888
|
+
sizeY = this .getSizeY ();
|
|
59889
|
+
}
|
|
59890
|
+
else
|
|
59891
|
+
{
|
|
59892
|
+
sizeX = this .getSizeX (),
|
|
59893
|
+
sizeY = this .getSizeX () / ratio;
|
|
59894
|
+
}
|
|
59895
|
+
|
|
59896
|
+
const
|
|
59897
|
+
scaleX = bboxSize .x / sizeX,
|
|
59898
|
+
scaleY = bboxSize .y / sizeY,
|
|
59899
|
+
scale = Math .max (scaleX, scaleY);
|
|
59900
|
+
|
|
59901
|
+
return scale * OrthoViewpoint_VIEW_ALL_SCALE_FACTOR;
|
|
59902
|
+
},
|
|
59903
|
+
lookAtBBox ({ layerNode, bbox, transitionTime, factor, straighten })
|
|
59904
|
+
{
|
|
59905
|
+
const
|
|
59906
|
+
fieldOfViewOffset = this ._fieldOfViewOffset .copy (),
|
|
59907
|
+
fieldOfViewScale = this ._fieldOfViewScale .getValue ();
|
|
59908
|
+
|
|
59909
|
+
const localBBox = Navigation_X3DViewpointNode .prototype .lookAtBBox .call (this, { layerNode, bbox, transitionTime, factor, straighten });
|
|
59910
|
+
|
|
59911
|
+
if (!localBBox)
|
|
59912
|
+
return;
|
|
59913
|
+
|
|
59914
|
+
const scale = this .getViewAllScale (layerNode, localBBox);
|
|
59915
|
+
|
|
59916
|
+
const
|
|
59917
|
+
offset0 = this .getMinimumX () * scale - this .getMinimumX (),
|
|
59918
|
+
offset1 = this .getMinimumY () * scale - this .getMinimumY (),
|
|
59919
|
+
offset2 = this .getMaximumX () * scale - this .getMaximumX (),
|
|
59920
|
+
offset3 = this .getMaximumY () * scale - this .getMaximumY ();
|
|
59921
|
+
|
|
59922
|
+
this .fieldOfViewOffsetInterpolator0 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [0], offset0);
|
|
59923
|
+
this .fieldOfViewOffsetInterpolator1 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [1], offset1);
|
|
59924
|
+
this .fieldOfViewOffsetInterpolator2 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [2], offset2);
|
|
59925
|
+
this .fieldOfViewOffsetInterpolator3 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [3], offset3);
|
|
59926
|
+
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewScale, 1);
|
|
59927
|
+
},
|
|
59928
|
+
lookAt ({ layerNode, point, distance, transitionTime, factor, straighten })
|
|
59929
|
+
{
|
|
59930
|
+
const
|
|
59931
|
+
fieldOfViewOffset = this ._fieldOfViewOffset .copy (),
|
|
59932
|
+
fieldOfViewScale = this ._fieldOfViewScale .getValue ();
|
|
59933
|
+
|
|
59934
|
+
const scale = 1 - (0.9 * factor);
|
|
59935
|
+
|
|
59936
|
+
const
|
|
59937
|
+
offset0 = this .getUserMinimumX () * scale - this .getMinimumX (),
|
|
59938
|
+
offset1 = this .getUserMinimumY () * scale - this .getMinimumY (),
|
|
59939
|
+
offset2 = this .getUserMaximumX () * scale - this .getMaximumX (),
|
|
59940
|
+
offset3 = this .getUserMaximumY () * scale - this .getMaximumY ();
|
|
59941
|
+
|
|
59942
|
+
Navigation_X3DViewpointNode .prototype .lookAt .call (this, { layerNode, point, distance, transitionTime, factor: 0, straighten });
|
|
59943
|
+
|
|
59944
|
+
this .fieldOfViewOffsetInterpolator0 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [0], offset0);
|
|
59945
|
+
this .fieldOfViewOffsetInterpolator1 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [1], offset1);
|
|
59946
|
+
this .fieldOfViewOffsetInterpolator2 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [2], offset2);
|
|
59947
|
+
this .fieldOfViewOffsetInterpolator3 ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewOffset [3], offset3);
|
|
59948
|
+
this .fieldOfViewScaleInterpolator ._keyValue = new x_ite_Fields .MFFloat (fieldOfViewScale, 1);
|
|
59949
|
+
},
|
|
59950
|
+
viewAll (layerNode, bbox)
|
|
59951
|
+
{
|
|
59952
|
+
const localBBox = Navigation_X3DViewpointNode .prototype .viewAll .call (this, layerNode, bbox);
|
|
59953
|
+
|
|
59954
|
+
if (!localBBox)
|
|
59955
|
+
return;
|
|
59956
|
+
|
|
59957
|
+
const scale = this .getViewAllScale (layerNode, localBBox);
|
|
59958
|
+
|
|
59959
|
+
this ._fieldOfViewOffset [0] = this .getUserMinimumX () * scale - this .getUserMinimumX ();
|
|
59960
|
+
this ._fieldOfViewOffset [1] = this .getUserMinimumY () * scale - this .getUserMinimumY ();
|
|
59961
|
+
this ._fieldOfViewOffset [2] = this .getUserMaximumX () * scale - this .getUserMaximumX ();
|
|
59962
|
+
this ._fieldOfViewOffset [3] = this .getUserMaximumY () * scale - this .getUserMaximumY ();
|
|
59963
|
+
},
|
|
59788
59964
|
getProjectionMatrixWithLimits (nearValue, farValue, viewport)
|
|
59789
59965
|
{
|
|
59790
59966
|
const
|
|
59791
59967
|
width = viewport [2],
|
|
59792
59968
|
height = viewport [3],
|
|
59793
|
-
|
|
59969
|
+
ratio = width / height,
|
|
59794
59970
|
sizeX = this .getUserSizeX (),
|
|
59795
59971
|
sizeY = this .getUserSizeY ();
|
|
59796
59972
|
|
|
59797
|
-
if (
|
|
59973
|
+
if (ratio > sizeX / sizeY)
|
|
59798
59974
|
{
|
|
59799
59975
|
const
|
|
59800
59976
|
center = (this .getUserMinimumX () + this .getUserMaximumX ()) / 2,
|
|
59801
|
-
size1_2 = (sizeY *
|
|
59977
|
+
size1_2 = (sizeY * ratio) / 2;
|
|
59802
59978
|
|
|
59803
59979
|
return Geometry_Camera .ortho (center - size1_2, center + size1_2, this .getUserMinimumY (), this .getUserMaximumY (), nearValue, farValue, this .projectionMatrix);
|
|
59804
59980
|
}
|
|
@@ -59806,28 +59982,14 @@ Object .assign (Object .setPrototypeOf (OrthoViewpoint .prototype, Navigation_X3
|
|
|
59806
59982
|
{
|
|
59807
59983
|
const
|
|
59808
59984
|
center = (this .getUserMinimumY () + this .getUserMaximumY ()) / 2,
|
|
59809
|
-
size1_2 = (sizeX /
|
|
59985
|
+
size1_2 = (sizeX / ratio) / 2;
|
|
59810
59986
|
|
|
59811
59987
|
return Geometry_Camera .ortho (this .getUserMinimumX (), this .getUserMaximumX (), center - size1_2, center + size1_2, nearValue, farValue, this .projectionMatrix);
|
|
59812
59988
|
}
|
|
59813
59989
|
},
|
|
59814
|
-
viewAll (bbox)
|
|
59815
|
-
{
|
|
59816
|
-
Navigation_X3DViewpointNode .prototype .viewAll .call (this, bbox);
|
|
59817
|
-
|
|
59818
|
-
const
|
|
59819
|
-
size = bbox .size,
|
|
59820
|
-
scaleX = size .x / this .getSizeX (),
|
|
59821
|
-
scaleY = size .y / this .getSizeY (),
|
|
59822
|
-
scale = Math .max (scaleX, scaleY) * 1.1;
|
|
59823
|
-
|
|
59824
|
-
this ._fieldOfViewOffset [0] = this .getMinimumX () * scale - this .getMinimumX ();
|
|
59825
|
-
this ._fieldOfViewOffset [1] = this .getMinimumY () * scale - this .getMinimumY ();
|
|
59826
|
-
this ._fieldOfViewOffset [2] = this .getMaximumX () * scale - this .getMaximumX ();
|
|
59827
|
-
this ._fieldOfViewOffset [3] = this .getMaximumY () * scale - this .getMaximumY ();
|
|
59828
|
-
},
|
|
59829
59990
|
convertFields (fields)
|
|
59830
59991
|
{
|
|
59992
|
+
// Convert fields for to*String.
|
|
59831
59993
|
// Don't check for specification version, it will not work with Sunrize.
|
|
59832
59994
|
|
|
59833
59995
|
fields .find (field => field .getName () === "fieldOfView")
|
|
@@ -59921,15 +60083,13 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, Base_X3DBaseNode .
|
|
|
59921
60083
|
|
|
59922
60084
|
return browser .getBrowserOption ("StraightenHorizon") || !! browser .getPose ();
|
|
59923
60085
|
},
|
|
59924
|
-
getButton (button)
|
|
60086
|
+
getButton (button, altKey)
|
|
59925
60087
|
{
|
|
59926
60088
|
// If Alt key is pressed and button 0, then emulate button 1 (middle).
|
|
59927
60089
|
if (button === 0)
|
|
59928
60090
|
{
|
|
59929
|
-
if (
|
|
59930
|
-
{
|
|
60091
|
+
if (altKey)
|
|
59931
60092
|
return 1;
|
|
59932
|
-
}
|
|
59933
60093
|
}
|
|
59934
60094
|
|
|
59935
60095
|
return button;
|
|
@@ -59992,23 +60152,25 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, Base_X3DBaseNode .
|
|
|
59992
60152
|
|
|
59993
60153
|
return vector .set (x, y, tbProjectToSphere (0.5, x, y));
|
|
59994
60154
|
},
|
|
59995
|
-
lookAtPoint (x, y,
|
|
60155
|
+
lookAtPoint (x, y, straighten)
|
|
59996
60156
|
{
|
|
59997
60157
|
if (!this .touch (x, y))
|
|
59998
60158
|
return;
|
|
59999
60159
|
|
|
60000
60160
|
const
|
|
60161
|
+
layerNode = this .getActiveLayer (),
|
|
60001
60162
|
viewpointNode = this .getActiveViewpoint (),
|
|
60002
60163
|
hit = this .getBrowser () .getHit ();
|
|
60003
60164
|
|
|
60004
|
-
viewpointNode .lookAtPoint (
|
|
60165
|
+
viewpointNode .lookAtPoint ({ layerNode, point: hit .point, factor: 0.5, straighten });
|
|
60005
60166
|
},
|
|
60006
|
-
lookAtBBox (x, y,
|
|
60167
|
+
lookAtBBox (x, y, straighten)
|
|
60007
60168
|
{
|
|
60008
60169
|
if (!this .touch (x, y))
|
|
60009
60170
|
return;
|
|
60010
60171
|
|
|
60011
60172
|
const
|
|
60173
|
+
layerNode = this .getActiveLayer (),
|
|
60012
60174
|
viewpointNode = this .getActiveViewpoint (),
|
|
60013
60175
|
hit = this .getBrowser () .getHit ();
|
|
60014
60176
|
|
|
@@ -60016,7 +60178,7 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, Base_X3DBaseNode .
|
|
|
60016
60178
|
.multRight (hit .modelViewMatrix)
|
|
60017
60179
|
.multRight (viewpointNode .getCameraSpaceMatrix ());
|
|
60018
60180
|
|
|
60019
|
-
viewpointNode .lookAtBBox (
|
|
60181
|
+
viewpointNode .lookAtBBox ({ layerNode, bbox, factor: 0.8, straighten });
|
|
60020
60182
|
},
|
|
60021
60183
|
touch (x, y)
|
|
60022
60184
|
{
|
|
@@ -60496,8 +60658,6 @@ function ExamineViewer (executionContext, navigationInfo)
|
|
|
60496
60658
|
this .touchMode = 0;
|
|
60497
60659
|
this .touch1 = new Numbers_Vector2 ();
|
|
60498
60660
|
this .touch2 = new Numbers_Vector2 ();
|
|
60499
|
-
this .tapStart = 0;
|
|
60500
|
-
this .dblTapInterval = 0.4;
|
|
60501
60661
|
|
|
60502
60662
|
this .initialPositionOffset = new Numbers_Vector3 ();
|
|
60503
60663
|
this .initialOrientationOffset = new Numbers_Rotation4 ();
|
|
@@ -60574,12 +60734,18 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60574
60734
|
if (this .button >= 0)
|
|
60575
60735
|
return;
|
|
60576
60736
|
|
|
60577
|
-
const
|
|
60737
|
+
const browser = this .getBrowser ();
|
|
60738
|
+
|
|
60739
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
60578
60740
|
|
|
60579
60741
|
if (!this .isPointerInRectangle (x, y))
|
|
60580
60742
|
return;
|
|
60581
60743
|
|
|
60582
|
-
|
|
60744
|
+
this .altKey = browser .getAltKey ();
|
|
60745
|
+
|
|
60746
|
+
const button = this .getButton (event .button, this .altKey);
|
|
60747
|
+
|
|
60748
|
+
switch (button)
|
|
60583
60749
|
{
|
|
60584
60750
|
case 0:
|
|
60585
60751
|
{
|
|
@@ -60589,7 +60755,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60589
60755
|
|
|
60590
60756
|
// Start rotate.
|
|
60591
60757
|
|
|
60592
|
-
this .button =
|
|
60758
|
+
this .button = button;
|
|
60593
60759
|
this .motionTime = Date .now ();
|
|
60594
60760
|
|
|
60595
60761
|
this .deltaRotation .assign (Numbers_Rotation4 .IDENTITY);
|
|
@@ -60601,7 +60767,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60601
60767
|
|
|
60602
60768
|
this .disconnect ();
|
|
60603
60769
|
this .getActiveViewpoint () .transitionStop ();
|
|
60604
|
-
|
|
60770
|
+
browser .setCursor ("MOVE");
|
|
60605
60771
|
this .startRotate (x, y, 0);
|
|
60606
60772
|
|
|
60607
60773
|
this ._isActive = true;
|
|
@@ -60615,7 +60781,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60615
60781
|
|
|
60616
60782
|
// Start pan.
|
|
60617
60783
|
|
|
60618
|
-
this .button =
|
|
60784
|
+
this .button = button;
|
|
60619
60785
|
|
|
60620
60786
|
helper.on (this, document, "mouseup", event => this .mouseup (event));
|
|
60621
60787
|
helper.on (this, document, "mousemove", event => this .mousemove (event));
|
|
@@ -60624,7 +60790,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60624
60790
|
|
|
60625
60791
|
this .disconnect ();
|
|
60626
60792
|
this .getActiveViewpoint () .transitionStop ();
|
|
60627
|
-
|
|
60793
|
+
browser .setCursor ("MOVE");
|
|
60628
60794
|
this .startPan (x, y);
|
|
60629
60795
|
|
|
60630
60796
|
this ._isActive = true;
|
|
@@ -60634,7 +60800,9 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60634
60800
|
},
|
|
60635
60801
|
mouseup (event, spin = true)
|
|
60636
60802
|
{
|
|
60637
|
-
|
|
60803
|
+
const button = this .getButton (event .button, this .altKey);
|
|
60804
|
+
|
|
60805
|
+
if (button !== this .button)
|
|
60638
60806
|
return;
|
|
60639
60807
|
|
|
60640
60808
|
// Stop event propagation.
|
|
@@ -60651,7 +60819,7 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60651
60819
|
|
|
60652
60820
|
this ._isActive = false;
|
|
60653
60821
|
|
|
60654
|
-
switch (
|
|
60822
|
+
switch (button)
|
|
60655
60823
|
{
|
|
60656
60824
|
case 0:
|
|
60657
60825
|
{
|
|
@@ -60675,20 +60843,27 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
60675
60843
|
|
|
60676
60844
|
// Look at.
|
|
60677
60845
|
|
|
60678
|
-
const
|
|
60846
|
+
const browser = this .getBrowser ();
|
|
60847
|
+
|
|
60848
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
60679
60849
|
|
|
60680
60850
|
this .disconnect ();
|
|
60681
60851
|
|
|
60682
|
-
if (
|
|
60852
|
+
if (browser .getAltKey ())
|
|
60683
60853
|
this .lookAtPoint (x, y, this .getStraightenHorizon ());
|
|
60684
60854
|
else
|
|
60685
60855
|
this .lookAtBBox (x, y, this .getStraightenHorizon ());
|
|
60686
60856
|
},
|
|
60687
60857
|
mousemove (event)
|
|
60688
60858
|
{
|
|
60859
|
+
const button = this .getButton (this .button, this .altKey);
|
|
60860
|
+
|
|
60861
|
+
if (button !== this .button)
|
|
60862
|
+
return;
|
|
60863
|
+
|
|
60689
60864
|
const { x, y } = this .getBrowser () .getPointerFromEvent (event);
|
|
60690
60865
|
|
|
60691
|
-
switch (
|
|
60866
|
+
switch (button)
|
|
60692
60867
|
{
|
|
60693
60868
|
case 0:
|
|
60694
60869
|
{
|
|
@@ -61113,14 +61288,16 @@ Object .assign (Object .setPrototypeOf (ExamineViewer .prototype, Navigation_X3D
|
|
|
61113
61288
|
},
|
|
61114
61289
|
pan: (() =>
|
|
61115
61290
|
{
|
|
61116
|
-
const
|
|
61291
|
+
const
|
|
61292
|
+
userOrientation = new Numbers_Rotation4 (),
|
|
61293
|
+
fromPoint = new Numbers_Vector3 ();
|
|
61117
61294
|
|
|
61118
61295
|
return function (x, y)
|
|
61119
61296
|
{
|
|
61120
61297
|
const
|
|
61121
61298
|
viewpoint = this .getActiveViewpoint (),
|
|
61122
61299
|
toPoint = this .getPointOnCenterPlane (x, y, this .toPoint),
|
|
61123
|
-
translation = viewpoint .getUserOrientation () .multVecRot (fromPoint .assign (this .fromPoint) .subtract (toPoint));
|
|
61300
|
+
translation = viewpoint .getUserOrientation (userOrientation) .multVecRot (fromPoint .assign (this .fromPoint) .subtract (toPoint));
|
|
61124
61301
|
|
|
61125
61302
|
this .addMove (translation, translation);
|
|
61126
61303
|
|
|
@@ -61564,7 +61741,6 @@ function X3DFlyViewer (executionContext, navigationInfo)
|
|
|
61564
61741
|
this .toVector = new Numbers_Vector3 ();
|
|
61565
61742
|
this .direction = new Numbers_Vector3 ();
|
|
61566
61743
|
this .startTime = 0;
|
|
61567
|
-
this .event = null;
|
|
61568
61744
|
this .lookAround = false;
|
|
61569
61745
|
this .orientationChaser = new Followers_OrientationChaser (executionContext);
|
|
61570
61746
|
this .rubberBand = new Rendering_ScreenLine (browser, 1, 1, 0.4);
|
|
@@ -61589,34 +61765,29 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61589
61765
|
helper.on (this, surface, "touchstart", event => this .touchstart (event));
|
|
61590
61766
|
helper.on (this, surface, "touchend", event => this .touchend (event));
|
|
61591
61767
|
|
|
61592
|
-
browser ._controlKey .addInterest ("set_controlKey__", this);
|
|
61593
|
-
|
|
61594
61768
|
// Setup look around chaser.
|
|
61595
61769
|
|
|
61596
61770
|
this .orientationChaser ._duration = X3DFlyViewer_ROTATE_TIME;
|
|
61597
61771
|
this .orientationChaser .setup ();
|
|
61598
61772
|
},
|
|
61599
|
-
set_controlKey__ ()
|
|
61600
|
-
{
|
|
61601
|
-
if (this .event && this .event .button === 0)
|
|
61602
|
-
{
|
|
61603
|
-
this .button = -1;
|
|
61604
|
-
this .mousedown (this .event);
|
|
61605
|
-
}
|
|
61606
|
-
},
|
|
61607
61773
|
mousedown (event)
|
|
61608
61774
|
{
|
|
61609
61775
|
if (this .button >= 0)
|
|
61610
61776
|
return;
|
|
61611
61777
|
|
|
61612
|
-
this .
|
|
61778
|
+
const browser = this .getBrowser ();
|
|
61613
61779
|
|
|
61614
|
-
const { x, y } =
|
|
61780
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
61615
61781
|
|
|
61616
61782
|
if (!this .isPointerInRectangle (x, y))
|
|
61617
61783
|
return;
|
|
61618
61784
|
|
|
61619
|
-
|
|
61785
|
+
this .controlKey = browser .getControlKey () || browser .getCommandKey ();
|
|
61786
|
+
this .altKey = browser .getAltKey ();
|
|
61787
|
+
|
|
61788
|
+
const button = this .getButton (event .button, this .altKey);
|
|
61789
|
+
|
|
61790
|
+
switch (button)
|
|
61620
61791
|
{
|
|
61621
61792
|
case 0:
|
|
61622
61793
|
{
|
|
@@ -61626,7 +61797,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61626
61797
|
|
|
61627
61798
|
// Start walk or fly.
|
|
61628
61799
|
|
|
61629
|
-
this .button =
|
|
61800
|
+
this .button = button;
|
|
61630
61801
|
|
|
61631
61802
|
helper.on (this, document, "mouseup", event => this .mouseup (event));
|
|
61632
61803
|
helper.on (this, document, "mousemove", event => this .mousemove (event));
|
|
@@ -61635,9 +61806,9 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61635
61806
|
|
|
61636
61807
|
this .disconnect ();
|
|
61637
61808
|
this .getActiveViewpoint () .transitionStop ();
|
|
61638
|
-
|
|
61809
|
+
browser .setCursor ("MOVE");
|
|
61639
61810
|
|
|
61640
|
-
if (this .
|
|
61811
|
+
if (this .controlKey || this .lookAround)
|
|
61641
61812
|
{
|
|
61642
61813
|
// Look around.
|
|
61643
61814
|
|
|
@@ -61653,8 +61824,8 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61653
61824
|
this .getFlyDirection (this .fromVector, this .toVector, this .direction);
|
|
61654
61825
|
this .addFly ();
|
|
61655
61826
|
|
|
61656
|
-
if (
|
|
61657
|
-
|
|
61827
|
+
if (browser .getBrowserOption ("Rubberband"))
|
|
61828
|
+
browser .finishedEvents () .addInterest ("display", this, MOVE);
|
|
61658
61829
|
}
|
|
61659
61830
|
|
|
61660
61831
|
this ._isActive = true;
|
|
@@ -61668,14 +61839,14 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61668
61839
|
|
|
61669
61840
|
// Start pan.
|
|
61670
61841
|
|
|
61671
|
-
this .button =
|
|
61842
|
+
this .button = button;
|
|
61672
61843
|
|
|
61673
61844
|
helper.on (this, document, "mouseup", event => this .mouseup (event));
|
|
61674
61845
|
helper.on (this, document, "mousemove", event => this .mousemove (event));
|
|
61675
61846
|
|
|
61676
61847
|
this .disconnect ();
|
|
61677
61848
|
this .getActiveViewpoint () .transitionStop ();
|
|
61678
|
-
|
|
61849
|
+
browser .setCursor ("MOVE");
|
|
61679
61850
|
|
|
61680
61851
|
this .fromVector .set (x, y, 0);
|
|
61681
61852
|
this .toVector .assign (this .fromVector);
|
|
@@ -61683,8 +61854,8 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61683
61854
|
|
|
61684
61855
|
this .addPan ();
|
|
61685
61856
|
|
|
61686
|
-
if (
|
|
61687
|
-
|
|
61857
|
+
if (browser .getBrowserOption ("Rubberband"))
|
|
61858
|
+
browser .finishedEvents () .addInterest ("display", this, PAN);
|
|
61688
61859
|
|
|
61689
61860
|
this ._isActive = true;
|
|
61690
61861
|
break;
|
|
@@ -61693,7 +61864,9 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61693
61864
|
},
|
|
61694
61865
|
mouseup (event)
|
|
61695
61866
|
{
|
|
61696
|
-
|
|
61867
|
+
const button = this .getButton (event .button, this .altKey);
|
|
61868
|
+
|
|
61869
|
+
if (button !== this .button)
|
|
61697
61870
|
return;
|
|
61698
61871
|
|
|
61699
61872
|
// Stop event propagation.
|
|
@@ -61704,7 +61877,6 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61704
61877
|
|
|
61705
61878
|
this .direction .set (0);
|
|
61706
61879
|
|
|
61707
|
-
this .event = null;
|
|
61708
61880
|
this .button = -1;
|
|
61709
61881
|
|
|
61710
61882
|
helper.off (this, document);
|
|
@@ -61716,15 +61888,18 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61716
61888
|
},
|
|
61717
61889
|
mousemove (event)
|
|
61718
61890
|
{
|
|
61719
|
-
const
|
|
61891
|
+
const
|
|
61892
|
+
browser = this .getBrowser (),
|
|
61893
|
+
button = this .getButton (this .button, this .altKey);
|
|
61720
61894
|
|
|
61721
|
-
|
|
61895
|
+
if (button !== this .button)
|
|
61896
|
+
return;
|
|
61722
61897
|
|
|
61723
|
-
|
|
61898
|
+
browser .addBrowserEvent ();
|
|
61724
61899
|
|
|
61725
|
-
const { x, y } =
|
|
61900
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
61726
61901
|
|
|
61727
|
-
switch (
|
|
61902
|
+
switch (button)
|
|
61728
61903
|
{
|
|
61729
61904
|
case 0:
|
|
61730
61905
|
{
|
|
@@ -61732,7 +61907,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61732
61907
|
|
|
61733
61908
|
event .preventDefault ();
|
|
61734
61909
|
|
|
61735
|
-
if (
|
|
61910
|
+
if (this .controlKey || this .lookAround)
|
|
61736
61911
|
{
|
|
61737
61912
|
// Look around
|
|
61738
61913
|
|
|
@@ -61840,7 +62015,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61840
62015
|
event = this .getBrowser () .copyEvent (event);
|
|
61841
62016
|
|
|
61842
62017
|
// End move or look around (button 0).
|
|
61843
|
-
|
|
62018
|
+
|
|
61844
62019
|
this .lookAround = false;
|
|
61845
62020
|
event .button = 0;
|
|
61846
62021
|
|
|
@@ -61881,12 +62056,13 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61881
62056
|
fly: (() =>
|
|
61882
62057
|
{
|
|
61883
62058
|
const
|
|
61884
|
-
upVector
|
|
61885
|
-
direction
|
|
61886
|
-
axis
|
|
61887
|
-
|
|
61888
|
-
|
|
61889
|
-
|
|
62059
|
+
upVector = new Numbers_Vector3 (),
|
|
62060
|
+
direction = new Numbers_Vector3 (),
|
|
62061
|
+
axis = new Numbers_Vector3 (),
|
|
62062
|
+
currentUserOrientation = new Numbers_Rotation4 (),
|
|
62063
|
+
userOrientation = new Numbers_Rotation4 (),
|
|
62064
|
+
orientationOffset = new Numbers_Rotation4 (),
|
|
62065
|
+
rubberBandRotation = new Numbers_Rotation4 ();
|
|
61890
62066
|
|
|
61891
62067
|
return function ()
|
|
61892
62068
|
{
|
|
@@ -61931,7 +62107,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61931
62107
|
userOrientation
|
|
61932
62108
|
.assign (Numbers_Rotation4 .IDENTITY)
|
|
61933
62109
|
.slerp (rubberBandRotation, weight)
|
|
61934
|
-
.multRight (viewpoint .getUserOrientation ());
|
|
62110
|
+
.multRight (viewpoint .getUserOrientation (currentUserOrientation));
|
|
61935
62111
|
|
|
61936
62112
|
// Straighten horizon of userOrientation.
|
|
61937
62113
|
|
|
@@ -61955,8 +62131,9 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61955
62131
|
pan: (() =>
|
|
61956
62132
|
{
|
|
61957
62133
|
const
|
|
61958
|
-
|
|
61959
|
-
|
|
62134
|
+
userOrientation = new Numbers_Rotation4 (),
|
|
62135
|
+
direction = new Numbers_Vector3 (),
|
|
62136
|
+
axis = new Numbers_Vector3 ();
|
|
61960
62137
|
|
|
61961
62138
|
return function ()
|
|
61962
62139
|
{
|
|
@@ -61977,7 +62154,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61977
62154
|
speedFactor *= dt;
|
|
61978
62155
|
|
|
61979
62156
|
const
|
|
61980
|
-
orientation = viewpoint .getUserOrientation () .multRight (Numbers_Rotation4 .fromVectors (viewpoint .getUserOrientation () .multVecRot (axis .assign (Numbers_Vector3 .Y_AXIS)), upVector)),
|
|
62157
|
+
orientation = viewpoint .getUserOrientation (userOrientation) .multRight (Numbers_Rotation4 .fromVectors (viewpoint .getUserOrientation (userOrientation) .multVecRot (axis .assign (Numbers_Vector3 .Y_AXIS)), upVector)),
|
|
61981
62158
|
translation = orientation .multVecRot (direction .multiply (speedFactor)),
|
|
61982
62159
|
constrained = this .getActiveLayer () .constrainTranslation (translation);
|
|
61983
62160
|
|
|
@@ -61997,8 +62174,10 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
61997
62174
|
if (this .startTime)
|
|
61998
62175
|
return;
|
|
61999
62176
|
|
|
62000
|
-
|
|
62001
|
-
|
|
62177
|
+
const browser = this .getBrowser ();
|
|
62178
|
+
|
|
62179
|
+
browser .prepareEvents () .addInterest ("fly", this);
|
|
62180
|
+
browser .addBrowserEvent ();
|
|
62002
62181
|
|
|
62003
62182
|
this .startTime = Date .now ();
|
|
62004
62183
|
},
|
|
@@ -62007,9 +62186,11 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
62007
62186
|
if (this .startTime)
|
|
62008
62187
|
return;
|
|
62009
62188
|
|
|
62189
|
+
const browser = this .getBrowser ();
|
|
62190
|
+
|
|
62010
62191
|
this .disconnect ();
|
|
62011
|
-
|
|
62012
|
-
|
|
62192
|
+
browser .prepareEvents () .addInterest ("pan", this);
|
|
62193
|
+
browser .addBrowserEvent ();
|
|
62013
62194
|
|
|
62014
62195
|
this .startTime = Date .now ();
|
|
62015
62196
|
},
|
|
@@ -62146,7 +62327,6 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, Navigation_X3DV
|
|
|
62146
62327
|
this .rubberBand .dispose ();
|
|
62147
62328
|
|
|
62148
62329
|
this .disconnect ();
|
|
62149
|
-
this .getBrowser () ._controlKey .removeInterest ("set_controlKey__", this);
|
|
62150
62330
|
|
|
62151
62331
|
helper.off (this, this .getBrowser () .getSurface ());
|
|
62152
62332
|
helper.off (this, document);
|
|
@@ -62194,7 +62374,7 @@ Object .assign (Object .setPrototypeOf (WalkViewer .prototype, Navigation_X3DFly
|
|
|
62194
62374
|
viewpoint = this .getActiveViewpoint (),
|
|
62195
62375
|
upVector = viewpoint .getUpVector ();
|
|
62196
62376
|
|
|
62197
|
-
|
|
62377
|
+
viewpoint .getUserOrientation (userOrientation);
|
|
62198
62378
|
userOrientation .multVecRot (localYAxis .assign (Numbers_Vector3 .Y_AXIS));
|
|
62199
62379
|
rotation .setVectors (localYAxis, upVector);
|
|
62200
62380
|
|
|
@@ -62228,6 +62408,7 @@ const WalkViewer_default_ = WalkViewer;
|
|
|
62228
62408
|
;// ./src/x_ite/Browser/Navigation/FlyViewer.js
|
|
62229
62409
|
|
|
62230
62410
|
|
|
62411
|
+
|
|
62231
62412
|
function FlyViewer (executionContext, navigationInfo)
|
|
62232
62413
|
{
|
|
62233
62414
|
Navigation_X3DFlyViewer .call (this, executionContext, navigationInfo);
|
|
@@ -62243,10 +62424,15 @@ Object .assign (Object .setPrototypeOf (FlyViewer .prototype, Navigation_X3DFlyV
|
|
|
62243
62424
|
{
|
|
62244
62425
|
return direction .assign (toVector) .subtract (fromVector);
|
|
62245
62426
|
},
|
|
62246
|
-
getTranslationOffset (
|
|
62427
|
+
getTranslationOffset: (() =>
|
|
62247
62428
|
{
|
|
62248
|
-
|
|
62249
|
-
|
|
62429
|
+
const userOrientation = new Numbers_Rotation4 ();
|
|
62430
|
+
|
|
62431
|
+
return function (velocity)
|
|
62432
|
+
{
|
|
62433
|
+
return this .getActiveViewpoint () .getUserOrientation (userOrientation) .multVecRot (velocity);
|
|
62434
|
+
};
|
|
62435
|
+
})(),
|
|
62250
62436
|
constrainPanDirection (direction)
|
|
62251
62437
|
{
|
|
62252
62438
|
return direction;
|
|
@@ -62273,6 +62459,8 @@ const FlyViewer_default_ = FlyViewer;
|
|
|
62273
62459
|
|
|
62274
62460
|
|
|
62275
62461
|
|
|
62462
|
+
|
|
62463
|
+
|
|
62276
62464
|
const
|
|
62277
62465
|
PlaneViewer_SLOW_SCROLL = /Mac OS X|OculusBrowser/i .test (navigator .userAgent),
|
|
62278
62466
|
PlaneViewer_SCROLL_FACTOR = PlaneViewer_SLOW_SCROLL ? 1 / 160 : 1 / 20;
|
|
@@ -62306,6 +62494,7 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62306
62494
|
|
|
62307
62495
|
helper.on (this, surface, "mousedown", event => this .mousedown (event));
|
|
62308
62496
|
helper.on (this, surface, "mouseup", event => this .mouseup (event));
|
|
62497
|
+
helper.on (this, surface, "dblclick", event => this .dblclick (event));
|
|
62309
62498
|
helper.on (this, surface, "wheel", event => this .wheel (event));
|
|
62310
62499
|
|
|
62311
62500
|
helper.on (this, surface, "touchstart", event => this .touchstart (event));
|
|
@@ -62316,12 +62505,18 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62316
62505
|
if (this .button >= 0)
|
|
62317
62506
|
return;
|
|
62318
62507
|
|
|
62319
|
-
const
|
|
62508
|
+
const browser = this .getBrowser ();
|
|
62509
|
+
|
|
62510
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
62320
62511
|
|
|
62321
62512
|
if (!this .isPointerInRectangle (x, y))
|
|
62322
62513
|
return;
|
|
62323
62514
|
|
|
62324
|
-
|
|
62515
|
+
this .altKey = browser .getAltKey ();
|
|
62516
|
+
|
|
62517
|
+
const button = this .getButton (event .button, this .altKey);
|
|
62518
|
+
|
|
62519
|
+
switch (button)
|
|
62325
62520
|
{
|
|
62326
62521
|
case 0:
|
|
62327
62522
|
{
|
|
@@ -62331,7 +62526,21 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62331
62526
|
|
|
62332
62527
|
// Start move.
|
|
62333
62528
|
|
|
62334
|
-
this .button =
|
|
62529
|
+
this .button = button;
|
|
62530
|
+
|
|
62531
|
+
helper.on (this, document, "mouseup", event => this .mouseup (event));
|
|
62532
|
+
helper.on (this, document, "touchend", event => this .touchend (event));
|
|
62533
|
+
break;
|
|
62534
|
+
}
|
|
62535
|
+
case 1:
|
|
62536
|
+
{
|
|
62537
|
+
// Stop event propagation.
|
|
62538
|
+
|
|
62539
|
+
event .preventDefault ();
|
|
62540
|
+
|
|
62541
|
+
// Start move.
|
|
62542
|
+
|
|
62543
|
+
this .button = button;
|
|
62335
62544
|
|
|
62336
62545
|
helper.on (this, document, "mouseup", event => this .mouseup (event));
|
|
62337
62546
|
helper.on (this, document, "mousemove", event => this .mousemove (event));
|
|
@@ -62339,7 +62548,7 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62339
62548
|
helper.on (this, document, "touchmove", event => this .touchmove (event));
|
|
62340
62549
|
|
|
62341
62550
|
this .getActiveViewpoint () .transitionStop ();
|
|
62342
|
-
|
|
62551
|
+
browser .setCursor ("MOVE");
|
|
62343
62552
|
|
|
62344
62553
|
this .getPointOnCenterPlane (x, y, this .fromPoint);
|
|
62345
62554
|
|
|
@@ -62350,7 +62559,9 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62350
62559
|
},
|
|
62351
62560
|
mouseup (event)
|
|
62352
62561
|
{
|
|
62353
|
-
|
|
62562
|
+
const button = this .getButton (event .button, this .altKey);
|
|
62563
|
+
|
|
62564
|
+
if (button !== this .button)
|
|
62354
62565
|
return;
|
|
62355
62566
|
|
|
62356
62567
|
// Stop event propagation.
|
|
@@ -62367,13 +62578,40 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62367
62578
|
|
|
62368
62579
|
this ._isActive = false;
|
|
62369
62580
|
},
|
|
62581
|
+
dblclick (event)
|
|
62582
|
+
{
|
|
62583
|
+
// Stop event propagation.
|
|
62584
|
+
|
|
62585
|
+
event .preventDefault ();
|
|
62586
|
+
|
|
62587
|
+
if (!DEVELOPMENT)
|
|
62588
|
+
return;
|
|
62589
|
+
|
|
62590
|
+
// Look at.
|
|
62591
|
+
|
|
62592
|
+
const browser = this .getBrowser ();
|
|
62593
|
+
|
|
62594
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
62595
|
+
|
|
62596
|
+
this .disconnect ();
|
|
62597
|
+
|
|
62598
|
+
if (browser .getAltKey ())
|
|
62599
|
+
this .lookAtPoint (x, y, this .getStraightenHorizon ());
|
|
62600
|
+
else
|
|
62601
|
+
this .lookAtBBox (x, y, this .getStraightenHorizon ());
|
|
62602
|
+
},
|
|
62370
62603
|
mousemove (event)
|
|
62371
62604
|
{
|
|
62605
|
+
const button = this .getButton (this .button, this .altKey);
|
|
62606
|
+
|
|
62607
|
+
if (button !== this .button)
|
|
62608
|
+
return;
|
|
62609
|
+
|
|
62372
62610
|
const { x, y } = this .getBrowser () .getPointerFromEvent (event);
|
|
62373
62611
|
|
|
62374
|
-
switch (
|
|
62612
|
+
switch (button)
|
|
62375
62613
|
{
|
|
62376
|
-
case
|
|
62614
|
+
case 1:
|
|
62377
62615
|
{
|
|
62378
62616
|
// Stop event propagation.
|
|
62379
62617
|
|
|
@@ -62443,11 +62681,30 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62443
62681
|
|
|
62444
62682
|
switch (touches .length)
|
|
62445
62683
|
{
|
|
62684
|
+
case 1:
|
|
62685
|
+
{
|
|
62686
|
+
// Start tab (button 0).
|
|
62687
|
+
|
|
62688
|
+
event .button = 0;
|
|
62689
|
+
event .pageX = touches [0] .pageX;
|
|
62690
|
+
event .pageY = touches [0] .pageY;
|
|
62691
|
+
|
|
62692
|
+
this .mousedown (event);
|
|
62693
|
+
|
|
62694
|
+
// Remember tap.
|
|
62695
|
+
|
|
62696
|
+
this .touch1 .set (touches [0] .pageX, touches [0] .pageY);
|
|
62697
|
+
break;
|
|
62698
|
+
}
|
|
62446
62699
|
case 2:
|
|
62447
62700
|
{
|
|
62701
|
+
// End tab (button 0).
|
|
62702
|
+
|
|
62703
|
+
this .touchend (event);
|
|
62704
|
+
|
|
62448
62705
|
// Start move (button 1).
|
|
62449
62706
|
|
|
62450
|
-
event .button =
|
|
62707
|
+
event .button = 1;
|
|
62451
62708
|
event .pageX = (touches [0] .pageX + touches [1] .pageX) / 2;
|
|
62452
62709
|
event .pageY = (touches [0] .pageY + touches [1] .pageY) / 2;
|
|
62453
62710
|
|
|
@@ -62465,12 +62722,44 @@ Object .assign (Object .setPrototypeOf (PlaneViewer .prototype, Navigation_X3DVi
|
|
|
62465
62722
|
{
|
|
62466
62723
|
event = this .getBrowser () .copyEvent (event);
|
|
62467
62724
|
|
|
62468
|
-
|
|
62725
|
+
switch (this .button)
|
|
62726
|
+
{
|
|
62727
|
+
case 0:
|
|
62728
|
+
{
|
|
62729
|
+
// End tab (button 0).
|
|
62730
|
+
|
|
62731
|
+
event .button = 0;
|
|
62732
|
+
event .pageX = this .touch1 .x;
|
|
62733
|
+
event .pageY = this .touch1 .y;
|
|
62469
62734
|
|
|
62470
|
-
|
|
62471
|
-
event .button = 0;
|
|
62735
|
+
this .mouseup (event);
|
|
62472
62736
|
|
|
62473
|
-
|
|
62737
|
+
// Start dblclick (button 0).
|
|
62738
|
+
|
|
62739
|
+
if (this .tapedTwice)
|
|
62740
|
+
{
|
|
62741
|
+
this .dblclick (event);
|
|
62742
|
+
}
|
|
62743
|
+
else
|
|
62744
|
+
{
|
|
62745
|
+
this .tapedTwice = true;
|
|
62746
|
+
|
|
62747
|
+
setTimeout (() => this .tapedTwice = false, 300);
|
|
62748
|
+
}
|
|
62749
|
+
|
|
62750
|
+
break;
|
|
62751
|
+
}
|
|
62752
|
+
case 1:
|
|
62753
|
+
{
|
|
62754
|
+
// End move (button 0).
|
|
62755
|
+
|
|
62756
|
+
this .touchMode = 0;
|
|
62757
|
+
event .button = 1;
|
|
62758
|
+
|
|
62759
|
+
this .mouseup (event);
|
|
62760
|
+
break;
|
|
62761
|
+
}
|
|
62762
|
+
}
|
|
62474
62763
|
},
|
|
62475
62764
|
touchmove: (() =>
|
|
62476
62765
|
{
|
|
@@ -62724,22 +63013,26 @@ Object .assign (Object .setPrototypeOf (LookAtViewer .prototype, Navigation_X3DV
|
|
|
62724
63013
|
|
|
62725
63014
|
// Look at.
|
|
62726
63015
|
|
|
62727
|
-
const
|
|
63016
|
+
const browser = this .getBrowser ();
|
|
63017
|
+
|
|
63018
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
62728
63019
|
|
|
62729
63020
|
this .disconnect ();
|
|
62730
63021
|
|
|
62731
|
-
if (
|
|
63022
|
+
if (browser .getAltKey ())
|
|
62732
63023
|
this .lookAtPoint (x, y, this .getStraightenHorizon ());
|
|
62733
63024
|
else
|
|
62734
63025
|
this .lookAtBBox (x, y, this .getStraightenHorizon ());
|
|
62735
63026
|
},
|
|
62736
63027
|
mousemove (event)
|
|
62737
63028
|
{
|
|
62738
|
-
this .getBrowser ()
|
|
63029
|
+
const browser = this .getBrowser ();
|
|
63030
|
+
|
|
63031
|
+
browser .addBrowserEvent ();
|
|
62739
63032
|
|
|
62740
63033
|
this .event = event;
|
|
62741
63034
|
|
|
62742
|
-
const { x, y } =
|
|
63035
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
62743
63036
|
|
|
62744
63037
|
switch (this .button)
|
|
62745
63038
|
{
|
|
@@ -64004,11 +64297,12 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
|
|
|
64004
64297
|
{
|
|
64005
64298
|
const surface = this .getBrowser () .getSurface ();
|
|
64006
64299
|
|
|
64007
|
-
helper.on (this, surface, "mousedown",
|
|
64008
|
-
helper.on (this, surface, "mouseup",
|
|
64009
|
-
helper.on (this, surface, "dblclick",
|
|
64010
|
-
helper.on (this, surface, "mousemove",
|
|
64011
|
-
helper.on (this, surface, "
|
|
64300
|
+
helper.on (this, surface, "mousedown", event => this .mousedown (event));
|
|
64301
|
+
helper.on (this, surface, "mouseup", event => this .mouseup (event));
|
|
64302
|
+
helper.on (this, surface, "dblclick", event => this .dblclick (event));
|
|
64303
|
+
helper.on (this, surface, "mousemove", event => this .mousemove (event));
|
|
64304
|
+
helper.on (this, surface, "mouseenter", event => this .onmouseenter (event));
|
|
64305
|
+
helper.on (this, surface, "mouseout", event => this .onmouseout (event));
|
|
64012
64306
|
|
|
64013
64307
|
helper.on (this, surface, "touchstart", event => this .touchstart (event));
|
|
64014
64308
|
helper.on (this, surface, "touchend", event => this .touchend (event));
|
|
@@ -64019,8 +64313,6 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
|
|
|
64019
64313
|
browser = this .getBrowser (),
|
|
64020
64314
|
surface = browser .getSurface ();
|
|
64021
64315
|
|
|
64022
|
-
browser .getElement () .focus ();
|
|
64023
|
-
|
|
64024
64316
|
if (browser .getShiftKey () && (browser .getControlKey () || browser .getCommandKey ()))
|
|
64025
64317
|
return;
|
|
64026
64318
|
|
|
@@ -64114,6 +64406,10 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
|
|
|
64114
64406
|
},
|
|
64115
64407
|
touchstart (event)
|
|
64116
64408
|
{
|
|
64409
|
+
const browser = this .getBrowser ();
|
|
64410
|
+
|
|
64411
|
+
browser .getElement () .focus ({ preventScroll: true });
|
|
64412
|
+
|
|
64117
64413
|
const touches = event .touches;
|
|
64118
64414
|
|
|
64119
64415
|
switch (touches .length)
|
|
@@ -64122,7 +64418,7 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
|
|
|
64122
64418
|
{
|
|
64123
64419
|
// button 0.
|
|
64124
64420
|
|
|
64125
|
-
event =
|
|
64421
|
+
event = browser .copyEvent (event);
|
|
64126
64422
|
|
|
64127
64423
|
event .button = 0;
|
|
64128
64424
|
event .pageX = touches [0] .pageX;
|
|
@@ -64132,7 +64428,7 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
|
|
|
64132
64428
|
|
|
64133
64429
|
// Show context menu on long tab.
|
|
64134
64430
|
|
|
64135
|
-
const hit =
|
|
64431
|
+
const hit = browser .getHit ();
|
|
64136
64432
|
|
|
64137
64433
|
if (!hit .id || !hit .sensors .size)
|
|
64138
64434
|
{
|
|
@@ -64197,6 +64493,10 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, Base_X3DBaseN
|
|
|
64197
64493
|
else
|
|
64198
64494
|
browser .setCursor (this .grabbing && move ? "GRABBING" : "DEFAULT");
|
|
64199
64495
|
},
|
|
64496
|
+
onmouseenter ()
|
|
64497
|
+
{
|
|
64498
|
+
this .getBrowser () .getElement () .focus ({ preventScroll: true });
|
|
64499
|
+
},
|
|
64200
64500
|
onmouseout ()
|
|
64201
64501
|
{
|
|
64202
64502
|
this .getBrowser () .leaveNotifyEvent ();
|
|
@@ -71298,7 +71598,6 @@ Object .assign (X3DShapeContext .prototype,
|
|
|
71298
71598
|
|
|
71299
71599
|
lineFillTextureProperties ._minificationFilter = "NEAREST_PIXEL";
|
|
71300
71600
|
lineFillTextureProperties ._magnificationFilter = "NEAREST_PIXEL";
|
|
71301
|
-
lineFillTextureProperties ._textureCompression = "DEFAULT";
|
|
71302
71601
|
|
|
71303
71602
|
lineFillTextureProperties .setup ();
|
|
71304
71603
|
|
|
@@ -71329,8 +71628,7 @@ Object .assign (X3DShapeContext .prototype,
|
|
|
71329
71628
|
],
|
|
71330
71629
|
[ ],
|
|
71331
71630
|
[ ],
|
|
71332
|
-
]
|
|
71333
|
-
[pass];
|
|
71631
|
+
] [pass];
|
|
71334
71632
|
|
|
71335
71633
|
const transformFeedbackVaryings = [
|
|
71336
71634
|
[
|
|
@@ -71348,8 +71646,7 @@ Object .assign (X3DShapeContext .prototype,
|
|
|
71348
71646
|
"instanceNormalMatrix1", "tangent1", "normal1",
|
|
71349
71647
|
"instanceNormalMatrix2", "tangent2", "normal2",
|
|
71350
71648
|
],
|
|
71351
|
-
]
|
|
71352
|
-
[pass];
|
|
71649
|
+
] [pass];
|
|
71353
71650
|
|
|
71354
71651
|
return this .createShader ({
|
|
71355
71652
|
name: `LineTransform${instanced ? "Instanced" : ""}`,
|
|
@@ -71777,6 +72074,8 @@ const TextureTransform_default_ = TextureTransform;
|
|
|
71777
72074
|
;// ./src/x_ite/Browser/Texturing/KTXDecoder.js
|
|
71778
72075
|
|
|
71779
72076
|
|
|
72077
|
+
// https://github.khronos.org/KTX-Software/ktxjswrappers/libktx_js.html
|
|
72078
|
+
|
|
71780
72079
|
const KTXDecoder_default_ = class KTXDecoder
|
|
71781
72080
|
{
|
|
71782
72081
|
constructor (gl, externalKtxlib, scriptDir)
|
|
@@ -71818,7 +72117,7 @@ const KTXDecoder_default_ = class KTXDecoder
|
|
|
71818
72117
|
}
|
|
71819
72118
|
else if (dxtSupported)
|
|
71820
72119
|
{
|
|
71821
|
-
formatString = ktxTexture.numComponents
|
|
72120
|
+
formatString = ktxTexture.numComponents === 4 ? "BC3" : "BC1";
|
|
71822
72121
|
format = transcode_fmt .BC1_OR_3;
|
|
71823
72122
|
}
|
|
71824
72123
|
else if (pvrtcSupported)
|
|
@@ -71866,6 +72165,9 @@ const KTXDecoder_default_ = class KTXDecoder
|
|
|
71866
72165
|
// return this .loadKTXFromBuffer (await response .arrayBuffer ());
|
|
71867
72166
|
// }
|
|
71868
72167
|
|
|
72168
|
+
// https://github.com/KhronosGroup/KTX-Software/issues/327
|
|
72169
|
+
#numComponents = [0, 3, 4];
|
|
72170
|
+
|
|
71869
72171
|
async loadKTXFromBuffer (arrayBuffer)
|
|
71870
72172
|
{
|
|
71871
72173
|
await this .initialized;
|
|
@@ -71879,7 +72181,7 @@ const KTXDecoder_default_ = class KTXDecoder
|
|
|
71879
72181
|
texture .baseWidth = ktxTexture .baseWidth;
|
|
71880
72182
|
texture .baseHeight = ktxTexture .baseHeight;
|
|
71881
72183
|
texture .baseDepth = ktxTexture .baseDepth ?? 1; // TODO: No support.
|
|
71882
|
-
texture .numComponents = ktxTexture .numComponents;
|
|
72184
|
+
texture .numComponents = this .#numComponents [ktxTexture .numComponents] ?? ktxTexture .numComponents;
|
|
71883
72185
|
texture .target = uploadResult .target;
|
|
71884
72186
|
|
|
71885
72187
|
ktxTexture .delete ();
|
|
@@ -72142,8 +72444,8 @@ Object .assign (X3DTexturingContext .prototype,
|
|
|
72142
72444
|
{
|
|
72143
72445
|
case TextureQuality .LOW:
|
|
72144
72446
|
{
|
|
72145
|
-
textureProperties ._magnificationFilter = "
|
|
72146
|
-
textureProperties ._minificationFilter = "
|
|
72447
|
+
textureProperties ._magnificationFilter = "FASTEST";
|
|
72448
|
+
textureProperties ._minificationFilter = "FASTEST";
|
|
72147
72449
|
textureProperties ._textureCompression = "FASTEST";
|
|
72148
72450
|
|
|
72149
72451
|
gl .hint (gl .GENERATE_MIPMAP_HINT, gl .FASTEST);
|
|
@@ -72152,7 +72454,7 @@ Object .assign (X3DTexturingContext .prototype,
|
|
|
72152
72454
|
case TextureQuality .MEDIUM:
|
|
72153
72455
|
{
|
|
72154
72456
|
textureProperties ._magnificationFilter = "NICEST";
|
|
72155
|
-
textureProperties ._minificationFilter = "
|
|
72457
|
+
textureProperties ._minificationFilter = "AVG_PIXEL_NEAREST_MIPMAP";
|
|
72156
72458
|
textureProperties ._textureCompression = "NICEST";
|
|
72157
72459
|
|
|
72158
72460
|
gl .hint (gl .GENERATE_MIPMAP_HINT, gl .FASTEST);
|
|
@@ -79106,14 +79408,14 @@ Object .assign (Object .setPrototypeOf (TextureCoordinateGenerator .prototype, T
|
|
|
79106
79408
|
const modes = new Map ([
|
|
79107
79409
|
... Object .entries (TextureCoordinateGeneratorModeType),
|
|
79108
79410
|
// Legacy Enums
|
|
79109
|
-
["CAMERASPACENORMAL",
|
|
79110
|
-
["CAMERASPACEPOSITION",
|
|
79111
|
-
["CAMERASPACEREFLECTIONVECTOR",
|
|
79112
|
-
["SPHERE-LOCAL",
|
|
79113
|
-
["COORD-EYE",
|
|
79114
|
-
["NOISE-EYE",
|
|
79115
|
-
["SPHERE-REFLECT",
|
|
79116
|
-
["SPHERE-REFLECT-LOCAL",
|
|
79411
|
+
["CAMERASPACENORMAL", TextureCoordinateGeneratorModeType .CAMERA_SPACE_NORMAL],
|
|
79412
|
+
["CAMERASPACEPOSITION", TextureCoordinateGeneratorModeType .CAMERA_SPACE_POSITION],
|
|
79413
|
+
["CAMERASPACEREFLECTIONVECTOR", TextureCoordinateGeneratorModeType .CAMERA_SPACE_REFLECTION_VECTOR],
|
|
79414
|
+
["SPHERE-LOCAL", TextureCoordinateGeneratorModeType .SPHERE_LOCAL],
|
|
79415
|
+
["COORD-EYE", TextureCoordinateGeneratorModeType .COORD_EYE],
|
|
79416
|
+
["NOISE-EYE", TextureCoordinateGeneratorModeType .NOISE_EYE],
|
|
79417
|
+
["SPHERE-REFLECT", TextureCoordinateGeneratorModeType .SPHERE_REFLECT],
|
|
79418
|
+
["SPHERE-REFLECT-LOCAL", TextureCoordinateGeneratorModeType .SPHERE_REFLECT_LOCAL],
|
|
79117
79419
|
]);
|
|
79118
79420
|
|
|
79119
79421
|
return function ()
|
|
@@ -81486,7 +81788,7 @@ Object .assign (Object .setPrototypeOf (EnvironmentLight .prototype, Lighting_X3
|
|
|
81486
81788
|
texture: this .specularTexture,
|
|
81487
81789
|
distribution: Lighting_Distribution .LAMBERTIAN,
|
|
81488
81790
|
sampleCount: 2048,
|
|
81489
|
-
|
|
81791
|
+
roughnesses: [0],
|
|
81490
81792
|
flipX: !this .traverseSpecular,
|
|
81491
81793
|
cachedNode: this .generatedDiffuseTexture,
|
|
81492
81794
|
});
|
|
@@ -81505,15 +81807,15 @@ Object .assign (Object .setPrototypeOf (EnvironmentLight .prototype, Lighting_X3
|
|
|
81505
81807
|
console .info ("Generating specular texture for EnvironmentLight.");
|
|
81506
81808
|
|
|
81507
81809
|
const
|
|
81508
|
-
levels
|
|
81509
|
-
|
|
81810
|
+
levels = this .specularTexture .getLevels (),
|
|
81811
|
+
roughnesses = Array .from ({ length: levels + 1 }, (_, i) => i / (levels || 1));
|
|
81510
81812
|
|
|
81511
81813
|
return browser .filterEnvironmentTexture ({
|
|
81512
81814
|
name: "GeneratedSpecularTexture",
|
|
81513
81815
|
texture: this .specularTexture,
|
|
81514
81816
|
distribution: Lighting_Distribution .GGX,
|
|
81515
81817
|
sampleCount: 1024,
|
|
81516
|
-
|
|
81818
|
+
roughnesses,
|
|
81517
81819
|
flipX: !this .traverseSpecular,
|
|
81518
81820
|
cachedNode: this .generatedSpecularTexture,
|
|
81519
81821
|
});
|
|
@@ -81532,15 +81834,15 @@ Object .assign (Object .setPrototypeOf (EnvironmentLight .prototype, Lighting_X3
|
|
|
81532
81834
|
console .info ("Generating sheen texture for EnvironmentLight.");
|
|
81533
81835
|
|
|
81534
81836
|
const
|
|
81535
|
-
levels
|
|
81536
|
-
|
|
81837
|
+
levels = this .specularTexture .getLevels (),
|
|
81838
|
+
roughnesses = Array .from ({ length: levels + 1 }, (_, i) => Math .max (i / (levels || 1), 2, 0.000001));
|
|
81537
81839
|
|
|
81538
81840
|
return browser .filterEnvironmentTexture ({
|
|
81539
81841
|
name: "GeneratedSheenTexture",
|
|
81540
81842
|
texture: this .specularTexture,
|
|
81541
81843
|
distribution: Lighting_Distribution .CHARLIE,
|
|
81542
81844
|
sampleCount: 64,
|
|
81543
|
-
|
|
81845
|
+
roughnesses,
|
|
81544
81846
|
flipX: !this .traverseSpecular,
|
|
81545
81847
|
cachedNode: this .generatedSheenTexture,
|
|
81546
81848
|
});
|
|
@@ -89649,6 +89951,10 @@ Object .assign (Object .setPrototypeOf (MicrophoneSource .prototype, Sound_X3DSo
|
|
|
89649
89951
|
this .mediaStreamAudioSourceNode = null;
|
|
89650
89952
|
this .restore = restore;
|
|
89651
89953
|
},
|
|
89954
|
+
set_time ()
|
|
89955
|
+
{
|
|
89956
|
+
this ._elapsedTime = this .getElapsedTime ();
|
|
89957
|
+
},
|
|
89652
89958
|
});
|
|
89653
89959
|
|
|
89654
89960
|
Object .defineProperties (MicrophoneSource,
|
|
@@ -89803,6 +90109,10 @@ Object .assign (Object .setPrototypeOf (OscillatorSource .prototype, Sound_X3DSo
|
|
|
89803
90109
|
this .oscillatorNode .stop ();
|
|
89804
90110
|
this .oscillatorNode .disconnect ();
|
|
89805
90111
|
},
|
|
90112
|
+
set_time ()
|
|
90113
|
+
{
|
|
90114
|
+
this ._elapsedTime = this .getElapsedTime ();
|
|
90115
|
+
},
|
|
89806
90116
|
});
|
|
89807
90117
|
|
|
89808
90118
|
Object .defineProperties (OscillatorSource,
|
|
@@ -90959,8 +91269,8 @@ const PNGMedia_default_ = PNGMedia;
|
|
|
90959
91269
|
|
|
90960
91270
|
/* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
|
|
90961
91271
|
;// ./src/x_ite/Components/Texturing/MovieTexture.js
|
|
90962
|
-
/* provided dependency */ var SuperGif = __webpack_require__(
|
|
90963
|
-
/* provided dependency */ var APNG = __webpack_require__(
|
|
91272
|
+
/* provided dependency */ var SuperGif = __webpack_require__(548);
|
|
91273
|
+
/* provided dependency */ var APNG = __webpack_require__(174);
|
|
90964
91274
|
|
|
90965
91275
|
|
|
90966
91276
|
|
|
@@ -91320,37 +91630,23 @@ Object .assign (Object .setPrototypeOf (MultiTexture .prototype, Texturing_X3DTe
|
|
|
91320
91630
|
},
|
|
91321
91631
|
getMode (index)
|
|
91322
91632
|
{
|
|
91323
|
-
|
|
91324
|
-
return this .modes [index];
|
|
91325
|
-
|
|
91326
|
-
return Texturing_ModeType .MODULATE;
|
|
91633
|
+
return this .modes [index] ?? Texturing_ModeType .MODULATE;
|
|
91327
91634
|
},
|
|
91328
91635
|
getAlphaMode (index)
|
|
91329
91636
|
{
|
|
91330
|
-
|
|
91331
|
-
return this .alphaModes [index];
|
|
91332
|
-
|
|
91333
|
-
return Texturing_ModeType .MODULATE;
|
|
91637
|
+
return this .alphaModes [index] ?? Texturing_ModeType .MODULATE;
|
|
91334
91638
|
},
|
|
91335
91639
|
getSource (index)
|
|
91336
91640
|
{
|
|
91337
|
-
|
|
91338
|
-
return this .sources [index];
|
|
91339
|
-
|
|
91340
|
-
return Texturing_SourceType .DEFAULT;
|
|
91641
|
+
return this .sources [index] ?? Texturing_SourceType .DEFAULT;
|
|
91341
91642
|
},
|
|
91342
91643
|
getFunction (index)
|
|
91343
91644
|
{
|
|
91344
|
-
|
|
91345
|
-
return this .functions [index];
|
|
91346
|
-
|
|
91347
|
-
return Texturing_FunctionType .DEFAULT;
|
|
91645
|
+
return this .functions [index] ?? Texturing_FunctionType .DEFAULT;
|
|
91348
91646
|
},
|
|
91349
91647
|
set_color__ ()
|
|
91350
91648
|
{
|
|
91351
|
-
this .color
|
|
91352
|
-
this .color [1] = this ._color .g;
|
|
91353
|
-
this .color [2] = this ._color .b;
|
|
91649
|
+
this .color .set (this ._color .getValue ());
|
|
91354
91650
|
},
|
|
91355
91651
|
set_alpha__ ()
|
|
91356
91652
|
{
|
|
@@ -91359,16 +91655,13 @@ Object .assign (Object .setPrototypeOf (MultiTexture .prototype, Texturing_X3DTe
|
|
|
91359
91655
|
set_mode__: (() =>
|
|
91360
91656
|
{
|
|
91361
91657
|
const modeTypes = new Map ([
|
|
91362
|
-
|
|
91363
|
-
|
|
91364
|
-
["MODULATE", Texturing_ModeType .MODULATE],
|
|
91658
|
+
... Object .entries (Texturing_ModeType),
|
|
91659
|
+
// Legacy
|
|
91365
91660
|
["MODULATE2X", Texturing_ModeType .MODULATE_2X],
|
|
91366
91661
|
["MODULATE4X", Texturing_ModeType .MODULATE_4X],
|
|
91367
|
-
["ADD", Texturing_ModeType .ADD],
|
|
91368
91662
|
["ADDSIGNED", Texturing_ModeType .ADD_SIGNED],
|
|
91369
91663
|
["ADDSIGNED2X", Texturing_ModeType .ADD_SIGNED_2X],
|
|
91370
91664
|
["ADDSMOOTH", Texturing_ModeType .ADD_SMOOTH],
|
|
91371
|
-
["SUBTRACT", Texturing_ModeType .SUBTRACT],
|
|
91372
91665
|
["BLENDDIFFUSEALPHA", Texturing_ModeType .BLEND_DIFFUSE_ALPHA],
|
|
91373
91666
|
["BLENDTEXTUREALPHA", Texturing_ModeType .BLEND_TEXTURE_ALPHA],
|
|
91374
91667
|
["BLENDFACTORALPHA", Texturing_ModeType .BLEND_FACTOR_ALPHA],
|
|
@@ -91379,7 +91672,6 @@ Object .assign (Object .setPrototypeOf (MultiTexture .prototype, Texturing_X3DTe
|
|
|
91379
91672
|
["DOTPRODUCT3", Texturing_ModeType .DOT_PRODUCT_3],
|
|
91380
91673
|
["SELECTARG1", Texturing_ModeType .SELECT_ARG1],
|
|
91381
91674
|
["SELECTARG2", Texturing_ModeType .SELECT_ARG2],
|
|
91382
|
-
["OFF", Texturing_ModeType .OFF],
|
|
91383
91675
|
]);
|
|
91384
91676
|
|
|
91385
91677
|
return function ()
|
|
@@ -91391,56 +91683,26 @@ Object .assign (Object .setPrototypeOf (MultiTexture .prototype, Texturing_X3DTe
|
|
|
91391
91683
|
{
|
|
91392
91684
|
const mode = modes .split (",");
|
|
91393
91685
|
|
|
91394
|
-
for (let m = 0, l = mode .length; m < l; ++ m)
|
|
91395
|
-
mode [m] = mode [m] .trim ();
|
|
91396
|
-
|
|
91397
|
-
if (mode .length === 0)
|
|
91398
|
-
mode .push ("MODULATE");
|
|
91399
|
-
|
|
91400
91686
|
if (mode .length < 2)
|
|
91401
91687
|
mode .push (mode [0]);
|
|
91402
91688
|
|
|
91403
|
-
// RGB
|
|
91404
|
-
|
|
91405
|
-
const modeType = modeTypes .get (mode [0]);
|
|
91406
|
-
|
|
91407
|
-
if (modeType !== undefined)
|
|
91408
|
-
this .modes .push (modeType);
|
|
91409
|
-
else
|
|
91410
|
-
this .modes .push (Texturing_ModeType .MODULATE);
|
|
91411
|
-
|
|
91412
|
-
// Alpha
|
|
91689
|
+
// RGB, Alpha
|
|
91413
91690
|
|
|
91414
|
-
|
|
91415
|
-
|
|
91416
|
-
if (alphaModeType !== undefined)
|
|
91417
|
-
this .alphaModes .push (alphaModeType);
|
|
91418
|
-
else
|
|
91419
|
-
this .alphaModes .push (Texturing_ModeType .MODULATE);
|
|
91691
|
+
this .modes .push (modeTypes .get (mode [0] .trim ()) ?? Texturing_ModeType .MODULATE);
|
|
91692
|
+
this .alphaModes .push (modeTypes .get (mode [1] .trim ()) ?? Texturing_ModeType .MODULATE);
|
|
91420
91693
|
}
|
|
91421
91694
|
};
|
|
91422
91695
|
})(),
|
|
91423
91696
|
set_source__: (() =>
|
|
91424
91697
|
{
|
|
91425
|
-
const sourceTypes = new Map (
|
|
91426
|
-
["DIFFUSE", Texturing_SourceType .DIFFUSE],
|
|
91427
|
-
["SPECULAR", Texturing_SourceType .SPECULAR],
|
|
91428
|
-
["FACTOR", Texturing_SourceType .FACTOR],
|
|
91429
|
-
]);
|
|
91698
|
+
const sourceTypes = new Map (Object .entries (Texturing_SourceType));
|
|
91430
91699
|
|
|
91431
91700
|
return function ()
|
|
91432
91701
|
{
|
|
91433
91702
|
this .sources .length = 0;
|
|
91434
91703
|
|
|
91435
91704
|
for (const source of this ._source)
|
|
91436
|
-
|
|
91437
|
-
const sourceType = sourceTypes .get (source);
|
|
91438
|
-
|
|
91439
|
-
if (sourceType !== undefined)
|
|
91440
|
-
this .sources .push (sourceType);
|
|
91441
|
-
else
|
|
91442
|
-
this .sources .push (Texturing_SourceType .DEFAULT);
|
|
91443
|
-
}
|
|
91705
|
+
this .sources .push (sourceTypes .get (source) ?? Texturing_SourceType .DEFAULT);
|
|
91444
91706
|
};
|
|
91445
91707
|
})(),
|
|
91446
91708
|
set_function__: (() =>
|
|
@@ -91456,14 +91718,7 @@ Object .assign (Object .setPrototypeOf (MultiTexture .prototype, Texturing_X3DTe
|
|
|
91456
91718
|
this .functions .length = 0;
|
|
91457
91719
|
|
|
91458
91720
|
for (const func of this ._function)
|
|
91459
|
-
|
|
91460
|
-
const functionsType = functionsTypes .get (func);
|
|
91461
|
-
|
|
91462
|
-
if (functionsType !== undefined)
|
|
91463
|
-
this .functions .push (functionsType);
|
|
91464
|
-
else
|
|
91465
|
-
this .functions .push (Texturing_FunctionType .DEFAULT);
|
|
91466
|
-
}
|
|
91721
|
+
this .functions .push (functionsTypes .get (func) ?? Texturing_FunctionType .DEFAULT);
|
|
91467
91722
|
};
|
|
91468
91723
|
})(),
|
|
91469
91724
|
set_texture__ ()
|
|
@@ -93143,7 +93398,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
|
|
|
93143
93398
|
layerNode = Base_X3DCast (Base_X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
93144
93399
|
transitionTime = +transitionTime;
|
|
93145
93400
|
|
|
93146
|
-
layerNode ?.viewAll (transitionTime,
|
|
93401
|
+
layerNode ?.viewAll ({ transitionTime, straighten: this .getBrowserOption ("StraightenHorizon") });
|
|
93147
93402
|
},
|
|
93148
93403
|
firstViewpoint (layerNode)
|
|
93149
93404
|
{
|
|
@@ -93293,7 +93548,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
|
|
|
93293
93548
|
console .log (string);
|
|
93294
93549
|
|
|
93295
93550
|
for (const element of this [_console])
|
|
93296
|
-
element .append (
|
|
93551
|
+
element .append (string);
|
|
93297
93552
|
},
|
|
93298
93553
|
println (... args)
|
|
93299
93554
|
{
|
|
@@ -93302,7 +93557,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, Browser_X3DBrowse
|
|
|
93302
93557
|
console .log (string);
|
|
93303
93558
|
|
|
93304
93559
|
for (const element of this [_console])
|
|
93305
|
-
element .append (
|
|
93560
|
+
element .append (`${string}\n`);
|
|
93306
93561
|
},
|
|
93307
93562
|
toVRMLStream (generator)
|
|
93308
93563
|
{
|
|
@@ -93665,7 +93920,7 @@ const QuickSort_default_ = QuickSort;
|
|
|
93665
93920
|
|
|
93666
93921
|
/* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
|
|
93667
93922
|
;// ./src/lib/libtess.js
|
|
93668
|
-
/* provided dependency */ var libtess_libtess = __webpack_require__(
|
|
93923
|
+
/* provided dependency */ var libtess_libtess = __webpack_require__(246);
|
|
93669
93924
|
const libtess_default_ = libtess_libtess;
|
|
93670
93925
|
;
|
|
93671
93926
|
|