x_ite 8.6.13 → 8.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +21 -21
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +27 -27
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +23 -23
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +40 -40
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +18 -18
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +10 -10
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +28 -28
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +30 -30
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +22 -22
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +37 -37
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +31 -31
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +25 -25
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +32 -32
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +28 -28
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +746 -683
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +2 -2
- package/package.json +1 -1
- package/src/standard/Math/Numbers/Matrix2.js +3 -3
- package/src/standard/Math/Numbers/Vector4.js +1 -0
- package/src/x_ite/Base/X3DBaseNode.js +58 -53
- package/src/x_ite/Browser/Core/BrowserOptions.js +2 -1
- package/src/x_ite/Browser/Core/X3DCoreContext.js +2 -3
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/FlyViewer.js +0 -2
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +10 -12
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +40 -21
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +19 -19
- package/src/x_ite/Components/CADGeometry/CADFace.js +8 -8
- package/src/x_ite/Components/Core/MetadataBoolean.js +4 -4
- package/src/x_ite/Components/Core/MetadataDouble.js +4 -4
- package/src/x_ite/Components/Core/MetadataFloat.js +4 -4
- package/src/x_ite/Components/Core/MetadataInteger.js +4 -4
- package/src/x_ite/Components/Core/MetadataSet.js +4 -4
- package/src/x_ite/Components/Core/MetadataString.js +4 -4
- package/src/x_ite/Components/Core/X3DNode.js +17 -16
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +11 -14
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +2 -2
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +1 -1
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +2 -2
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +2 -2
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +2 -2
- package/src/x_ite/Components/Geometry2D/Arc2D.js +1 -1
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +1 -1
- package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -1
- package/src/x_ite/Components/Geometry2D/Disk2D.js +1 -1
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -1
- package/src/x_ite/Components/Geometry3D/Cylinder.js +1 -1
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +10 -10
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +3 -3
- package/src/x_ite/Components/Geometry3D/Sphere.js +1 -1
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
- package/src/x_ite/Components/Grouping/Switch.js +7 -7
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +2 -2
- package/src/x_ite/Components/Layering/X3DLayerNode.js +40 -49
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +4 -4
- package/src/x_ite/Components/Navigation/Collision.js +4 -4
- package/src/x_ite/Components/Navigation/LOD.js +7 -7
- package/src/x_ite/Components/Networking/Inline.js +2 -2
- package/src/x_ite/Components/Networking/X3DUrlObject.js +2 -2
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +8 -8
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +4 -4
- package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +28 -19
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +11 -11
- package/src/x_ite/Components/Rendering/LineSet.js +12 -12
- package/src/x_ite/Components/Rendering/PointSet.js +11 -11
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +14 -14
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +6 -6
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +6 -6
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +4 -4
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +7 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +7 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +3 -3
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +2 -2
- package/src/x_ite/Components/Scripting/Script.js +3 -3
- package/src/x_ite/Components/Shaders/ComposedShader.js +5 -7
- package/src/x_ite/Components/Shaders/ShaderPart.js +0 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +3 -3
- package/src/x_ite/Components/Shape/Appearance.js +4 -4
- package/src/x_ite/Components/Shape/Material.js +1 -1
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +1 -1
- package/src/x_ite/Components/Shape/UnlitMaterial.js +1 -1
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +1 -1
- package/src/x_ite/Components/Shape/X3DShapeNode.js +1 -1
- package/src/x_ite/Components/Sound/AudioClip.js +2 -2
- package/src/x_ite/Components/Sound/Sound.js +2 -2
- package/src/x_ite/Components/Text/Text.js +1 -1
- package/src/x_ite/Components/Texturing/ImageTexture.js +2 -2
- package/src/x_ite/Components/Texturing/MovieTexture.js +2 -2
- package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +2 -2
- package/src/x_ite/Components/Time/TimeSensor.js +1 -1
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +6 -6
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +8 -8
- package/src/x_ite/Execution/BindableList.js +16 -19
- package/src/x_ite/Execution/X3DExecutionContext.js +19 -13
- package/src/x_ite/Execution/X3DScene.js +4 -0
- package/src/x_ite/Fields/ArrayFields.js +42 -22
- package/src/x_ite/Fields/SFNode.js +3 -6
- package/src/x_ite/Fields/SFNodeCache.js +34 -19
- package/src/x_ite/InputOutput/FileLoader.js +22 -14
- package/src/x_ite/Parser/GLTF2Parser.js +48 -48
- package/src/x_ite/Parser/VRMLParser.js +65 -33
- package/src/x_ite/Parser/X3DParser.js +9 -36
- package/src/x_ite/Parser/XMLParser.js +8 -8
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -2
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +1 -2
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
package/dist/x_ite.zip
CHANGED
|
Binary file
|
package/docs/_config.yml
CHANGED
|
@@ -20,8 +20,8 @@ timezone:
|
|
|
20
20
|
# ↓ --------------------------
|
|
21
21
|
|
|
22
22
|
title: X_ITE X3D Browser # the main title
|
|
23
|
-
version: 8.6.
|
|
24
|
-
size:
|
|
23
|
+
version: 8.6.14 # x_ite latest version
|
|
24
|
+
size: 290 # size in kb
|
|
25
25
|
x3d_latest_version: 4.0 # x3d latest version
|
|
26
26
|
|
|
27
27
|
tagline: Step Into The Future # it will display as the sub-title
|
package/package.json
CHANGED
|
@@ -145,7 +145,7 @@ Matrix2 .prototype =
|
|
|
145
145
|
inverse: function ()
|
|
146
146
|
{
|
|
147
147
|
const
|
|
148
|
-
{ 0: A, 1: B, 2: C, 3: D } = this
|
|
148
|
+
{ 0: A, 1: B, 2: C, 3: D } = this,
|
|
149
149
|
d = A * D - B * C;
|
|
150
150
|
|
|
151
151
|
// if (d === 0) ... determinant is zero.
|
|
@@ -189,9 +189,9 @@ Matrix2 .prototype =
|
|
|
189
189
|
{
|
|
190
190
|
const
|
|
191
191
|
x = vector,
|
|
192
|
-
w = x * this [
|
|
192
|
+
w = x * this [1] + this [3];
|
|
193
193
|
|
|
194
|
-
return (x * this [0] + this [
|
|
194
|
+
return (x * this [0] + this [2]) / w;
|
|
195
195
|
}
|
|
196
196
|
else
|
|
197
197
|
{
|
|
@@ -61,10 +61,10 @@ const
|
|
|
61
61
|
_predefinedFields = Symbol (),
|
|
62
62
|
_aliases = Symbol (),
|
|
63
63
|
_userDefinedFields = Symbol (),
|
|
64
|
+
_childObjects = Symbol (),
|
|
64
65
|
_initialized = Symbol (),
|
|
65
66
|
_live = Symbol (),
|
|
66
67
|
_set_live__ = Symbol ("X3DBaseNode.set_live__"),
|
|
67
|
-
_private = Symbol (),
|
|
68
68
|
_cloneCount = Symbol ();
|
|
69
69
|
|
|
70
70
|
function X3DBaseNode (executionContext)
|
|
@@ -80,23 +80,24 @@ function X3DBaseNode (executionContext)
|
|
|
80
80
|
this [_predefinedFields] = new FieldArray ();
|
|
81
81
|
this [_aliases] = new Map ();
|
|
82
82
|
this [_userDefinedFields] = new FieldArray ();
|
|
83
|
+
this [_childObjects] = [ ];
|
|
83
84
|
this [_live] = true;
|
|
84
85
|
this [_initialized] = false;
|
|
85
|
-
this [_private] = false;
|
|
86
86
|
this [_cloneCount] = 0;
|
|
87
87
|
|
|
88
88
|
// Setup fields.
|
|
89
89
|
|
|
90
|
+
this .addChildObjects ("name_changed", new Fields .SFTime (),
|
|
91
|
+
"typeName_changed", new Fields .SFTime (),
|
|
92
|
+
"fields_changed", new Fields .SFTime (),
|
|
93
|
+
"cloneCount_changed", new Fields .SFTime (),
|
|
94
|
+
"private", new Fields .SFBool ())
|
|
95
|
+
|
|
90
96
|
if (this .canUserDefinedFields ())
|
|
91
97
|
this [_fieldDefinitions] = new FieldDefinitionArray (this [_fieldDefinitions]);
|
|
92
98
|
|
|
93
99
|
for (const fieldDefinition of this [_fieldDefinitions])
|
|
94
100
|
this .addField (fieldDefinition);
|
|
95
|
-
|
|
96
|
-
this .addChildObjects ("name_changed", new Fields .SFTime (),
|
|
97
|
-
"typeName_changed", new Fields .SFTime (),
|
|
98
|
-
"fields_changed", new Fields .SFTime (),
|
|
99
|
-
"cloneCount_changed", new Fields .SFTime ())
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototype),
|
|
@@ -149,19 +150,26 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
149
150
|
{
|
|
150
151
|
return this;
|
|
151
152
|
},
|
|
152
|
-
|
|
153
|
+
isLive: function ()
|
|
153
154
|
{
|
|
154
|
-
this .
|
|
155
|
+
/// Returns the own live state of this node.
|
|
156
|
+
|
|
157
|
+
return this [_live];
|
|
155
158
|
},
|
|
156
|
-
|
|
159
|
+
setLive: function (value)
|
|
157
160
|
{
|
|
158
|
-
this .
|
|
161
|
+
/// Sets the own live state of this node. Setting the live state to false
|
|
162
|
+
/// temporarily disables this node completely.
|
|
163
|
+
|
|
164
|
+
this [_live] = value .valueOf ();
|
|
165
|
+
|
|
166
|
+
this [_set_live__] ();
|
|
159
167
|
},
|
|
160
|
-
|
|
168
|
+
getLive: (function ()
|
|
161
169
|
{
|
|
162
|
-
function
|
|
170
|
+
function getLive ()
|
|
163
171
|
{
|
|
164
|
-
return this .
|
|
172
|
+
return this ._live;
|
|
165
173
|
}
|
|
166
174
|
|
|
167
175
|
return function ()
|
|
@@ -170,80 +178,66 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
170
178
|
|
|
171
179
|
// Change function.
|
|
172
180
|
|
|
173
|
-
Object .defineProperty (this, "
|
|
181
|
+
Object .defineProperty (this, "getLive",
|
|
174
182
|
{
|
|
175
|
-
value:
|
|
183
|
+
value: getLive,
|
|
176
184
|
enumerable: false,
|
|
177
185
|
configurable: true,
|
|
178
186
|
});
|
|
179
187
|
|
|
180
188
|
// Add isLive event.
|
|
181
189
|
|
|
182
|
-
this .addChildObjects ("
|
|
190
|
+
this .addChildObjects ("live", new Fields .SFBool (this .getLiveState ()));
|
|
183
191
|
|
|
184
192
|
// Event processing is done manually and immediately, so:
|
|
185
|
-
this .
|
|
193
|
+
this ._live .removeParent (this);
|
|
186
194
|
|
|
187
195
|
// Connect to execution context.
|
|
188
196
|
|
|
189
197
|
if (this .getOuterNode && this .getOuterNode ())
|
|
190
|
-
this .getOuterNode () .
|
|
198
|
+
this .getOuterNode () .getLive () .addInterest (_set_live__, this);
|
|
191
199
|
|
|
192
200
|
else if (this [_executionContext] !== this)
|
|
193
|
-
this [_executionContext] .
|
|
201
|
+
this [_executionContext] .getLive () .addInterest (_set_live__, this);
|
|
194
202
|
|
|
195
|
-
// Return field
|
|
203
|
+
// Return field.
|
|
196
204
|
|
|
197
|
-
return this .
|
|
205
|
+
return this ._live;
|
|
198
206
|
};
|
|
199
207
|
})(),
|
|
200
|
-
setLive: function (value)
|
|
201
|
-
{
|
|
202
|
-
/// Sets the own live state of this node. Setting the live state to false
|
|
203
|
-
/// temporarily disables this node completely.
|
|
204
|
-
|
|
205
|
-
this [_live] = value .valueOf ();
|
|
206
|
-
|
|
207
|
-
this [_set_live__] ();
|
|
208
|
-
},
|
|
209
|
-
getLive: function ()
|
|
210
|
-
{
|
|
211
|
-
/// Returns the own live state of this node.
|
|
212
|
-
|
|
213
|
-
return this [_live];
|
|
214
|
-
},
|
|
215
208
|
getLiveState: function ()
|
|
216
209
|
{
|
|
217
210
|
/// Determines the live state of this node.
|
|
218
211
|
|
|
219
|
-
if (this .getOuterNode
|
|
220
|
-
return this
|
|
212
|
+
if (this .getOuterNode ?.())
|
|
213
|
+
return this [_live] && this .getOuterNode () .getLive () .getValue ();
|
|
221
214
|
|
|
222
215
|
else if (this !== this [_executionContext])
|
|
223
|
-
return this
|
|
216
|
+
return this [_live] && this [_executionContext] .getLive () .getValue ();
|
|
224
217
|
|
|
225
|
-
return this
|
|
218
|
+
return this [_live];
|
|
226
219
|
},
|
|
227
220
|
[_set_live__]: function ()
|
|
228
221
|
{
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
222
|
+
const live = this ._live;
|
|
223
|
+
|
|
224
|
+
if (!live)
|
|
225
|
+
return;
|
|
232
226
|
|
|
233
|
-
if (
|
|
227
|
+
if (this .getLiveState ())
|
|
234
228
|
{
|
|
235
|
-
if (
|
|
229
|
+
if (live .getValue ())
|
|
236
230
|
return;
|
|
237
231
|
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
live .set (true);
|
|
233
|
+
live .processEvent ();
|
|
240
234
|
}
|
|
241
235
|
else
|
|
242
236
|
{
|
|
243
|
-
if (
|
|
237
|
+
if (live .getValue ())
|
|
244
238
|
{
|
|
245
|
-
|
|
246
|
-
|
|
239
|
+
live .set (false);
|
|
240
|
+
live .processEvent ();
|
|
247
241
|
}
|
|
248
242
|
}
|
|
249
243
|
},
|
|
@@ -302,6 +296,8 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
302
296
|
},
|
|
303
297
|
addChildObject: function (name, field)
|
|
304
298
|
{
|
|
299
|
+
this [_childObjects] .push (field);
|
|
300
|
+
|
|
305
301
|
field .addParent (this);
|
|
306
302
|
field .setName (name);
|
|
307
303
|
|
|
@@ -545,11 +541,11 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
545
541
|
},
|
|
546
542
|
isPrivate: function ()
|
|
547
543
|
{
|
|
548
|
-
return this
|
|
544
|
+
return this ._private .getValue ();
|
|
549
545
|
},
|
|
550
546
|
setPrivate: function (value)
|
|
551
547
|
{
|
|
552
|
-
this
|
|
548
|
+
this ._private = value;
|
|
553
549
|
|
|
554
550
|
if (value)
|
|
555
551
|
{
|
|
@@ -562,6 +558,10 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
562
558
|
field .addCloneCount (1);
|
|
563
559
|
}
|
|
564
560
|
},
|
|
561
|
+
getPrivate: function ()
|
|
562
|
+
{
|
|
563
|
+
return this ._private;
|
|
564
|
+
},
|
|
565
565
|
getCloneCount: function ()
|
|
566
566
|
{
|
|
567
567
|
return this [_cloneCount];
|
|
@@ -600,6 +600,11 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
600
600
|
},
|
|
601
601
|
dispose: function ()
|
|
602
602
|
{
|
|
603
|
+
this .setLive (false);
|
|
604
|
+
|
|
605
|
+
for (const field of this [_childObjects])
|
|
606
|
+
field .dispose ();
|
|
607
|
+
|
|
603
608
|
for (const field of this .getFields ())
|
|
604
609
|
field .dispose ();
|
|
605
610
|
|
|
@@ -92,6 +92,7 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
92
92
|
new X3DFieldDefinition (X3DConstants .inputOutput, "Notifications", new Fields .SFBool (true)),
|
|
93
93
|
new X3DFieldDefinition (X3DConstants .inputOutput, "Multisampling", new Fields .SFInt32 (4)),
|
|
94
94
|
new X3DFieldDefinition (X3DConstants .inputOutput, "OptimizeStaticGroup", new Fields .SFBool (true)),
|
|
95
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "PrivateSensors", new Fields .SFBool (false)),
|
|
95
96
|
new X3DFieldDefinition (X3DConstants .inputOutput, "StraightenHorizon", new Fields .SFBool (true)),
|
|
96
97
|
new X3DFieldDefinition (X3DConstants .inputOutput, "Timings", new Fields .SFBool ()),
|
|
97
98
|
]),
|
|
@@ -267,7 +268,7 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
267
268
|
this .localStorage .StraightenHorizon = straightenHorizon .getValue ();
|
|
268
269
|
|
|
269
270
|
if (straightenHorizon .getValue ())
|
|
270
|
-
this .getBrowser () .getActiveLayer ()?.straightenView ();
|
|
271
|
+
this .getBrowser () .getActiveLayer () ?.straightenView ();
|
|
271
272
|
},
|
|
272
273
|
updateContentScale: function ()
|
|
273
274
|
{
|
|
@@ -57,7 +57,6 @@ import Scene from "../../Execution/Scene.js";
|
|
|
57
57
|
import DataStorage from "../../../standard/Utility/DataStorage.js";
|
|
58
58
|
import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
|
|
59
59
|
import _ from "../../../locale/gettext.js";
|
|
60
|
-
import DEBUG from "../../DEBUG.js";
|
|
61
60
|
|
|
62
61
|
const WEBGL_LATEST_VERSION = 2;
|
|
63
62
|
|
|
@@ -477,12 +476,12 @@ X3DCoreContext .prototype =
|
|
|
477
476
|
{
|
|
478
477
|
event .preventDefault ();
|
|
479
478
|
|
|
480
|
-
if (this .isLive ()
|
|
479
|
+
if (this .isLive ())
|
|
481
480
|
this .endUpdate ();
|
|
482
481
|
else
|
|
483
482
|
this .beginUpdate ();
|
|
484
483
|
|
|
485
|
-
this .getNotification () ._string = this .
|
|
484
|
+
this .getNotification () ._string = this .getLive () .getValue () ? "Begin Update" : "End Update";
|
|
486
485
|
}
|
|
487
486
|
}
|
|
488
487
|
|
|
@@ -56,7 +56,6 @@ import TimeSensor from "../../Components/Time/TimeSensor.js";
|
|
|
56
56
|
import Vector2 from "../../../standard/Math/Numbers/Vector2.js";
|
|
57
57
|
import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
|
|
58
58
|
import Rotation4 from "../../../standard/Math/Numbers/Rotation4.js";
|
|
59
|
-
import Matrix3 from "../../../standard/Math/Numbers/Matrix3.js";
|
|
60
59
|
|
|
61
60
|
typeof jquery_mousewheel; // import plugin
|
|
62
61
|
|
|
@@ -254,8 +253,6 @@ ExamineViewer .prototype = Object .assign (Object .create (X3DViewer .prototype)
|
|
|
254
253
|
event .preventDefault ();
|
|
255
254
|
event .stopImmediatePropagation ();
|
|
256
255
|
|
|
257
|
-
const viewpoint = this .getActiveViewpoint ();
|
|
258
|
-
|
|
259
256
|
this .getBrowser () .setCursor ("DEFAULT");
|
|
260
257
|
|
|
261
258
|
if (Math .abs (this .rotation .angle) > SPIN_ANGLE && Date .now () - this .motionTime < SPIN_RELEASE_TIME)
|
|
@@ -50,8 +50,6 @@ import X3DFieldDefinition from "../../Base/X3DFieldDefinition.js";
|
|
|
50
50
|
import FieldDefinitionArray from "../../Base/FieldDefinitionArray.js";
|
|
51
51
|
import X3DConstants from "../../Base/X3DConstants.js";
|
|
52
52
|
import X3DFlyViewer from "./X3DFlyViewer.js";
|
|
53
|
-
import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
|
|
54
|
-
import Rotation4 from "../../../standard/Math/Numbers/Rotation4.js";
|
|
55
53
|
|
|
56
54
|
function FlyViewer (executionContext, navigationInfo)
|
|
57
55
|
{
|
|
@@ -83,7 +83,7 @@ function X3DNavigationContext ()
|
|
|
83
83
|
"viewer", new Fields .SFString ("EXAMINE"));
|
|
84
84
|
|
|
85
85
|
this [_activeCollisions] = new Set ();
|
|
86
|
-
this [_viewerNode] = new NoneViewer (this);
|
|
86
|
+
this [_viewerNode] = new NoneViewer (this .getPrivateScene ());
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
X3DNavigationContext .prototype =
|
|
@@ -165,8 +165,7 @@ X3DNavigationContext .prototype =
|
|
|
165
165
|
},
|
|
166
166
|
set_activeNavigationInfo__: function ()
|
|
167
167
|
{
|
|
168
|
-
|
|
169
|
-
this ._activeNavigationInfo .getValue () ._viewer .removeFieldInterest (this ._viewer);
|
|
168
|
+
this ._activeNavigationInfo .getValue () ?._viewer .removeFieldInterest (this ._viewer);
|
|
170
169
|
|
|
171
170
|
if (this ._activeLayer .getValue ())
|
|
172
171
|
{
|
|
@@ -200,33 +199,32 @@ X3DNavigationContext .prototype =
|
|
|
200
199
|
|
|
201
200
|
// Create viewer node.
|
|
202
201
|
|
|
203
|
-
|
|
204
|
-
this [_viewerNode] .dispose ();
|
|
202
|
+
this [_viewerNode] ?.dispose ();
|
|
205
203
|
|
|
206
204
|
switch (viewer .getValue ())
|
|
207
205
|
{
|
|
208
206
|
case "EXAMINE":
|
|
209
|
-
this [_viewerNode] = new ExamineViewer (this, navigationInfo);
|
|
207
|
+
this [_viewerNode] = new ExamineViewer (this .getPrivateScene (), navigationInfo);
|
|
210
208
|
break;
|
|
211
209
|
case "WALK":
|
|
212
|
-
this [_viewerNode] = new WalkViewer (this, navigationInfo);
|
|
210
|
+
this [_viewerNode] = new WalkViewer (this .getPrivateScene (), navigationInfo);
|
|
213
211
|
break;
|
|
214
212
|
case "FLY":
|
|
215
|
-
this [_viewerNode] = new FlyViewer (this, navigationInfo);
|
|
213
|
+
this [_viewerNode] = new FlyViewer (this .getPrivateScene (), navigationInfo);
|
|
216
214
|
break;
|
|
217
215
|
case "PLANE":
|
|
218
216
|
case "PLANE_create3000.github.io":
|
|
219
217
|
case "PLANE_create3000.de":
|
|
220
|
-
|
|
218
|
+
this [_viewerNode] = new PlaneViewer (this .getPrivateScene (), navigationInfo);
|
|
221
219
|
break;
|
|
222
220
|
case "NONE":
|
|
223
|
-
this [_viewerNode] = new NoneViewer (this, navigationInfo);
|
|
221
|
+
this [_viewerNode] = new NoneViewer (this .getPrivateScene (), navigationInfo);
|
|
224
222
|
break;
|
|
225
223
|
case "LOOKAT":
|
|
226
|
-
this [_viewerNode] = new LookAtViewer (this, navigationInfo);
|
|
224
|
+
this [_viewerNode] = new LookAtViewer (this .getPrivateScene (), navigationInfo);
|
|
227
225
|
break;
|
|
228
226
|
default:
|
|
229
|
-
this [_viewerNode] = new ExamineViewer (this, navigationInfo);
|
|
227
|
+
this [_viewerNode] = new ExamineViewer (this .getPrivateScene (), navigationInfo);
|
|
230
228
|
break;
|
|
231
229
|
}
|
|
232
230
|
|
|
@@ -55,30 +55,32 @@ import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
|
|
|
55
55
|
import StopWatch from "../../../standard/Time/StopWatch.js";
|
|
56
56
|
|
|
57
57
|
const
|
|
58
|
-
_pointingDevice
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
_pointingDevice = Symbol (),
|
|
59
|
+
_pointingDeviceSensorNodes = Symbol (),
|
|
60
|
+
_cursorType = Symbol (),
|
|
61
|
+
_pointer = Symbol (),
|
|
62
|
+
_hit = Symbol (),
|
|
63
|
+
_overSensors = Symbol (),
|
|
64
|
+
_activeSensors = Symbol (),
|
|
65
|
+
_pointingLayer = Symbol (),
|
|
66
|
+
_pointingTime = Symbol (),
|
|
67
|
+
_pointingBuffer = Symbol (),
|
|
68
|
+
_pointingShaders = Symbol (),
|
|
69
|
+
_id = Symbol (),
|
|
70
|
+
_pointingContexts = Symbol ();
|
|
70
71
|
|
|
71
72
|
function X3DPointingDeviceSensorContext ()
|
|
72
73
|
{
|
|
73
|
-
this [_pointingDevice]
|
|
74
|
-
this [
|
|
75
|
-
this [
|
|
76
|
-
this [
|
|
77
|
-
this [
|
|
78
|
-
this [
|
|
79
|
-
this [
|
|
80
|
-
this [
|
|
81
|
-
this [
|
|
74
|
+
this [_pointingDevice] = new PointingDevice (this .getPrivateScene ());
|
|
75
|
+
this [_pointingDeviceSensorNodes] = new Set ();
|
|
76
|
+
this [_pointer] = new Vector2 (0, 0);
|
|
77
|
+
this [_overSensors] = [ ];
|
|
78
|
+
this [_activeSensors] = [ ];
|
|
79
|
+
this [_pointingLayer] = null;
|
|
80
|
+
this [_pointingTime] = new StopWatch ();
|
|
81
|
+
this [_pointingBuffer] = new PointingBuffer (this);
|
|
82
|
+
this [_pointingShaders] = new Map ();
|
|
83
|
+
this [_pointingContexts] = [ ];
|
|
82
84
|
|
|
83
85
|
this [_hit] = {
|
|
84
86
|
id: 0,
|
|
@@ -109,6 +111,14 @@ X3DPointingDeviceSensorContext .prototype =
|
|
|
109
111
|
{
|
|
110
112
|
return this [_pointingTime];
|
|
111
113
|
},
|
|
114
|
+
addPointingDeviceSensor: function (node)
|
|
115
|
+
{
|
|
116
|
+
this [_pointingDeviceSensorNodes] .add (node);
|
|
117
|
+
},
|
|
118
|
+
removePointingDeviceSensor: function (node)
|
|
119
|
+
{
|
|
120
|
+
this [_pointingDeviceSensorNodes] .delete (node);
|
|
121
|
+
},
|
|
112
122
|
setCursor: function (value)
|
|
113
123
|
{
|
|
114
124
|
const div = this .getSurface ();
|
|
@@ -171,6 +181,9 @@ X3DPointingDeviceSensorContext .prototype =
|
|
|
171
181
|
},
|
|
172
182
|
buttonPressEvent: function (x, y)
|
|
173
183
|
{
|
|
184
|
+
if (!this [_pointingDeviceSensorNodes] .size)
|
|
185
|
+
return false;
|
|
186
|
+
|
|
174
187
|
if (!this .touch (x, y))
|
|
175
188
|
return false;
|
|
176
189
|
|
|
@@ -186,6 +199,9 @@ X3DPointingDeviceSensorContext .prototype =
|
|
|
186
199
|
},
|
|
187
200
|
buttonReleaseEvent: function ()
|
|
188
201
|
{
|
|
202
|
+
if (!this [_pointingDeviceSensorNodes] .size)
|
|
203
|
+
return;
|
|
204
|
+
|
|
189
205
|
for (const sensor of this [_activeSensors])
|
|
190
206
|
sensor .set_active__ (false, null);
|
|
191
207
|
|
|
@@ -194,6 +210,9 @@ X3DPointingDeviceSensorContext .prototype =
|
|
|
194
210
|
},
|
|
195
211
|
motionNotifyEvent: function (x, y)
|
|
196
212
|
{
|
|
213
|
+
if (!this [_pointingDeviceSensorNodes] .size)
|
|
214
|
+
return false;
|
|
215
|
+
|
|
197
216
|
this .touch (x, y);
|
|
198
217
|
this .motion ();
|
|
199
218
|
|
|
@@ -61,7 +61,7 @@ X3DVolumeRenderingContext .prototype =
|
|
|
61
61
|
{
|
|
62
62
|
getDefaultVoxels: function (executionContext)
|
|
63
63
|
{
|
|
64
|
-
this [_defaultVoxelsNode] = executionContext .createNode ("PixelTexture3D", false);
|
|
64
|
+
this [_defaultVoxelsNode] = executionContext .createNode ("PixelTexture3D", { setup: false, warn: false });
|
|
65
65
|
this [_defaultVoxelsNode] ._image = [1, 1, 1, 1, 255];
|
|
66
66
|
this [_defaultVoxelsNode] .repeatS = true;
|
|
67
67
|
this [_defaultVoxelsNode] .repeatT = true;
|
|
@@ -184,7 +184,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
184
184
|
{
|
|
185
185
|
return SupportedProfiles;
|
|
186
186
|
},
|
|
187
|
-
getComponent: function (name, level)
|
|
187
|
+
getComponent: function (name, level = 0)
|
|
188
188
|
{
|
|
189
189
|
name = String (name);
|
|
190
190
|
level |= 0;
|
|
@@ -195,7 +195,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
195
195
|
{
|
|
196
196
|
return new ComponentInfo ({
|
|
197
197
|
name: name,
|
|
198
|
-
level: Algorithm .clamp (level, 1, component .level),
|
|
198
|
+
level: Algorithm .clamp (level || component .level, 1, component .level),
|
|
199
199
|
title: component .title,
|
|
200
200
|
providerUrl: component .providerUrl,
|
|
201
201
|
external: $.data (component, "external"),
|
|
@@ -312,8 +312,8 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
312
312
|
|
|
313
313
|
scene = this .createScene ();
|
|
314
314
|
|
|
315
|
-
for (const
|
|
316
|
-
scene .
|
|
315
|
+
for (const node of rootNodes .filter (node => node))
|
|
316
|
+
scene .getLive () .addInterest ("setLive", node .getValue () .getExecutionContext ());
|
|
317
317
|
|
|
318
318
|
scene .setRootNodes (rootNodes);
|
|
319
319
|
}
|
|
@@ -323,7 +323,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
323
323
|
|
|
324
324
|
// Detach scene from parent.
|
|
325
325
|
|
|
326
|
-
scene .getExecutionContext () .
|
|
326
|
+
scene .getExecutionContext () .getLive () .removeInterest ("setLive", scene);
|
|
327
327
|
scene .setExecutionContext (scene);
|
|
328
328
|
|
|
329
329
|
// Replace.
|
|
@@ -339,7 +339,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
339
339
|
this .setExecutionContext (scene);
|
|
340
340
|
this .getWorld () .bindBindables ();
|
|
341
341
|
|
|
342
|
-
scene .setLive (this .isLive ()
|
|
342
|
+
scene .setLive (this .isLive ());
|
|
343
343
|
});
|
|
344
344
|
},
|
|
345
345
|
checkLoadCount: function (resolve, loadCount)
|
|
@@ -371,9 +371,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
371
371
|
|
|
372
372
|
if (!external)
|
|
373
373
|
{
|
|
374
|
-
currentScene .
|
|
374
|
+
currentScene .getLive () .addInterest ("setLive", scene);
|
|
375
375
|
scene .setExecutionContext (currentScene);
|
|
376
|
-
scene .setLive (currentScene .
|
|
376
|
+
scene .setLive (currentScene .isLive ());
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
return scene;
|
|
@@ -410,13 +410,13 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
410
410
|
|
|
411
411
|
if (scene)
|
|
412
412
|
{
|
|
413
|
-
// Handle
|
|
413
|
+
// Handle getLive for script scenes here:
|
|
414
414
|
|
|
415
415
|
if (!external)
|
|
416
416
|
{
|
|
417
|
-
currentScene .
|
|
417
|
+
currentScene .getLive () .addInterest ("setLive", scene);
|
|
418
418
|
scene .setExecutionContext (currentScene);
|
|
419
|
-
scene .setLive (currentScene .
|
|
419
|
+
scene .setLive (currentScene .isLive ());
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
// Wait until scene is completely loaded, scene ._loadCount must be 0.
|
|
@@ -451,9 +451,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
451
451
|
{
|
|
452
452
|
if (!external)
|
|
453
453
|
{
|
|
454
|
-
currentScene .
|
|
454
|
+
currentScene .getLive () .addInterest ("setLive", scene);
|
|
455
455
|
scene .setExecutionContext (currentScene);
|
|
456
|
-
scene .setLive (currentScene .
|
|
456
|
+
scene .setLive (currentScene .isLive ());
|
|
457
457
|
}
|
|
458
458
|
|
|
459
459
|
resolve (scene);
|
|
@@ -599,9 +599,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
599
599
|
|
|
600
600
|
if (!external)
|
|
601
601
|
{
|
|
602
|
-
currentScene .
|
|
602
|
+
currentScene .getLive () .addInterest ("setLive", scene);
|
|
603
603
|
scene .setExecutionContext (currentScene);
|
|
604
|
-
scene .setLive (currentScene .
|
|
604
|
+
scene .setLive (currentScene .isLive ());
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
const parser = new XMLParser (scene);
|
|
@@ -619,9 +619,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
619
619
|
|
|
620
620
|
if (!external)
|
|
621
621
|
{
|
|
622
|
-
currentScene .
|
|
622
|
+
currentScene .getLive () .addInterest ("setLive", scene);
|
|
623
623
|
scene .setExecutionContext (currentScene);
|
|
624
|
-
scene .setLive (currentScene .
|
|
624
|
+
scene .setLive (currentScene .isLive ());
|
|
625
625
|
}
|
|
626
626
|
|
|
627
627
|
const parser = new JSONParser (scene);
|
|
@@ -813,14 +813,14 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
813
813
|
beginUpdate: function ()
|
|
814
814
|
{
|
|
815
815
|
this .setLive (true);
|
|
816
|
-
this .getExecutionContext () .
|
|
816
|
+
this .getExecutionContext () .setLive (true);
|
|
817
817
|
this .advanceTime ();
|
|
818
818
|
this .addBrowserEvent ();
|
|
819
819
|
},
|
|
820
820
|
endUpdate: function ()
|
|
821
821
|
{
|
|
822
822
|
this .setLive (false);
|
|
823
|
-
this .getExecutionContext () .
|
|
823
|
+
this .getExecutionContext () .setLive (false);
|
|
824
824
|
},
|
|
825
825
|
print: function ()
|
|
826
826
|
{
|