x_ite 8.6.24 → 8.7.1
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/README.md +2 -0
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +34 -39
- 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 +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- 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 +8 -8
- 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 +32 -32
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +22 -22
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +26 -26
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +20 -20
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- 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 +30 -30
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +25 -25
- 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 +297 -257
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_posts/accessing-the-external-browser.md +1 -1
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +41 -0
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +41 -0
- package/docs/_posts/components/Navigation/Viewpoint.md +41 -0
- package/docs/_posts/components/Networking/Inline.md +1 -1
- package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
- package/docs/_posts/getting-started.md +4 -1
- package/docs/_posts/glossary.md +3 -3
- package/docs/_posts/laboratory/x3d-file-converter.md +1 -1
- package/docs/_posts/reference/browser-services.md +48 -20
- package/docs/_posts/reference/field-services-and-objects.md +23 -23
- package/docs/_posts/reference/scene-services.md +1 -1
- package/docs/_posts/supported-nodes.md +1 -1
- package/docs/_posts/tutorials/basic-nodes.md +1 -1
- package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
- package/docs/_posts/tutorials/building-primitive-shapes.md +1 -1
- package/docs/_posts/tutorials/increasing-rendering-speed.md +1 -1
- package/docs/_posts/tutorials/introducing-x3d.md +1 -1
- package/docs/_posts/tutorials/overview.md +1 -1
- package/docs/_posts/what's-new.md +11 -1
- package/package.json +4 -4
- package/src/x_ite/Base/X3DBaseNode.js +2 -2
- package/src/x_ite/Base/X3DField.js +4 -4
- package/src/x_ite/Browser/Core/BrowserOptions.js +12 -4
- package/src/x_ite/Browser/Core/X3DCoreContext.js +79 -31
- package/src/x_ite/Browser/Legacy.js +1 -1
- package/src/x_ite/Browser/NURBS/NURBS.js +3 -3
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +2 -2
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +10 -11
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +52 -28
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +9 -14
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +6 -6
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +14 -34
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +9 -36
- package/src/x_ite/Components/NURBS/NurbsCurve.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +1 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +1 -1
- package/src/x_ite/Components/Picking/LinePickSensor.js +2 -2
- package/src/x_ite/Components/Picking/PointPickSensor.js +2 -2
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +2 -2
- package/src/x_ite/Components/Picking/VolumePickSensor.js +2 -2
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +1 -1
- package/src/x_ite/Components/Shape/Material.js +10 -10
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +6 -6
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +1 -1
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +5 -5
- package/src/x_ite/Components/Sound/ListenerPointSource.js +2 -1
- package/src/x_ite/Components/Sound/MicrophoneSource.js +2 -1
- package/src/x_ite/Components/Sound/OscillatorSource.js +2 -1
- package/src/x_ite/Components/Sound/StreamAudioSource.js +2 -1
- package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +3 -0
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +2 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +2 -2
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +2 -2
- package/src/x_ite/Fields/SFNode.js +5 -5
- package/src/x_ite/Fields.js +5 -4
- package/src/x_ite/Parser/X3DParser.js +1 -1
- package/src/x_ite/X3DCanvasElement.js +4 -4
- package/src/x_ite.html +1 -1
- package/x_ite.min.html +1 -1
|
@@ -71,8 +71,8 @@ function ComposedCubeMapTexture (executionContext)
|
|
|
71
71
|
|
|
72
72
|
this .addChildObjects ("update", new Fields .SFTime ());
|
|
73
73
|
|
|
74
|
-
this .textureNodes
|
|
75
|
-
this .
|
|
74
|
+
this .textureNodes = [null, null, null, null, null, null];
|
|
75
|
+
this .textureBits = new BitSet ();
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironmentTextureNode .prototype),
|
|
@@ -138,32 +138,27 @@ ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironme
|
|
|
138
138
|
{
|
|
139
139
|
let textureNode = this .textureNodes [index];
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
textureNode .removeInterest ("set_loadState__", this);
|
|
141
|
+
textureNode ?.removeInterest ("set_loadState__", this);
|
|
143
142
|
|
|
144
143
|
textureNode = this .textureNodes [index] = X3DCast (X3DConstants .X3DTexture2DNode, node);
|
|
145
144
|
|
|
146
|
-
|
|
147
|
-
textureNode .addInterest ("set_loadState__", this, textureNode, index);
|
|
145
|
+
textureNode ?.addInterest ("set_loadState__", this, textureNode, index);
|
|
148
146
|
|
|
149
147
|
this .set_loadState__ (textureNode, index);
|
|
150
148
|
},
|
|
151
149
|
set_loadState__: function (textureNode, index)
|
|
152
150
|
{
|
|
153
|
-
|
|
154
|
-
this .setLoadStateBit (index, textureNode, textureNode .checkLoadState ());
|
|
155
|
-
else
|
|
156
|
-
this .setLoadStateBit (index, textureNode, X3DConstants .NOT_STARTED);
|
|
151
|
+
this .setTextureBit (index, textureNode, textureNode ?.checkLoadState () ?? X3DConstants .NOT_STARTED);
|
|
157
152
|
|
|
158
153
|
this ._update .addEvent ();
|
|
159
154
|
},
|
|
160
|
-
|
|
155
|
+
setTextureBit: function (bit, textureNode, loadState)
|
|
161
156
|
{
|
|
162
|
-
this .
|
|
157
|
+
this .textureBits .set (bit, loadState === X3DConstants .COMPLETE_STATE || textureNode ?.getWidth ());
|
|
163
158
|
},
|
|
164
159
|
isComplete: function ()
|
|
165
160
|
{
|
|
166
|
-
if (+this .
|
|
161
|
+
if (+this .textureBits !== 0b111111)
|
|
167
162
|
return false;
|
|
168
163
|
|
|
169
164
|
const
|
|
@@ -212,7 +207,7 @@ ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironme
|
|
|
212
207
|
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, width, height, 0, gl .RGBA, gl .UNSIGNED_BYTE, textureNode .getElement ());
|
|
213
208
|
else
|
|
214
209
|
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, gl .RGBA, gl .UNSIGNED_BYTE, textureNode .getElement ());
|
|
215
|
-
|
|
210
|
+
|
|
216
211
|
break;
|
|
217
212
|
}
|
|
218
213
|
default:
|
|
@@ -136,12 +136,12 @@ Background .prototype = Object .assign (Object .create (X3DBackgroundNode .proto
|
|
|
136
136
|
topTexture .setup ();
|
|
137
137
|
bottomTexture .setup ();
|
|
138
138
|
|
|
139
|
-
this .
|
|
140
|
-
this .
|
|
141
|
-
this .
|
|
142
|
-
this .
|
|
143
|
-
this .
|
|
144
|
-
this .
|
|
139
|
+
this .set_texture__ (frontTexture, 0);
|
|
140
|
+
this .set_texture__ (backTexture, 1);
|
|
141
|
+
this .set_texture__ (leftTexture, 2);
|
|
142
|
+
this .set_texture__ (rightTexture, 3);
|
|
143
|
+
this .set_texture__ (topTexture, 4);
|
|
144
|
+
this .set_texture__ (bottomTexture, 5);
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
|
|
@@ -99,43 +99,23 @@ TextureBackground .prototype = Object .assign (Object .create (X3DBackgroundNode
|
|
|
99
99
|
{
|
|
100
100
|
X3DBackgroundNode .prototype .initialize .call (this);
|
|
101
101
|
|
|
102
|
-
this ._frontTexture .addInterest ("
|
|
103
|
-
this ._backTexture .addInterest ("
|
|
104
|
-
this ._leftTexture .addInterest ("
|
|
105
|
-
this ._rightTexture .addInterest ("
|
|
106
|
-
this ._topTexture .addInterest ("
|
|
107
|
-
this ._bottomTexture .addInterest ("
|
|
102
|
+
this ._frontTexture .addInterest ("set_texture__", this, 0);
|
|
103
|
+
this ._backTexture .addInterest ("set_texture__", this, 1);
|
|
104
|
+
this ._leftTexture .addInterest ("set_texture__", this, 2);
|
|
105
|
+
this ._rightTexture .addInterest ("set_texture__", this, 3);
|
|
106
|
+
this ._topTexture .addInterest ("set_texture__", this, 4);
|
|
107
|
+
this ._bottomTexture .addInterest ("set_texture__", this, 5);
|
|
108
108
|
|
|
109
|
-
this .
|
|
110
|
-
this .
|
|
111
|
-
this .
|
|
112
|
-
this .
|
|
113
|
-
this .
|
|
114
|
-
this .
|
|
109
|
+
this .set_texture__ (0, this ._frontTexture);
|
|
110
|
+
this .set_texture__ (1, this ._backTexture);
|
|
111
|
+
this .set_texture__ (2, this ._leftTexture);
|
|
112
|
+
this .set_texture__ (3, this ._rightTexture);
|
|
113
|
+
this .set_texture__ (4, this ._topTexture);
|
|
114
|
+
this .set_texture__ (5, this ._bottomTexture);
|
|
115
115
|
},
|
|
116
|
-
|
|
116
|
+
set_texture__: function (index, textureNode)
|
|
117
117
|
{
|
|
118
|
-
X3DBackgroundNode .prototype .
|
|
119
|
-
},
|
|
120
|
-
set_backTexture__: function ()
|
|
121
|
-
{
|
|
122
|
-
X3DBackgroundNode .prototype .set_backTexture__ .call (this, X3DCast (X3DConstants .X3DTextureNode, this ._backTexture));
|
|
123
|
-
},
|
|
124
|
-
set_leftTexture__: function ()
|
|
125
|
-
{
|
|
126
|
-
X3DBackgroundNode .prototype .set_leftTexture__ .call (this, X3DCast (X3DConstants .X3DTextureNode, this ._leftTexture));
|
|
127
|
-
},
|
|
128
|
-
set_rightTexture__: function ()
|
|
129
|
-
{
|
|
130
|
-
X3DBackgroundNode .prototype .set_rightTexture__ .call (this, X3DCast (X3DConstants .X3DTextureNode, this ._rightTexture));
|
|
131
|
-
},
|
|
132
|
-
set_topTexture__: function ()
|
|
133
|
-
{
|
|
134
|
-
X3DBackgroundNode .prototype .set_topTexture__ .call (this, X3DCast (X3DConstants .X3DTextureNode, this ._topTexture));
|
|
135
|
-
},
|
|
136
|
-
set_bottomTexture__: function ()
|
|
137
|
-
{
|
|
138
|
-
X3DBackgroundNode .prototype .set_bottomTexture__ .call (this, X3DCast (X3DConstants .X3DTextureNode, this ._bottomTexture));
|
|
118
|
+
X3DBackgroundNode .prototype .set_texture__ .call (this, X3DCast (X3DConstants .X3DTextureNode, textureNode), index);
|
|
139
119
|
},
|
|
140
120
|
});
|
|
141
121
|
|
|
@@ -141,50 +141,23 @@ X3DBackgroundNode .prototype = Object .assign (Object .create (X3DBindableNode .
|
|
|
141
141
|
|
|
142
142
|
return false;
|
|
143
143
|
},
|
|
144
|
-
|
|
144
|
+
set_texture__: function (textureNode, index)
|
|
145
145
|
{
|
|
146
|
-
this .
|
|
147
|
-
},
|
|
148
|
-
set_backTexture__: function (value)
|
|
149
|
-
{
|
|
150
|
-
this .updateTexture (1, value);
|
|
151
|
-
},
|
|
152
|
-
set_leftTexture__: function (value)
|
|
153
|
-
{
|
|
154
|
-
this .updateTexture (2, value);
|
|
155
|
-
},
|
|
156
|
-
set_rightTexture__: function (value)
|
|
157
|
-
{
|
|
158
|
-
this .updateTexture (3, value);
|
|
159
|
-
},
|
|
160
|
-
set_topTexture__: function (value)
|
|
161
|
-
{
|
|
162
|
-
this .updateTexture (4, value);
|
|
163
|
-
},
|
|
164
|
-
set_bottomTexture__: function (value)
|
|
165
|
-
{
|
|
166
|
-
this .updateTexture (5, value);
|
|
167
|
-
},
|
|
168
|
-
updateTexture: function (index, textureNode)
|
|
169
|
-
{
|
|
170
|
-
this .textureNodes [index] ?._loadState .removeInterest ("setTextureBit", this);
|
|
146
|
+
this .textureNodes [index] ?._loadState .removeInterest ("set_loadState__", this);
|
|
171
147
|
|
|
172
148
|
this .textureNodes [index] = textureNode;
|
|
173
149
|
|
|
174
|
-
|
|
175
|
-
{
|
|
176
|
-
textureNode ._loadState .addInterest ("setTextureBit", this, index, textureNode);
|
|
150
|
+
textureNode ?._loadState .addInterest ("set_loadState__", this, textureNode, index);
|
|
177
151
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
152
|
+
this .set_loadState__ (textureNode, index);
|
|
153
|
+
},
|
|
154
|
+
set_loadState__: function (textureNode, index)
|
|
155
|
+
{
|
|
156
|
+
this .setTextureBit (index, textureNode, textureNode ?.checkLoadState () ?? X3DConstants .NOT_STARTED);
|
|
184
157
|
},
|
|
185
158
|
setTextureBit: function (bit, textureNode, loadState)
|
|
186
159
|
{
|
|
187
|
-
this .textureBits .set (bit, loadState
|
|
160
|
+
this .textureBits .set (bit, loadState === X3DConstants .COMPLETE_STATE || textureNode ?.getWidth ());
|
|
188
161
|
},
|
|
189
162
|
getColor: function (theta, color, angle)
|
|
190
163
|
{
|
|
@@ -199,7 +199,7 @@ NurbsCurve .prototype = Object .assign (Object .create (X3DParametricGeometryNod
|
|
|
199
199
|
});
|
|
200
200
|
|
|
201
201
|
this .sampleOptions .resolution [0] = this .getTessellation (knots .length);
|
|
202
|
-
this .sampleOptions .haveWeights =
|
|
202
|
+
this .sampleOptions .haveWeights = !! weights;
|
|
203
203
|
|
|
204
204
|
const
|
|
205
205
|
mesh = nurbs .sample (this .mesh, surface, this .sampleOptions),
|
|
@@ -157,7 +157,7 @@ NurbsCurve2D .prototype = Object .assign (Object .create (X3DNurbsControlCurveNo
|
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
this .sampleOptions .resolution [0] = this .getTessellation (knots .length);
|
|
160
|
-
this .sampleOptions .haveWeights =
|
|
160
|
+
this .sampleOptions .haveWeights = !! weights;
|
|
161
161
|
|
|
162
162
|
const
|
|
163
163
|
mesh = nurbs .sample (this .mesh, surface, this .sampleOptions),
|
|
@@ -187,7 +187,7 @@ NurbsOrientationInterpolator .prototype = Object .assign (Object .create (X3DChi
|
|
|
187
187
|
debug: false,
|
|
188
188
|
});
|
|
189
189
|
|
|
190
|
-
this .sampleOptions .haveWeights =
|
|
190
|
+
this .sampleOptions .haveWeights = !! weights;
|
|
191
191
|
|
|
192
192
|
const
|
|
193
193
|
mesh = nurbs .sample (this .mesh, surface, this .sampleOptions),
|
|
@@ -185,7 +185,7 @@ NurbsPositionInterpolator .prototype = Object .assign (Object .create (X3DChildN
|
|
|
185
185
|
debug: false,
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
this .sampleOptions .haveWeights =
|
|
188
|
+
this .sampleOptions .haveWeights = !! weights;
|
|
189
189
|
|
|
190
190
|
const
|
|
191
191
|
mesh = nurbs .sample (this .mesh, surface, this .sampleOptions),
|
|
@@ -211,7 +211,7 @@ X3DNurbsSurfaceGeometryNode .prototype = Object .assign (Object .create (X3DPara
|
|
|
211
211
|
sampleOptions .closed [0] = uClosed;
|
|
212
212
|
sampleOptions .closed [1] = vClosed;
|
|
213
213
|
sampleOptions .domain = undefined;
|
|
214
|
-
sampleOptions .haveWeights =
|
|
214
|
+
sampleOptions .haveWeights = !! weights;
|
|
215
215
|
sampleOptions .trimmingContours = this .getTrimmingContours ();
|
|
216
216
|
|
|
217
217
|
const
|
|
@@ -196,7 +196,7 @@ LinePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .p
|
|
|
196
196
|
|
|
197
197
|
var
|
|
198
198
|
pickedGeometries = this .getPickedGeometries (),
|
|
199
|
-
active =
|
|
199
|
+
active = !! pickedGeometries .length;
|
|
200
200
|
|
|
201
201
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
202
202
|
|
|
@@ -272,7 +272,7 @@ LinePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .p
|
|
|
272
272
|
|
|
273
273
|
var
|
|
274
274
|
pickedGeometries = this .getPickedGeometries (),
|
|
275
|
-
active =
|
|
275
|
+
active = !! pickedGeometries .length;
|
|
276
276
|
|
|
277
277
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
278
278
|
|
|
@@ -237,7 +237,7 @@ PointPickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .
|
|
|
237
237
|
|
|
238
238
|
var
|
|
239
239
|
pickedGeometries = this .getPickedGeometries (),
|
|
240
|
-
active =
|
|
240
|
+
active = !! pickedGeometries .length;
|
|
241
241
|
|
|
242
242
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
243
243
|
|
|
@@ -301,7 +301,7 @@ PointPickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .
|
|
|
301
301
|
|
|
302
302
|
var
|
|
303
303
|
pickedGeometries = this .getPickedGeometries (),
|
|
304
|
-
active =
|
|
304
|
+
active = !! pickedGeometries .length;
|
|
305
305
|
|
|
306
306
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
307
307
|
|
|
@@ -183,7 +183,7 @@ PrimitivePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNo
|
|
|
183
183
|
|
|
184
184
|
var
|
|
185
185
|
pickedGeometries = this .getPickedGeometries (),
|
|
186
|
-
active =
|
|
186
|
+
active = !! pickedGeometries .length;
|
|
187
187
|
|
|
188
188
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
189
189
|
|
|
@@ -236,7 +236,7 @@ PrimitivePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNo
|
|
|
236
236
|
|
|
237
237
|
var
|
|
238
238
|
pickedGeometries = this .getPickedGeometries (),
|
|
239
|
-
active =
|
|
239
|
+
active = !! pickedGeometries .length;
|
|
240
240
|
|
|
241
241
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
242
242
|
|
|
@@ -158,7 +158,7 @@ VolumePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode
|
|
|
158
158
|
|
|
159
159
|
var
|
|
160
160
|
pickedGeometries = this .getPickedGeometries (),
|
|
161
|
-
active =
|
|
161
|
+
active = !! pickedGeometries .length;
|
|
162
162
|
|
|
163
163
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
164
164
|
|
|
@@ -211,7 +211,7 @@ VolumePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode
|
|
|
211
211
|
|
|
212
212
|
var
|
|
213
213
|
pickedGeometries = this .getPickedGeometries (),
|
|
214
|
-
active =
|
|
214
|
+
active = !! pickedGeometries .length;
|
|
215
215
|
|
|
216
216
|
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
217
217
|
|
|
@@ -225,7 +225,7 @@ CollisionSensor .prototype = Object .assign (Object .create (X3DSensorNode .prot
|
|
|
225
225
|
},
|
|
226
226
|
this);
|
|
227
227
|
|
|
228
|
-
var active =
|
|
228
|
+
var active = !! contactNodes .length;
|
|
229
229
|
|
|
230
230
|
if (this ._isActive .getValue () !== active)
|
|
231
231
|
this ._isActive = active;
|
|
@@ -59,7 +59,7 @@ function MotorJoint (executionContext)
|
|
|
59
59
|
|
|
60
60
|
// Units
|
|
61
61
|
|
|
62
|
-
this .
|
|
62
|
+
this ._axis1Angle .setUnit ("angle");
|
|
63
63
|
this ._axis2Angle .setUnit ("angle");
|
|
64
64
|
this ._axis3Angle .setUnit ("angle");
|
|
65
65
|
this ._motor1Angle .setUnit ("angle");
|
|
@@ -315,8 +315,8 @@ Material .prototype = Object .assign (Object .create (X3DOneSidedMaterialNode .p
|
|
|
315
315
|
|
|
316
316
|
this .ambientTextureNode .setShaderUniforms (gl, shaderObject, renderObject, ambientTexture);
|
|
317
317
|
|
|
318
|
-
gl .uniform1i (ambientTexture .textureTransformMapping, textureTransformMapping .get (ambientTextureMapping)
|
|
319
|
-
gl .uniform1i (ambientTexture .textureCoordinateMapping, textureCoordinateMapping .get (ambientTextureMapping)
|
|
318
|
+
gl .uniform1i (ambientTexture .textureTransformMapping, textureTransformMapping .get (ambientTextureMapping) ?? 0);
|
|
319
|
+
gl .uniform1i (ambientTexture .textureCoordinateMapping, textureCoordinateMapping .get (ambientTextureMapping) ?? 0);
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
// Diffuse parameters
|
|
@@ -329,8 +329,8 @@ Material .prototype = Object .assign (Object .create (X3DOneSidedMaterialNode .p
|
|
|
329
329
|
|
|
330
330
|
this .diffuseTextureNode .setShaderUniforms (gl, shaderObject, renderObject, diffuseTexture);
|
|
331
331
|
|
|
332
|
-
gl .uniform1i (diffuseTexture .textureTransformMapping, textureTransformMapping .get (diffuseTextureMapping)
|
|
333
|
-
gl .uniform1i (diffuseTexture .textureCoordinateMapping, textureCoordinateMapping .get (diffuseTextureMapping)
|
|
332
|
+
gl .uniform1i (diffuseTexture .textureTransformMapping, textureTransformMapping .get (diffuseTextureMapping) ?? 0);
|
|
333
|
+
gl .uniform1i (diffuseTexture .textureCoordinateMapping, textureCoordinateMapping .get (diffuseTextureMapping) ?? 0);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
// Specular parameters
|
|
@@ -343,8 +343,8 @@ Material .prototype = Object .assign (Object .create (X3DOneSidedMaterialNode .p
|
|
|
343
343
|
|
|
344
344
|
this .specularTextureNode .setShaderUniforms (gl, shaderObject, renderObject, specularTexture);
|
|
345
345
|
|
|
346
|
-
gl .uniform1i (specularTexture .textureTransformMapping, textureTransformMapping .get (specularTextureMapping)
|
|
347
|
-
gl .uniform1i (specularTexture .textureCoordinateMapping, textureCoordinateMapping .get (specularTextureMapping)
|
|
346
|
+
gl .uniform1i (specularTexture .textureTransformMapping, textureTransformMapping .get (specularTextureMapping) ?? 0);
|
|
347
|
+
gl .uniform1i (specularTexture .textureCoordinateMapping, textureCoordinateMapping .get (specularTextureMapping) ?? 0);
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
// Shininess parameters
|
|
@@ -357,8 +357,8 @@ Material .prototype = Object .assign (Object .create (X3DOneSidedMaterialNode .p
|
|
|
357
357
|
|
|
358
358
|
this .shininessTextureNode .setShaderUniforms (gl, shaderObject, renderObject, shininessTexture);
|
|
359
359
|
|
|
360
|
-
gl .uniform1i (shininessTexture .textureTransformMapping, textureTransformMapping .get (shininessTextureMapping)
|
|
361
|
-
gl .uniform1i (shininessTexture .textureCoordinateMapping, textureCoordinateMapping .get (shininessTextureMapping)
|
|
360
|
+
gl .uniform1i (shininessTexture .textureTransformMapping, textureTransformMapping .get (shininessTextureMapping) ?? 0);
|
|
361
|
+
gl .uniform1i (shininessTexture .textureCoordinateMapping, textureCoordinateMapping .get (shininessTextureMapping) ?? 0);
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
// Occlusion parameters
|
|
@@ -373,8 +373,8 @@ Material .prototype = Object .assign (Object .create (X3DOneSidedMaterialNode .p
|
|
|
373
373
|
|
|
374
374
|
this .occlusionTextureNode .setShaderUniforms (gl, shaderObject, renderObject, occlusionTexture);
|
|
375
375
|
|
|
376
|
-
gl .uniform1i (occlusionTexture .textureTransformMapping, textureTransformMapping .get (occlusionTextureMapping)
|
|
377
|
-
gl .uniform1i (occlusionTexture .textureCoordinateMapping, textureCoordinateMapping .get (occlusionTextureMapping)
|
|
376
|
+
gl .uniform1i (occlusionTexture .textureTransformMapping, textureTransformMapping .get (occlusionTextureMapping) ?? 0);
|
|
377
|
+
gl .uniform1i (occlusionTexture .textureCoordinateMapping, textureCoordinateMapping .get (occlusionTextureMapping) ?? 0);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
},
|
|
@@ -257,8 +257,8 @@ PhysicalMaterial .prototype = Object .assign (Object .create (X3DOneSidedMateria
|
|
|
257
257
|
|
|
258
258
|
this .baseTextureNode .setShaderUniforms (gl, shaderObject, renderObject, baseTexture);
|
|
259
259
|
|
|
260
|
-
gl .uniform1i (baseTexture .textureTransformMapping, textureTransformMapping .get (baseTextureMapping)
|
|
261
|
-
gl .uniform1i (baseTexture .textureCoordinateMapping, textureCoordinateMapping .get (baseTextureMapping)
|
|
260
|
+
gl .uniform1i (baseTexture .textureTransformMapping, textureTransformMapping .get (baseTextureMapping) ?? 0);
|
|
261
|
+
gl .uniform1i (baseTexture .textureCoordinateMapping, textureCoordinateMapping .get (baseTextureMapping) ?? 0);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
// Metallic roughness parameters
|
|
@@ -271,8 +271,8 @@ PhysicalMaterial .prototype = Object .assign (Object .create (X3DOneSidedMateria
|
|
|
271
271
|
|
|
272
272
|
this .metallicRoughnessTextureNode .setShaderUniforms (gl, shaderObject, renderObject, metallicRoughnessTexture);
|
|
273
273
|
|
|
274
|
-
gl .uniform1i (metallicRoughnessTexture .textureTransformMapping, textureTransformMapping .get (metallicRoughnessTextureMapping)
|
|
275
|
-
gl .uniform1i (metallicRoughnessTexture .textureCoordinateMapping, textureCoordinateMapping .get (metallicRoughnessTextureMapping)
|
|
274
|
+
gl .uniform1i (metallicRoughnessTexture .textureTransformMapping, textureTransformMapping .get (metallicRoughnessTextureMapping) ?? 0);
|
|
275
|
+
gl .uniform1i (metallicRoughnessTexture .textureCoordinateMapping, textureCoordinateMapping .get (metallicRoughnessTextureMapping) ?? 0);
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
// Occlusion parameters
|
|
@@ -287,8 +287,8 @@ PhysicalMaterial .prototype = Object .assign (Object .create (X3DOneSidedMateria
|
|
|
287
287
|
|
|
288
288
|
this .occlusionTextureNode .setShaderUniforms (gl, shaderObject, renderObject, occlusionTexture);
|
|
289
289
|
|
|
290
|
-
gl .uniform1i (occlusionTexture .textureTransformMapping, textureTransformMapping .get (occlusionTextureMapping)
|
|
291
|
-
gl .uniform1i (occlusionTexture .textureCoordinateMapping, textureCoordinateMapping .get (occlusionTextureMapping)
|
|
290
|
+
gl .uniform1i (occlusionTexture .textureTransformMapping, textureTransformMapping .get (occlusionTextureMapping) ?? 0);
|
|
291
|
+
gl .uniform1i (occlusionTexture .textureCoordinateMapping, textureCoordinateMapping .get (occlusionTextureMapping) ?? 0);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
},
|
|
@@ -152,7 +152,7 @@ X3DMaterialNode .prototype = Object .assign (Object .create (X3DAppearanceChildN
|
|
|
152
152
|
key += textureNode ? 1 : 0;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
return this .shaderNodes .get (key)
|
|
155
|
+
return this .shaderNodes .get (key) ?? this .createShader (key, geometryContext, renderContext);
|
|
156
156
|
},
|
|
157
157
|
getShaderOptions: function (geometryContext, renderContext)
|
|
158
158
|
{
|
|
@@ -111,7 +111,7 @@ X3DOneSidedMaterialNode .prototype = Object .assign (Object .create (X3DMaterial
|
|
|
111
111
|
},
|
|
112
112
|
set_transparent__: function ()
|
|
113
113
|
{
|
|
114
|
-
this .setTransparent (
|
|
114
|
+
this .setTransparent (!! this .transparency);
|
|
115
115
|
},
|
|
116
116
|
getBaseTexture: function ()
|
|
117
117
|
{
|
|
@@ -175,8 +175,8 @@ X3DOneSidedMaterialNode .prototype = Object .assign (Object .create (X3DMaterial
|
|
|
175
175
|
|
|
176
176
|
this .emissiveTextureNode .setShaderUniforms (gl, shaderObject, renderObject, emissiveTexture);
|
|
177
177
|
|
|
178
|
-
gl .uniform1i (emissiveTexture .textureTransformMapping, textureTransformMapping .get (emissiveTextureMapping)
|
|
179
|
-
gl .uniform1i (emissiveTexture .textureCoordinateMapping, textureCoordinateMapping .get (emissiveTextureMapping)
|
|
178
|
+
gl .uniform1i (emissiveTexture .textureTransformMapping, textureTransformMapping .get (emissiveTextureMapping) ?? 0);
|
|
179
|
+
gl .uniform1i (emissiveTexture .textureCoordinateMapping, textureCoordinateMapping .get (emissiveTextureMapping) ?? 0);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
// Normal parameters
|
|
@@ -191,8 +191,8 @@ X3DOneSidedMaterialNode .prototype = Object .assign (Object .create (X3DMaterial
|
|
|
191
191
|
|
|
192
192
|
this .normalTextureNode .setShaderUniforms (gl, shaderObject, renderObject, normalTexture);
|
|
193
193
|
|
|
194
|
-
gl .uniform1i (normalTexture .textureTransformMapping, textureTransformMapping .get (normalTextureMapping)
|
|
195
|
-
gl .uniform1i (normalTexture .textureCoordinateMapping, textureCoordinateMapping .get (normalTextureMapping)
|
|
194
|
+
gl .uniform1i (normalTexture .textureTransformMapping, textureTransformMapping .get (normalTextureMapping) ?? 0);
|
|
195
|
+
gl .uniform1i (normalTexture .textureCoordinateMapping, textureCoordinateMapping .get (normalTextureMapping) ?? 0);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
},
|
|
@@ -57,7 +57,8 @@ function ListenerPointSource (executionContext)
|
|
|
57
57
|
|
|
58
58
|
this .addType (X3DConstants .ListenerPointSource);
|
|
59
59
|
|
|
60
|
-
this .addChildObjects ("
|
|
60
|
+
this .addChildObjects ("loop", new Fields .SFBool (),
|
|
61
|
+
"speed", new Fields .SFFloat (1));
|
|
61
62
|
|
|
62
63
|
this ._position .setUnit ("length");
|
|
63
64
|
}
|
|
@@ -57,7 +57,8 @@ function MicrophoneSource (executionContext)
|
|
|
57
57
|
|
|
58
58
|
this .addType (X3DConstants .MicrophoneSource);
|
|
59
59
|
|
|
60
|
-
this .addChildObjects ("
|
|
60
|
+
this .addChildObjects ("loop", new Fields .SFBool (),
|
|
61
|
+
"speed", new Fields .SFFloat (1));
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
MicrophoneSource .prototype = Object .assign (Object .create (X3DSoundSourceNode .prototype),
|
|
@@ -57,7 +57,8 @@ function OscillatorSource (executionContext)
|
|
|
57
57
|
|
|
58
58
|
this .addType (X3DConstants .OscillatorSource);
|
|
59
59
|
|
|
60
|
-
this .addChildObjects ("
|
|
60
|
+
this .addChildObjects ("loop", new Fields .SFBool (),
|
|
61
|
+
"speed", new Fields .SFFloat (1));
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
OscillatorSource .prototype = Object .assign (Object .create (X3DSoundSourceNode .prototype),
|
|
@@ -57,7 +57,8 @@ function StreamAudioSource (executionContext)
|
|
|
57
57
|
|
|
58
58
|
this .addType (X3DConstants .StreamAudioSource);
|
|
59
59
|
|
|
60
|
-
this .addChildObjects ("
|
|
60
|
+
this .addChildObjects ("loop", new Fields .SFBool (),
|
|
61
|
+
"speed", new Fields .SFFloat (1));
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
StreamAudioSource .prototype = Object .assign (Object .create (X3DSoundSourceNode .prototype),
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
+
import Fields from "../../Fields.js";
|
|
48
49
|
import X3DChildNode from "../Core/X3DChildNode.js";
|
|
49
50
|
import X3DTimeDependentNode from "../Time/X3DTimeDependentNode.js";
|
|
50
51
|
import X3DConstants from "../../Base/X3DConstants.js";
|
|
@@ -55,6 +56,8 @@ function X3DSoundProcessingNode (executionContext)
|
|
|
55
56
|
X3DTimeDependentNode .call (this, executionContext);
|
|
56
57
|
|
|
57
58
|
this .addType (X3DConstants .X3DSoundProcessingNode);
|
|
59
|
+
|
|
60
|
+
this .addChildObjects ("loop", new Fields .SFBool ());
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
X3DSoundProcessingNode .prototype = Object .assign (Object .create (X3DChildNode .prototype),
|
|
@@ -309,7 +309,7 @@ IsoSurfaceVolumeData .prototype = Object .assign (Object .create (X3DVolumeDataN
|
|
|
309
309
|
// this .getBrowser () .print (fs);
|
|
310
310
|
|
|
311
311
|
const vertexShader = new ShaderPart (this .getExecutionContext ());
|
|
312
|
-
vertexShader ._url .push ("data:x-shader/x-vertex," + vs);
|
|
312
|
+
vertexShader ._url .push (encodeURI ("data:x-shader/x-vertex," + vs));
|
|
313
313
|
vertexShader .setPrivate (true);
|
|
314
314
|
vertexShader .setName ("VolumeDataVertexShader");
|
|
315
315
|
vertexShader .setOptions (options);
|
|
@@ -317,7 +317,7 @@ IsoSurfaceVolumeData .prototype = Object .assign (Object .create (X3DVolumeDataN
|
|
|
317
317
|
|
|
318
318
|
const fragmentShader = new ShaderPart (this .getExecutionContext ());
|
|
319
319
|
fragmentShader ._type = "FRAGMENT";
|
|
320
|
-
fragmentShader ._url .push ("data:x-shader/x-fragment," + fs);
|
|
320
|
+
fragmentShader ._url .push (encodeURI ("data:x-shader/x-fragment," + fs));
|
|
321
321
|
fragmentShader .setPrivate (true);
|
|
322
322
|
fragmentShader .setName ("VolumeDataFragmentShader");
|
|
323
323
|
fragmentShader .setOptions (options);
|
|
@@ -222,7 +222,7 @@ SegmentedVolumeData .prototype = Object .assign (Object .create (X3DVolumeDataNo
|
|
|
222
222
|
// this .getBrowser () .print (fs);
|
|
223
223
|
|
|
224
224
|
const vertexShader = new ShaderPart (this .getExecutionContext ());
|
|
225
|
-
vertexShader ._url .push ("data:x-shader/x-vertex," + vs);
|
|
225
|
+
vertexShader ._url .push (encodeURI ("data:x-shader/x-vertex," + vs));
|
|
226
226
|
vertexShader .setPrivate (true);
|
|
227
227
|
vertexShader .setName ("SegmentedVolumeDataVertexShader");
|
|
228
228
|
vertexShader .setOptions (options);
|
|
@@ -230,7 +230,7 @@ SegmentedVolumeData .prototype = Object .assign (Object .create (X3DVolumeDataNo
|
|
|
230
230
|
|
|
231
231
|
const fragmentShader = new ShaderPart (this .getExecutionContext ());
|
|
232
232
|
fragmentShader ._type = "FRAGMENT";
|
|
233
|
-
fragmentShader ._url .push ("data:x-shader/x-fragment," + fs);
|
|
233
|
+
fragmentShader ._url .push (encodeURI ("data:x-shader/x-fragment," + fs));
|
|
234
234
|
fragmentShader .setPrivate (true);
|
|
235
235
|
fragmentShader .setName ("SegmentedVolumeDataFragmentShader");
|
|
236
236
|
fragmentShader .setOptions (options);
|
|
@@ -162,7 +162,7 @@ VolumeData .prototype = Object .assign (Object .create (X3DVolumeDataNode .proto
|
|
|
162
162
|
// this .getBrowser () .print (fs);
|
|
163
163
|
|
|
164
164
|
const vertexShader = new ShaderPart (this .getExecutionContext ());
|
|
165
|
-
vertexShader ._url .push ("data:x-shader/x-vertex," + vs);
|
|
165
|
+
vertexShader ._url .push (encodeURI ("data:x-shader/x-vertex," + vs));
|
|
166
166
|
vertexShader .setPrivate (true);
|
|
167
167
|
vertexShader .setName ("VolumeDataVertexShader");
|
|
168
168
|
vertexShader .setOptions (options);
|
|
@@ -170,7 +170,7 @@ VolumeData .prototype = Object .assign (Object .create (X3DVolumeDataNode .proto
|
|
|
170
170
|
|
|
171
171
|
const fragmentShader = new ShaderPart (this .getExecutionContext ());
|
|
172
172
|
fragmentShader ._type = "FRAGMENT";
|
|
173
|
-
fragmentShader ._url .push ("data:x-shader/x-fragment," + fs);
|
|
173
|
+
fragmentShader ._url .push (encodeURI ("data:x-shader/x-fragment," + fs));
|
|
174
174
|
fragmentShader .setPrivate (true);
|
|
175
175
|
fragmentShader .setName ("VolumeDataFragmentShader");
|
|
176
176
|
fragmentShader .setOptions (options);
|
|
@@ -113,7 +113,7 @@ const handler =
|
|
|
113
113
|
{
|
|
114
114
|
try
|
|
115
115
|
{
|
|
116
|
-
return
|
|
116
|
+
return !! target .getValue () .getField (key);
|
|
117
117
|
}
|
|
118
118
|
catch (error)
|
|
119
119
|
{
|
|
@@ -299,7 +299,7 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
299
299
|
|
|
300
300
|
throw new Error ("SFNode.getFieldDefinitions: node is null.");
|
|
301
301
|
},
|
|
302
|
-
addFieldCallback: function (name,
|
|
302
|
+
addFieldCallback: function (name, key, object)
|
|
303
303
|
{
|
|
304
304
|
const target = this [_target];
|
|
305
305
|
|
|
@@ -314,13 +314,13 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
314
314
|
const value = target .getValue ();
|
|
315
315
|
|
|
316
316
|
if (value)
|
|
317
|
-
return value .getField (name) .addFieldCallback (
|
|
317
|
+
return value .getField (name) .addFieldCallback (key, object);
|
|
318
318
|
|
|
319
319
|
throw new Error ("SFNode.addFieldCallback: node is null.");
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
},
|
|
323
|
-
removeFieldCallback: function (name,
|
|
323
|
+
removeFieldCallback: function (name, key)
|
|
324
324
|
{
|
|
325
325
|
const target = this [_target];
|
|
326
326
|
|
|
@@ -335,7 +335,7 @@ SFNode .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
335
335
|
const value = target .getValue ();
|
|
336
336
|
|
|
337
337
|
if (value)
|
|
338
|
-
return value .getField (name) .removeFieldCallback (
|
|
338
|
+
return value .getField (name) .removeFieldCallback (key);
|
|
339
339
|
|
|
340
340
|
throw new Error ("SFNode.removeFieldCallback: node is null.");
|
|
341
341
|
}
|