x_ite 8.7.3 → 8.7.5
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/.vscode/tasks.json +1 -1
- package/build/bin/bump.pl +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 +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 +36 -31
- 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 +22 -22
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +20 -20
- 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 +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 +31 -31
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- 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 +1297 -1436
- 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 +27 -7
- package/package.json +2 -2
- package/src/standard/Math/Algorithms/eigen_decomposition.js +9 -9
- package/src/standard/Math/Geometry/Box2.js +20 -20
- package/src/standard/Math/Geometry/Box3.js +20 -20
- package/src/standard/Math/Numbers/Color3.js +10 -18
- package/src/standard/Math/Numbers/Color4.js +12 -23
- package/src/standard/Math/Numbers/Complex.js +59 -54
- package/src/standard/Math/Numbers/Matrix2.js +31 -45
- package/src/standard/Math/Numbers/Matrix3.js +59 -94
- package/src/standard/Math/Numbers/Matrix4.js +73 -114
- package/src/standard/Math/Numbers/Quaternion.js +49 -65
- package/src/standard/Math/Numbers/Rotation4.js +15 -13
- package/src/standard/Math/Numbers/Vector2.js +12 -14
- package/src/standard/Math/Numbers/Vector3.js +17 -22
- package/src/standard/Math/Numbers/Vector4.js +22 -30
- package/src/x_ite/Base/FieldArray.js +3 -2
- package/src/x_ite/Base/FieldDefinitionArray.js +3 -2
- package/src/x_ite/Base/X3DArrayField.js +27 -3
- package/src/x_ite/Base/X3DInfoArray.js +73 -14
- package/src/x_ite/Base/X3DObject.js +5 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +3 -3
- package/src/x_ite/Browser/Layout/ScreenText.js +9 -4
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +60 -67
- package/src/x_ite/Browser/X3DBrowserContext.js +8 -8
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +4 -4
- package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +2 -3
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +2 -2
- package/src/x_ite/Configuration/ComponentInfoArray.js +2 -2
- package/src/x_ite/Configuration/ProfileInfoArray.js +2 -2
- package/src/x_ite/Configuration/UnitInfoArray.js +15 -1
- package/src/x_ite/Execution/BindableList.js +1 -1
- package/src/x_ite/Execution/ExportedNodesArray.js +4 -3
- package/src/x_ite/Execution/ImportedNodesArray.js +4 -3
- package/src/x_ite/Execution/NamedNodesArray.js +16 -2
- package/src/x_ite/Execution/X3DExecutionContext.js +52 -58
- package/src/x_ite/Execution/X3DExportedNode.js +13 -11
- package/src/x_ite/Execution/X3DImportedNode.js +25 -25
- package/src/x_ite/Execution/X3DScene.js +130 -54
- package/src/x_ite/Fields/SFColor.js +10 -15
- package/src/x_ite/Fields/SFColorRGBA.js +11 -18
- package/src/x_ite/Fields/SFImage.js +38 -33
- package/src/x_ite/Fields/SFMatrix3.js +1 -3
- package/src/x_ite/Fields/SFMatrix4.js +1 -5
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +6 -5
- package/src/x_ite/Fields/SFNode.js +1 -1
- package/src/x_ite/Fields/SFRotation.js +14 -21
- package/src/x_ite/Fields/SFString.js +0 -1
- package/src/x_ite/Fields/SFVec2.js +8 -15
- package/src/x_ite/Fields/SFVec3.js +10 -17
- package/src/x_ite/Fields/SFVec4.js +12 -23
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +15 -14
- package/src/x_ite/InputOutput/FileLoader.js +2 -2
- package/src/x_ite/Parser/SVGParser.js +2 -2
- package/src/x_ite/Parser/X3DOptimizer.js +1 -1
- package/src/x_ite/Parser/XMLParser.js +18 -18
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +3 -2
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +4 -3
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +26 -27
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +16 -15
- package/src/x_ite/Routing/RouteArray.js +3 -2
- package/src/x_ite/Routing/X3DRoute.js +26 -25
- package/src/x_ite/Execution/Scene.js +0 -145
|
@@ -54,7 +54,6 @@ function Vector2 (x, y)
|
|
|
54
54
|
Vector2 .prototype =
|
|
55
55
|
{
|
|
56
56
|
constructor: Vector2,
|
|
57
|
-
length: 2,
|
|
58
57
|
[Symbol .iterator]: function* ()
|
|
59
58
|
{
|
|
60
59
|
yield this .x;
|
|
@@ -214,20 +213,19 @@ Vector2 .prototype =
|
|
|
214
213
|
}
|
|
215
214
|
};
|
|
216
215
|
|
|
217
|
-
Object .
|
|
216
|
+
Object .defineProperties (Vector2 .prototype,
|
|
218
217
|
{
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
configurable: false
|
|
218
|
+
length: { value: 2 },
|
|
219
|
+
0:
|
|
220
|
+
{
|
|
221
|
+
get: function () { return this .x; },
|
|
222
|
+
set: function (value) { this .x = value; },
|
|
223
|
+
},
|
|
224
|
+
1:
|
|
225
|
+
{
|
|
226
|
+
get: function () { return this .y; },
|
|
227
|
+
set: function (value) { this .y = value; },
|
|
228
|
+
},
|
|
231
229
|
});
|
|
232
230
|
|
|
233
231
|
Object .assign (Vector2,
|
|
@@ -57,7 +57,6 @@ function Vector3 (x, y, z)
|
|
|
57
57
|
Vector3 .prototype =
|
|
58
58
|
{
|
|
59
59
|
constructor: Vector3,
|
|
60
|
-
length: 3,
|
|
61
60
|
[Symbol .iterator]: function* ()
|
|
62
61
|
{
|
|
63
62
|
yield this .x;
|
|
@@ -262,28 +261,24 @@ Vector3 .prototype =
|
|
|
262
261
|
}
|
|
263
262
|
};
|
|
264
263
|
|
|
265
|
-
Object .
|
|
264
|
+
Object .defineProperties (Vector3 .prototype,
|
|
266
265
|
{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
{
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
get: function () { return this .z; },
|
|
284
|
-
set: function (value) { this .z = value; },
|
|
285
|
-
enumerable: false,
|
|
286
|
-
configurable: false
|
|
266
|
+
length: { value: 3 },
|
|
267
|
+
0:
|
|
268
|
+
{
|
|
269
|
+
get: function () { return this .x; },
|
|
270
|
+
set: function (value) { this .x = value; },
|
|
271
|
+
},
|
|
272
|
+
1:
|
|
273
|
+
{
|
|
274
|
+
get: function () { return this .y; },
|
|
275
|
+
set: function (value) { this .y = value; },
|
|
276
|
+
},
|
|
277
|
+
2:
|
|
278
|
+
{
|
|
279
|
+
get: function () { return this .z; },
|
|
280
|
+
set: function (value) { this .z = value; },
|
|
281
|
+
},
|
|
287
282
|
});
|
|
288
283
|
|
|
289
284
|
Object .assign (Vector3,
|
|
@@ -56,7 +56,6 @@ function Vector4 (x, y, z, w)
|
|
|
56
56
|
Vector4 .prototype =
|
|
57
57
|
{
|
|
58
58
|
constructor: Vector4,
|
|
59
|
-
length: 4,
|
|
60
59
|
[Symbol .iterator]: function* ()
|
|
61
60
|
{
|
|
62
61
|
yield this .x;
|
|
@@ -271,36 +270,29 @@ Vector4 .prototype =
|
|
|
271
270
|
},
|
|
272
271
|
};
|
|
273
272
|
|
|
274
|
-
Object .
|
|
273
|
+
Object .defineProperties (Vector4 .prototype,
|
|
275
274
|
{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
{
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
Object .defineProperty (Vector4 .prototype, "3",
|
|
299
|
-
{
|
|
300
|
-
get: function () { return this .w; },
|
|
301
|
-
set: function (value) { this .w = value; },
|
|
302
|
-
enumerable: false,
|
|
303
|
-
configurable: false
|
|
275
|
+
length: { value: 4 },
|
|
276
|
+
0:
|
|
277
|
+
{
|
|
278
|
+
get: function () { return this .x; },
|
|
279
|
+
set: function (value) { this .x = value; },
|
|
280
|
+
},
|
|
281
|
+
1:
|
|
282
|
+
{
|
|
283
|
+
get: function () { return this .y; },
|
|
284
|
+
set: function (value) { this .y = value; },
|
|
285
|
+
},
|
|
286
|
+
2:
|
|
287
|
+
{
|
|
288
|
+
get: function () { return this .z; },
|
|
289
|
+
set: function (value) { this .z = value; },
|
|
290
|
+
},
|
|
291
|
+
3:
|
|
292
|
+
{
|
|
293
|
+
get: function () { return this .w; },
|
|
294
|
+
set: function (value) { this .w = value; },
|
|
295
|
+
},
|
|
304
296
|
});
|
|
305
297
|
|
|
306
298
|
Object .assign (Vector4,
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
48
|
import X3DInfoArray from "./X3DInfoArray.js";
|
|
49
|
+
import X3DField from "./X3DField.js";
|
|
49
50
|
|
|
50
|
-
function FieldArray ()
|
|
51
|
+
function FieldArray (values)
|
|
51
52
|
{
|
|
52
|
-
return X3DInfoArray .call (this);
|
|
53
|
+
return X3DInfoArray .call (this, values, X3DField);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
FieldArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import X3DInfoArray
|
|
48
|
+
import X3DInfoArray from "./X3DInfoArray.js";
|
|
49
|
+
import X3DFieldDefinition from "./X3DFieldDefinition.js"
|
|
49
50
|
|
|
50
51
|
function FieldDefinitionArray (values)
|
|
51
52
|
{
|
|
52
|
-
return X3DInfoArray .call (this, values);
|
|
53
|
+
return X3DInfoArray .call (this, values, X3DFieldDefinition);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
FieldDefinitionArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
|
|
@@ -64,7 +64,7 @@ X3DArrayField .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
64
64
|
fill: Array .prototype .fill,
|
|
65
65
|
filter: function (callbackFn, thisArg)
|
|
66
66
|
{
|
|
67
|
-
return new (this .
|
|
67
|
+
return new (this .constructor) (... Array .prototype .filter .call (this, callbackFn, thisArg));
|
|
68
68
|
},
|
|
69
69
|
find: Array .prototype .find,
|
|
70
70
|
findIndex: Array .prototype .findIndex,
|
|
@@ -80,18 +80,42 @@ X3DArrayField .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
80
80
|
lastIndexOf: Array .prototype .lastIndexOf,
|
|
81
81
|
map: function (callbackFn, thisArg)
|
|
82
82
|
{
|
|
83
|
-
return new (this .
|
|
83
|
+
return new (this .constructor) (... Array .prototype .map .call (this, callbackFn, thisArg));
|
|
84
84
|
},
|
|
85
85
|
reduce: Array .prototype .reduce,
|
|
86
86
|
reduceRight: Array .prototype .reduceRight,
|
|
87
87
|
reverse: Array .prototype .reverse,
|
|
88
88
|
slice: function (start, end)
|
|
89
89
|
{
|
|
90
|
-
return new (this .
|
|
90
|
+
return new (this .constructor) (... Array .prototype .slice .call (this, start, end));
|
|
91
91
|
},
|
|
92
92
|
some: Array .prototype .some,
|
|
93
93
|
sort: Array .prototype .sort,
|
|
94
|
+
toReversed: function ()
|
|
95
|
+
{
|
|
96
|
+
return this .copy () .reverse ();
|
|
97
|
+
},
|
|
98
|
+
toSorted: function (compareFn)
|
|
99
|
+
{
|
|
100
|
+
return this .copy () .sort (compareFn);
|
|
101
|
+
},
|
|
102
|
+
toSpliced: function (start, deleteCount, ... insertValues)
|
|
103
|
+
{
|
|
104
|
+
const copy = this .copy ();
|
|
105
|
+
|
|
106
|
+
copy .splice (start, deleteCount, ... insertValues);
|
|
107
|
+
|
|
108
|
+
return copy;
|
|
109
|
+
},
|
|
94
110
|
values: Array .prototype .values,
|
|
111
|
+
with: function (index, value)
|
|
112
|
+
{
|
|
113
|
+
const copy = this .copy ();
|
|
114
|
+
|
|
115
|
+
copy [index] = value;
|
|
116
|
+
|
|
117
|
+
return copy;
|
|
118
|
+
},
|
|
95
119
|
});
|
|
96
120
|
|
|
97
121
|
for (const key of Reflect .ownKeys (X3DArrayField .prototype))
|
|
@@ -108,16 +108,20 @@ const handler =
|
|
|
108
108
|
},
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
function X3DInfoArray (values)
|
|
111
|
+
function X3DInfoArray (values, ValueType)
|
|
112
112
|
{
|
|
113
|
-
this [_array]
|
|
114
|
-
this [_index]
|
|
115
|
-
this [Symbol .iterator] = this [_array] [Symbol .iterator];
|
|
113
|
+
this [_array] = [ ];
|
|
114
|
+
this [_index] = new Map ();
|
|
116
115
|
|
|
117
116
|
if (values)
|
|
118
117
|
{
|
|
119
118
|
for (const value of values)
|
|
119
|
+
{
|
|
120
|
+
if (!(value instanceof ValueType))
|
|
121
|
+
throw new TypeError (`Wrong type in construction of ${this .getTypeName ()}.`);
|
|
122
|
+
|
|
120
123
|
this .add (value .name, value);
|
|
124
|
+
}
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
return new Proxy (this, handler);
|
|
@@ -125,11 +129,19 @@ function X3DInfoArray (values)
|
|
|
125
129
|
|
|
126
130
|
X3DInfoArray .prototype = {
|
|
127
131
|
constructor: X3DInfoArray,
|
|
132
|
+
[Symbol .iterator]: function* ()
|
|
133
|
+
{
|
|
134
|
+
yield* this [_array];
|
|
135
|
+
},
|
|
136
|
+
copy: function ()
|
|
137
|
+
{
|
|
138
|
+
return new (this .constructor) (this [_array]);
|
|
139
|
+
},
|
|
128
140
|
equals: function (array)
|
|
129
141
|
{
|
|
130
142
|
const
|
|
131
143
|
a = this [_array],
|
|
132
|
-
b = array [_array]
|
|
144
|
+
b = array [_array],
|
|
133
145
|
length = a .length;
|
|
134
146
|
|
|
135
147
|
if (a === b)
|
|
@@ -165,6 +177,8 @@ X3DInfoArray .prototype = {
|
|
|
165
177
|
},
|
|
166
178
|
update: function (oldKey, newKey, value)
|
|
167
179
|
{
|
|
180
|
+
// TODO: update alias.
|
|
181
|
+
|
|
168
182
|
const oldValue = this [_index] .get (oldKey);
|
|
169
183
|
|
|
170
184
|
if (oldKey !== newKey)
|
|
@@ -187,6 +201,8 @@ X3DInfoArray .prototype = {
|
|
|
187
201
|
},
|
|
188
202
|
remove: function (key)
|
|
189
203
|
{
|
|
204
|
+
// TODO: remove alias.
|
|
205
|
+
|
|
190
206
|
const value = this [_index] .get (key);
|
|
191
207
|
|
|
192
208
|
if (value === undefined)
|
|
@@ -200,29 +216,65 @@ X3DInfoArray .prototype = {
|
|
|
200
216
|
this [_array] .splice (index, 1);
|
|
201
217
|
},
|
|
202
218
|
at: Array .prototype .at,
|
|
203
|
-
concat: Array .prototype .concat,
|
|
219
|
+
// concat: Array .prototype .concat,
|
|
220
|
+
// copyWithin: Array.prototype.copyWithin,
|
|
204
221
|
entries: Array .prototype .entries,
|
|
205
222
|
every: Array .prototype .every,
|
|
206
|
-
fill: Array .prototype .fill,
|
|
207
|
-
filter:
|
|
223
|
+
// fill: Array .prototype .fill,
|
|
224
|
+
filter: function (callbackFn, thisArg)
|
|
225
|
+
{
|
|
226
|
+
return new (this .constructor) (Array .prototype .filter .call (this, callbackFn, thisArg));
|
|
227
|
+
},
|
|
208
228
|
find: Array .prototype .find,
|
|
209
229
|
findIndex: Array .prototype .findIndex,
|
|
210
230
|
findLast: Array .prototype .findLast,
|
|
211
231
|
findLastIndex: Array .prototype .findLastIndex,
|
|
212
|
-
flat: Array .prototype .flat,
|
|
213
|
-
flatMap: Array .prototype .flatMap,
|
|
232
|
+
// flat: Array .prototype .flat,
|
|
233
|
+
// flatMap: Array .prototype .flatMap,
|
|
214
234
|
forEach: Array .prototype .forEach,
|
|
215
235
|
includes: Array .prototype .includes,
|
|
216
236
|
indexOf: Array .prototype .indexOf,
|
|
217
237
|
join: Array .prototype .join,
|
|
218
238
|
keys: Array .prototype .keys,
|
|
219
239
|
lastIndexOf: Array .prototype .lastIndexOf,
|
|
220
|
-
map:
|
|
240
|
+
map: function (callbackFn, thisArg)
|
|
241
|
+
{
|
|
242
|
+
return new (this .constructor) (Array .prototype .map .call (this, callbackFn, thisArg));
|
|
243
|
+
},
|
|
221
244
|
reduce: Array .prototype .reduce,
|
|
222
245
|
reduceRight: Array .prototype .reduceRight,
|
|
223
|
-
|
|
246
|
+
// reverse: Array .prototype .reverse,
|
|
247
|
+
slice: function (start, end)
|
|
248
|
+
{
|
|
249
|
+
return new (this .constructor) (Array .prototype .slice .call (this, start, end));
|
|
250
|
+
},
|
|
224
251
|
some: Array .prototype .some,
|
|
252
|
+
// sort: Array .prototype .sort,
|
|
253
|
+
toReversed: function ()
|
|
254
|
+
{
|
|
255
|
+
return new (this .constructor) ([... this] .reverse ());
|
|
256
|
+
},
|
|
257
|
+
toSorted: function (compareFn)
|
|
258
|
+
{
|
|
259
|
+
return new (this .constructor) ([... this] .sort (compareFn));
|
|
260
|
+
},
|
|
261
|
+
toSpliced: function (start, deleteCount, ... insertValues)
|
|
262
|
+
{
|
|
263
|
+
const array = [... this];
|
|
264
|
+
|
|
265
|
+
array .splice (start, deleteCount, ... insertValues)
|
|
266
|
+
|
|
267
|
+
return new (this .constructor) (array);
|
|
268
|
+
},
|
|
225
269
|
values: Array .prototype .values,
|
|
270
|
+
with: function (index, value)
|
|
271
|
+
{
|
|
272
|
+
const array = [... this];
|
|
273
|
+
|
|
274
|
+
array [index] = value;
|
|
275
|
+
|
|
276
|
+
return new (this .constructor) (array);
|
|
277
|
+
},
|
|
226
278
|
toString: function (options = Object .prototype)
|
|
227
279
|
{
|
|
228
280
|
const generator = new Generator (options);
|
|
@@ -304,9 +356,16 @@ X3DInfoArray .prototype = {
|
|
|
304
356
|
for (const key of Reflect .ownKeys (X3DInfoArray .prototype))
|
|
305
357
|
Object .defineProperty (X3DInfoArray .prototype, key, { enumerable: false });
|
|
306
358
|
|
|
307
|
-
Object .
|
|
359
|
+
Object .defineProperties (X3DInfoArray .prototype,
|
|
308
360
|
{
|
|
309
|
-
|
|
361
|
+
length:
|
|
362
|
+
{
|
|
363
|
+
get: function () { return this [_array] .length; },
|
|
364
|
+
},
|
|
365
|
+
[Symbol .toStringTag]:
|
|
366
|
+
{
|
|
367
|
+
get: function () { return this .getTypeName (); },
|
|
368
|
+
},
|
|
310
369
|
});
|
|
311
370
|
|
|
312
371
|
export default X3DInfoArray;
|
|
@@ -197,6 +197,11 @@ X3DObject .prototype =
|
|
|
197
197
|
for (const key of Reflect .ownKeys (X3DObject .prototype))
|
|
198
198
|
Object .defineProperty (X3DObject .prototype, key, { enumerable: false });
|
|
199
199
|
|
|
200
|
+
Object .defineProperty (X3DObject .prototype, Symbol .toStringTag,
|
|
201
|
+
{
|
|
202
|
+
get: function () { return this .getTypeName (); },
|
|
203
|
+
});
|
|
204
|
+
|
|
200
205
|
Object .assign (X3DObject,
|
|
201
206
|
{
|
|
202
207
|
getId: (function ()
|
|
@@ -54,7 +54,7 @@ import RenderingProperties from "./RenderingProperties.js";
|
|
|
54
54
|
import Notification from "./Notification.js";
|
|
55
55
|
import ContextMenu from "./ContextMenu.js";
|
|
56
56
|
import URLs from "../Networking/URLs.js";
|
|
57
|
-
import
|
|
57
|
+
import X3DScene from "../../Execution/X3DScene.js";
|
|
58
58
|
import DataStorage from "../../../standard/Utility/DataStorage.js";
|
|
59
59
|
import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
|
|
60
60
|
import _ from "../../../locale/gettext.js";
|
|
@@ -270,9 +270,9 @@ X3DCoreContext .prototype =
|
|
|
270
270
|
if (this [_privateScene])
|
|
271
271
|
return this [_privateScene];
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// X3DScene for default nodes.
|
|
274
274
|
|
|
275
|
-
this [_privateScene] = new
|
|
275
|
+
this [_privateScene] = new X3DScene (this);
|
|
276
276
|
|
|
277
277
|
this [_privateScene] .setPrivate (true);
|
|
278
278
|
this [_privateScene] .setLive (true);
|
|
@@ -393,11 +393,16 @@ ScreenText .prototype = Object .assign (Object .create (X3DTextGeometry .prototy
|
|
|
393
393
|
|
|
394
394
|
renderContext .textureNode = this .textureNode;
|
|
395
395
|
},
|
|
396
|
-
transformLine: function (
|
|
396
|
+
transformLine: (function ()
|
|
397
397
|
{
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
const invMatrix = new Matrix4 ();
|
|
399
|
+
|
|
400
|
+
return function (line)
|
|
401
|
+
{
|
|
402
|
+
// Apply screen nodes transformation in place here.
|
|
403
|
+
return line .multLineMatrix (invMatrix .assign (this .matrix) .inverse ());
|
|
404
|
+
};
|
|
405
|
+
})(),
|
|
401
406
|
transformMatrix: function (matrix)
|
|
402
407
|
{
|
|
403
408
|
// Apply screen nodes transformation in place here.
|
|
@@ -57,7 +57,6 @@ import ComponentInfoArray from "../Configuration/ComponentInfoArray.js";
|
|
|
57
57
|
import SupportedProfiles from "../Configuration/SupportedProfiles.js";
|
|
58
58
|
import SupportedComponents from "../Configuration/SupportedComponents.js";
|
|
59
59
|
import SupportedNodes from "../Configuration/SupportedNodes.js";
|
|
60
|
-
import Scene from "../Execution/Scene.js";
|
|
61
60
|
import X3DScene from "../Execution/X3DScene.js";
|
|
62
61
|
import FileLoader from "../InputOutput/FileLoader.js";
|
|
63
62
|
import XMLParser from "../Parser/XMLParser.js";
|
|
@@ -216,9 +215,9 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
216
215
|
},
|
|
217
216
|
loadComponents: (function ()
|
|
218
217
|
{
|
|
219
|
-
function loadComponents (browser,
|
|
218
|
+
function loadComponents (browser, componentNames, seen)
|
|
220
219
|
{
|
|
221
|
-
return Promise .all (
|
|
220
|
+
return Promise .all (componentNames .map (name => loadComponent (browser, name, seen)))
|
|
222
221
|
}
|
|
223
222
|
|
|
224
223
|
async function loadComponent (browser, name, seen)
|
|
@@ -244,7 +243,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
244
243
|
return this .loadComponents (argument .components);
|
|
245
244
|
|
|
246
245
|
if (argument instanceof ComponentInfoArray)
|
|
247
|
-
return this .loadComponents (argument .map (({name}) => name));
|
|
246
|
+
return this .loadComponents ([... argument] .map (({name}) => name));
|
|
248
247
|
|
|
249
248
|
if (argument instanceof ComponentInfo)
|
|
250
249
|
return this .loadComponents ([argument .name]);
|
|
@@ -263,7 +262,7 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
263
262
|
},
|
|
264
263
|
createScene: function (profile, component1 /*, ...*/)
|
|
265
264
|
{
|
|
266
|
-
const scene = new
|
|
265
|
+
const scene = new X3DScene (this);
|
|
267
266
|
|
|
268
267
|
if (arguments .length)
|
|
269
268
|
{
|
|
@@ -849,75 +848,69 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
849
848
|
for (const key of Reflect .ownKeys (X3DBrowser .prototype))
|
|
850
849
|
Object .defineProperty (X3DBrowser .prototype, key, { enumerable: false });
|
|
851
850
|
|
|
852
|
-
Object .
|
|
851
|
+
Object .defineProperties (X3DBrowser .prototype,
|
|
853
852
|
{
|
|
854
|
-
|
|
855
|
-
enumerable: true,
|
|
856
|
-
});
|
|
857
|
-
|
|
858
|
-
Object .defineProperty (X3DBrowser .prototype, "version",
|
|
859
|
-
{
|
|
860
|
-
get: X3DBrowser .prototype .getVersion,
|
|
861
|
-
enumerable: true,
|
|
862
|
-
});
|
|
863
|
-
|
|
864
|
-
Object .defineProperty (X3DBrowser .prototype, "providerUrl",
|
|
865
|
-
{
|
|
866
|
-
get: X3DBrowser .prototype .getProviderUrl,
|
|
867
|
-
enumerable: true,
|
|
868
|
-
});
|
|
869
|
-
|
|
870
|
-
Object .defineProperty (X3DBrowser .prototype, "currentFrameRate",
|
|
871
|
-
{
|
|
872
|
-
get: X3DBrowser .prototype .getCurrentFrameRate,
|
|
873
|
-
enumerable: true,
|
|
874
|
-
});
|
|
875
|
-
|
|
876
|
-
Object .defineProperty (X3DBrowser .prototype, "currentSpeed",
|
|
877
|
-
{
|
|
878
|
-
get: X3DBrowser .prototype .getCurrentSpeed,
|
|
879
|
-
enumerable: true,
|
|
880
|
-
});
|
|
881
|
-
|
|
882
|
-
Object .defineProperty (X3DBrowser .prototype, "description",
|
|
883
|
-
{
|
|
884
|
-
get: X3DBrowser .prototype .getDescription,
|
|
885
|
-
set: X3DBrowser .prototype .setDescription,
|
|
886
|
-
enumerable: true,
|
|
887
|
-
});
|
|
888
|
-
|
|
889
|
-
Object .defineProperty (X3DBrowser .prototype, "baseURL",
|
|
890
|
-
{
|
|
891
|
-
get: X3DBrowser .prototype .getBaseURL,
|
|
892
|
-
set: X3DBrowser .prototype .setBaseURL,
|
|
893
|
-
enumerable: true,
|
|
894
|
-
});
|
|
895
|
-
|
|
896
|
-
Object .defineProperty (X3DBrowser .prototype, "currentScene",
|
|
897
|
-
{
|
|
898
|
-
get: function ()
|
|
853
|
+
name:
|
|
899
854
|
{
|
|
900
|
-
|
|
855
|
+
get: X3DBrowser .prototype .getName,
|
|
856
|
+
enumerable: true,
|
|
901
857
|
},
|
|
902
|
-
|
|
903
|
-
});
|
|
904
|
-
|
|
905
|
-
Object .defineProperty (X3DBrowser .prototype, "supportedProfiles",
|
|
906
|
-
{
|
|
907
|
-
get: function ()
|
|
858
|
+
version:
|
|
908
859
|
{
|
|
909
|
-
|
|
860
|
+
get: X3DBrowser .prototype .getVersion,
|
|
861
|
+
enumerable: true,
|
|
910
862
|
},
|
|
911
|
-
|
|
912
|
-
});
|
|
913
|
-
|
|
914
|
-
Object .defineProperty (X3DBrowser .prototype, "supportedComponents",
|
|
915
|
-
{
|
|
916
|
-
get: function ()
|
|
863
|
+
providerUrl:
|
|
917
864
|
{
|
|
918
|
-
|
|
865
|
+
get: X3DBrowser .prototype .getProviderUrl,
|
|
866
|
+
enumerable: true,
|
|
867
|
+
},
|
|
868
|
+
currentFrameRate:
|
|
869
|
+
{
|
|
870
|
+
get: X3DBrowser .prototype .getCurrentFrameRate,
|
|
871
|
+
enumerable: true,
|
|
872
|
+
},
|
|
873
|
+
currentSpeed:
|
|
874
|
+
{
|
|
875
|
+
get: X3DBrowser .prototype .getCurrentSpeed,
|
|
876
|
+
enumerable: true,
|
|
877
|
+
},
|
|
878
|
+
description:
|
|
879
|
+
{
|
|
880
|
+
get: X3DBrowser .prototype .getDescription,
|
|
881
|
+
set: X3DBrowser .prototype .setDescription,
|
|
882
|
+
enumerable: true,
|
|
883
|
+
},
|
|
884
|
+
baseURL:
|
|
885
|
+
{
|
|
886
|
+
get: X3DBrowser .prototype .getBaseURL,
|
|
887
|
+
set: X3DBrowser .prototype .setBaseURL,
|
|
888
|
+
enumerable: true,
|
|
889
|
+
},
|
|
890
|
+
currentScene:
|
|
891
|
+
{
|
|
892
|
+
get: function ()
|
|
893
|
+
{
|
|
894
|
+
return this .getScriptStack () .at (-1) .getExecutionContext ();
|
|
895
|
+
},
|
|
896
|
+
enumerable: true,
|
|
897
|
+
},
|
|
898
|
+
supportedProfiles:
|
|
899
|
+
{
|
|
900
|
+
get: function ()
|
|
901
|
+
{
|
|
902
|
+
return SupportedProfiles;
|
|
903
|
+
},
|
|
904
|
+
enumerable: true,
|
|
905
|
+
},
|
|
906
|
+
supportedComponents:
|
|
907
|
+
{
|
|
908
|
+
get: function ()
|
|
909
|
+
{
|
|
910
|
+
return SupportedComponents;
|
|
911
|
+
},
|
|
912
|
+
enumerable: true,
|
|
919
913
|
},
|
|
920
|
-
enumerable: true,
|
|
921
914
|
});
|
|
922
915
|
|
|
923
916
|
export default X3DBrowser;
|
|
@@ -122,14 +122,14 @@ function X3DBrowserContext (element)
|
|
|
122
122
|
"displayEvents", new SFTime (),
|
|
123
123
|
"finishedEvents", new SFTime ());
|
|
124
124
|
|
|
125
|
-
this [_changedTime]
|
|
126
|
-
this [_previousTime]
|
|
127
|
-
this [_renderCallback]
|
|
128
|
-
this [_systemTime]
|
|
129
|
-
this [_browserTime]
|
|
130
|
-
this [_cameraTime]
|
|
131
|
-
this [_collisionTime]
|
|
132
|
-
this [_displayTime]
|
|
125
|
+
this [_changedTime] = 0;
|
|
126
|
+
this [_previousTime] = 0;
|
|
127
|
+
this [_renderCallback] = this [_traverse] .bind (this);
|
|
128
|
+
this [_systemTime] = new StopWatch ();
|
|
129
|
+
this [_browserTime] = new StopWatch ();
|
|
130
|
+
this [_cameraTime] = new StopWatch ();
|
|
131
|
+
this [_collisionTime] = new StopWatch ();
|
|
132
|
+
this [_displayTime] = new StopWatch ();
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
X3DBrowserContext .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
|