x_ite 8.8.1 → 8.8.3
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/Makefile +1 -1
- 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 +25 -25
- 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 +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +72 -62
- 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 +18 -18
- 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 +61 -63
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_posts/reference/field-services-and-objects.md +4 -2
- package/package.json +1 -1
- package/src/x_ite/Base/X3DBaseNode.js +1 -1
- package/src/x_ite/Browser/Scripting/evaluate.js +13 -4
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +1 -3
- package/src/x_ite/Components/Scripting/Script.js +22 -21
- package/src/x_ite/Parser/VRMLParser.js +1 -1
package/dist/x_ite.zip
CHANGED
|
Binary file
|
package/docs/_config.yml
CHANGED
|
@@ -391,9 +391,11 @@ The SFNode object corresponds to an X3D SFNode field.
|
|
|
391
391
|
|
|
392
392
|
### Instance Creation Method(s)
|
|
393
393
|
|
|
394
|
-
#### *sfNodeObjectName* = new **SFNode** (*
|
|
394
|
+
#### *sfNodeObjectName* = new **SFNode** (*vrmlSyntax*)
|
|
395
395
|
|
|
396
|
-
*
|
|
396
|
+
*vrmlSyntax* is a UTF-8 string containing the definition of an X3D node.
|
|
397
|
+
|
|
398
|
+
If the specification version is greater than 2.0, SFNode will throw an error when instantiated directly.
|
|
397
399
|
|
|
398
400
|
### Properties
|
|
399
401
|
|
package/package.json
CHANGED
|
@@ -81,8 +81,8 @@ function X3DBaseNode (executionContext)
|
|
|
81
81
|
this [_childObjects] = [ ];
|
|
82
82
|
this [_live] = true;
|
|
83
83
|
this [_initialized] = false;
|
|
84
|
-
this [_cloneCount] = 0;
|
|
85
84
|
this [_private] = false;
|
|
85
|
+
this [_cloneCount] = 0;
|
|
86
86
|
|
|
87
87
|
if (this .canUserDefinedFields ())
|
|
88
88
|
this [_fieldDefinitions] = new FieldDefinitionArray (this [_fieldDefinitions]);
|
|
@@ -49,11 +49,20 @@ function evaluate (globalObject, sourceText)
|
|
|
49
49
|
{
|
|
50
50
|
return Function (/* js */ `with (arguments [0])
|
|
51
51
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
return eval ((() =>
|
|
53
|
+
{
|
|
54
|
+
const sourceText = arguments [1];
|
|
55
|
+
|
|
56
|
+
delete arguments [0];
|
|
57
|
+
delete arguments [1];
|
|
58
|
+
|
|
59
|
+
arguments .length = 0;
|
|
60
|
+
|
|
61
|
+
return sourceText;
|
|
62
|
+
})
|
|
63
|
+
());
|
|
55
64
|
}`)
|
|
56
|
-
(globalObject);
|
|
65
|
+
(globalObject, sourceText);
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
export default evaluate;
|
|
@@ -384,13 +384,11 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
|
|
|
384
384
|
},
|
|
385
385
|
createVrmlFromString (vrmlSyntax)
|
|
386
386
|
{
|
|
387
|
-
vrmlSyntax = String (vrmlSyntax);
|
|
388
|
-
|
|
389
387
|
const
|
|
390
388
|
currentScene = this .currentScene,
|
|
391
389
|
external = this .isExternal (),
|
|
392
390
|
fileLoader = new FileLoader (this .getWorld ()),
|
|
393
|
-
scene = fileLoader .createX3DFromString (currentScene .getWorldURL (), vrmlSyntax);
|
|
391
|
+
scene = fileLoader .createX3DFromString (currentScene .getWorldURL (), `#VRML V2.0 utf8\n\n${vrmlSyntax}`);
|
|
394
392
|
|
|
395
393
|
if (!external)
|
|
396
394
|
{
|
|
@@ -167,7 +167,7 @@ Object .assign (Object .setPrototypeOf (Script .prototype, X3DScriptNode .protot
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
sourceText += "\
|
|
170
|
+
sourceText += "\n[" + callbacks .map (function (c)
|
|
171
171
|
{
|
|
172
172
|
return `typeof ${c} !== "undefined" ? ${c} : undefined`;
|
|
173
173
|
})
|
|
@@ -176,7 +176,7 @@ Object .assign (Object .setPrototypeOf (Script .prototype, X3DScriptNode .protot
|
|
|
176
176
|
this .globalObject = this .getGlobalObject ();
|
|
177
177
|
|
|
178
178
|
const
|
|
179
|
-
result =
|
|
179
|
+
result = this .evaluate (sourceText),
|
|
180
180
|
context = new Map ();
|
|
181
181
|
|
|
182
182
|
for (let i = 0; i < callbacks .length; ++ i)
|
|
@@ -193,36 +193,37 @@ Object .assign (Object .setPrototypeOf (Script .prototype, X3DScriptNode .protot
|
|
|
193
193
|
},
|
|
194
194
|
evaluate (sourceText)
|
|
195
195
|
{
|
|
196
|
-
|
|
196
|
+
const browser = this .getBrowser ();
|
|
197
|
+
|
|
198
|
+
browser .getScriptStack () .push (this);
|
|
199
|
+
|
|
200
|
+
try
|
|
201
|
+
{
|
|
202
|
+
return evaluate (this .globalObject, sourceText);
|
|
203
|
+
}
|
|
204
|
+
finally
|
|
205
|
+
{
|
|
206
|
+
browser .getScriptStack () .pop ();
|
|
207
|
+
}
|
|
197
208
|
},
|
|
198
209
|
getGlobalObject ()
|
|
199
210
|
{
|
|
200
|
-
const
|
|
201
|
-
browser = this .getBrowser (),
|
|
202
|
-
executionContext = this .getExecutionContext (),
|
|
203
|
-
live = this .getLive ();
|
|
211
|
+
const browser = this .getBrowser ();
|
|
204
212
|
|
|
205
213
|
function SFNode (vrmlSyntax)
|
|
206
214
|
{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
rootNodes = scene .getRootNodes ();
|
|
215
|
+
if (browser .currentScene .specificationVersion > 2.0)
|
|
216
|
+
throw new Error ("SFNode cannot be instantiated directly.");
|
|
210
217
|
|
|
211
|
-
|
|
218
|
+
const nodes = browser .createVrmlFromString (vrmlSyntax);
|
|
212
219
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
scene .setExecutionContext (executionContext);
|
|
216
|
-
|
|
217
|
-
if (rootNodes .length && rootNodes [0])
|
|
218
|
-
{
|
|
219
|
-
return rootNodes [0];
|
|
220
|
-
}
|
|
220
|
+
if (nodes .length && nodes [0])
|
|
221
|
+
return nodes [0];
|
|
221
222
|
|
|
222
|
-
throw new Error ("SFNode.new: invalid argument
|
|
223
|
+
throw new Error ("SFNode.new: invalid argument.");
|
|
223
224
|
}
|
|
224
225
|
|
|
225
|
-
|
|
226
|
+
SFNode .prototype = Fields .SFNode .prototype;
|
|
226
227
|
|
|
227
228
|
const globalObject =
|
|
228
229
|
{
|
|
@@ -359,7 +359,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, X3DParser .protot
|
|
|
359
359
|
this .getScene () .setProfile (this .getBrowser () .getProfile ("Core"));
|
|
360
360
|
|
|
361
361
|
for (const componentName of VRML)
|
|
362
|
-
this .getScene () .
|
|
362
|
+
this .getScene () .updateComponent (this .getBrowser () .getComponent (componentName));
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
if (this .resolve)
|