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
|
@@ -137,11 +137,11 @@ SFRotation .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
137
137
|
},
|
|
138
138
|
inverse: function ()
|
|
139
139
|
{
|
|
140
|
-
return new SFRotation (
|
|
140
|
+
return new SFRotation (this .getValue () .copy () .inverse ());
|
|
141
141
|
},
|
|
142
142
|
multiply: function (rotation)
|
|
143
143
|
{
|
|
144
|
-
return new SFRotation (
|
|
144
|
+
return new SFRotation (this .getValue () .copy () .multRight (rotation .getValue ()));
|
|
145
145
|
},
|
|
146
146
|
multVec: function (vector)
|
|
147
147
|
{
|
|
@@ -149,7 +149,7 @@ SFRotation .prototype = Object .assign (Object .create (X3DField .prototype),
|
|
|
149
149
|
},
|
|
150
150
|
slerp: function (rotation, t)
|
|
151
151
|
{
|
|
152
|
-
return new SFRotation (
|
|
152
|
+
return new SFRotation (this .getValue () .copy () .slerp (rotation .getValue (), t));
|
|
153
153
|
},
|
|
154
154
|
toStream: function (generator)
|
|
155
155
|
{
|
|
@@ -211,7 +211,6 @@ const x = {
|
|
|
211
211
|
this .getValue () .x = +value;
|
|
212
212
|
this .addEvent ();
|
|
213
213
|
},
|
|
214
|
-
enumerable: true,
|
|
215
214
|
};
|
|
216
215
|
|
|
217
216
|
const y = {
|
|
@@ -224,7 +223,6 @@ const y = {
|
|
|
224
223
|
this .getValue () .y = +value;
|
|
225
224
|
this .addEvent ();
|
|
226
225
|
},
|
|
227
|
-
enumerable: true,
|
|
228
226
|
};
|
|
229
227
|
|
|
230
228
|
const z = {
|
|
@@ -237,7 +235,6 @@ const z = {
|
|
|
237
235
|
this .getValue () .z = +value;
|
|
238
236
|
this .addEvent ();
|
|
239
237
|
},
|
|
240
|
-
enumerable: true,
|
|
241
238
|
};
|
|
242
239
|
|
|
243
240
|
const angle = {
|
|
@@ -250,22 +247,18 @@ const angle = {
|
|
|
250
247
|
this .getValue () .angle = +value;
|
|
251
248
|
this .addEvent ();
|
|
252
249
|
},
|
|
253
|
-
enumerable: true,
|
|
254
250
|
};
|
|
255
251
|
|
|
256
|
-
Object .
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
Object .defineProperty (SFRotation .prototype, "1", y);
|
|
268
|
-
Object .defineProperty (SFRotation .prototype, "2", z);
|
|
269
|
-
Object .defineProperty (SFRotation .prototype, "3", angle);
|
|
252
|
+
Object .defineProperties (SFRotation .prototype,
|
|
253
|
+
{
|
|
254
|
+
0: x,
|
|
255
|
+
1: y,
|
|
256
|
+
2: z,
|
|
257
|
+
3: angle,
|
|
258
|
+
x: Object .assign ({ enumerable: true }, x),
|
|
259
|
+
y: Object .assign ({ enumerable: true }, y),
|
|
260
|
+
z: Object .assign ({ enumerable: true }, z),
|
|
261
|
+
angle: Object .assign ({ enumerable: true }, angle),
|
|
262
|
+
});
|
|
270
263
|
|
|
271
264
|
export default SFRotation;
|
|
@@ -69,11 +69,7 @@ function SFVec2Template (TypeName, Type, double)
|
|
|
69
69
|
throw new Error ("Invalid arguments.");
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
SFVec2 .prototype =
|
|
73
|
-
SFVecPrototypeTemplate (TypeName, Type, Vector2, double),
|
|
74
|
-
{
|
|
75
|
-
constructor: SFVec2,
|
|
76
|
-
});
|
|
72
|
+
SFVec2 .prototype = SFVecPrototypeTemplate (SFVec2, TypeName, Type, Vector2, double);
|
|
77
73
|
|
|
78
74
|
for (const key of Reflect .ownKeys (SFVec2 .prototype))
|
|
79
75
|
Object .defineProperty (SFVec2 .prototype, key, { enumerable: false });
|
|
@@ -88,7 +84,6 @@ function SFVec2Template (TypeName, Type, double)
|
|
|
88
84
|
this .getValue () .x = +value;
|
|
89
85
|
this .addEvent ();
|
|
90
86
|
},
|
|
91
|
-
enumerable: true,
|
|
92
87
|
};
|
|
93
88
|
|
|
94
89
|
const y = {
|
|
@@ -101,17 +96,15 @@ function SFVec2Template (TypeName, Type, double)
|
|
|
101
96
|
this .getValue () .y = +value;
|
|
102
97
|
this .addEvent ();
|
|
103
98
|
},
|
|
104
|
-
enumerable: true,
|
|
105
99
|
};
|
|
106
100
|
|
|
107
|
-
Object .
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Object .defineProperty (SFVec2 .prototype, "1", y);
|
|
101
|
+
Object .defineProperties (SFVec2 .prototype,
|
|
102
|
+
{
|
|
103
|
+
0: x,
|
|
104
|
+
1: y,
|
|
105
|
+
x: Object .assign ({ enumerable: true }, x),
|
|
106
|
+
y: Object .assign ({ enumerable: true }, y),
|
|
107
|
+
});
|
|
115
108
|
|
|
116
109
|
return SFVec2;
|
|
117
110
|
}
|
|
@@ -69,10 +69,8 @@ function SFVec3Template (TypeName, Type, double)
|
|
|
69
69
|
throw new Error ("Invalid arguments.");
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
SFVec3 .prototype = Object .assign (
|
|
73
|
-
SFVecPrototypeTemplate (TypeName, Type, Vector3, double),
|
|
72
|
+
SFVec3 .prototype = Object .assign (SFVecPrototypeTemplate (SFVec3, TypeName, Type, Vector3, double),
|
|
74
73
|
{
|
|
75
|
-
constructor: SFVec3,
|
|
76
74
|
cross: function (vector)
|
|
77
75
|
{
|
|
78
76
|
return new (this .constructor) (Vector3 .cross (this .getValue (), vector .getValue ()));
|
|
@@ -92,7 +90,6 @@ function SFVec3Template (TypeName, Type, double)
|
|
|
92
90
|
this .getValue () .x = +value;
|
|
93
91
|
this .addEvent ();
|
|
94
92
|
},
|
|
95
|
-
enumerable: true,
|
|
96
93
|
};
|
|
97
94
|
|
|
98
95
|
const y = {
|
|
@@ -105,7 +102,6 @@ function SFVec3Template (TypeName, Type, double)
|
|
|
105
102
|
this .getValue () .y = +value;
|
|
106
103
|
this .addEvent ();
|
|
107
104
|
},
|
|
108
|
-
enumerable: true,
|
|
109
105
|
};
|
|
110
106
|
|
|
111
107
|
const z = {
|
|
@@ -118,20 +114,17 @@ function SFVec3Template (TypeName, Type, double)
|
|
|
118
114
|
this .getValue () .z = +value;
|
|
119
115
|
this .addEvent ();
|
|
120
116
|
},
|
|
121
|
-
enumerable: true,
|
|
122
117
|
};
|
|
123
118
|
|
|
124
|
-
Object .
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
Object .defineProperty (SFVec3 .prototype, "1", y);
|
|
134
|
-
Object .defineProperty (SFVec3 .prototype, "2", z);
|
|
119
|
+
Object .defineProperties (SFVec3 .prototype,
|
|
120
|
+
{
|
|
121
|
+
0: x,
|
|
122
|
+
1: y,
|
|
123
|
+
2: z,
|
|
124
|
+
x: Object .assign ({ enumerable: true }, x),
|
|
125
|
+
y: Object .assign ({ enumerable: true }, y),
|
|
126
|
+
z: Object .assign ({ enumerable: true }, z),
|
|
127
|
+
});
|
|
135
128
|
|
|
136
129
|
return SFVec3;
|
|
137
130
|
}
|
|
@@ -69,11 +69,7 @@ function SFVec4Template (TypeName, Type, double)
|
|
|
69
69
|
throw new Error ("Invalid arguments.");
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
SFVec4 .prototype =
|
|
73
|
-
SFVecPrototypeTemplate (TypeName, Type, Vector4, double),
|
|
74
|
-
{
|
|
75
|
-
constructor: SFVec4,
|
|
76
|
-
});
|
|
72
|
+
SFVec4 .prototype = SFVecPrototypeTemplate (SFVec4, TypeName, Type, Vector4, double);
|
|
77
73
|
|
|
78
74
|
for (const key of Reflect .ownKeys (SFVec4 .prototype))
|
|
79
75
|
Object .defineProperty (SFVec4 .prototype, key, { enumerable: false });
|
|
@@ -88,7 +84,6 @@ function SFVec4Template (TypeName, Type, double)
|
|
|
88
84
|
this .getValue () .x = +value;
|
|
89
85
|
this .addEvent ();
|
|
90
86
|
},
|
|
91
|
-
enumerable: true,
|
|
92
87
|
};
|
|
93
88
|
|
|
94
89
|
const y = {
|
|
@@ -101,7 +96,6 @@ function SFVec4Template (TypeName, Type, double)
|
|
|
101
96
|
this .getValue () .y = +value;
|
|
102
97
|
this .addEvent ();
|
|
103
98
|
},
|
|
104
|
-
enumerable: true,
|
|
105
99
|
};
|
|
106
100
|
|
|
107
101
|
const z = {
|
|
@@ -114,7 +108,6 @@ function SFVec4Template (TypeName, Type, double)
|
|
|
114
108
|
this .getValue () .z = +value;
|
|
115
109
|
this .addEvent ();
|
|
116
110
|
},
|
|
117
|
-
enumerable: true,
|
|
118
111
|
};
|
|
119
112
|
|
|
120
113
|
const w = {
|
|
@@ -127,23 +120,19 @@ function SFVec4Template (TypeName, Type, double)
|
|
|
127
120
|
this .getValue () .w = +value;
|
|
128
121
|
this .addEvent ();
|
|
129
122
|
},
|
|
130
|
-
enumerable: true,
|
|
131
123
|
};
|
|
132
124
|
|
|
133
|
-
Object .
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
Object .defineProperty (SFVec4 .prototype, "1", y);
|
|
145
|
-
Object .defineProperty (SFVec4 .prototype, "2", z);
|
|
146
|
-
Object .defineProperty (SFVec4 .prototype, "3", w);
|
|
125
|
+
Object .defineProperties (SFVec4 .prototype,
|
|
126
|
+
{
|
|
127
|
+
0: x,
|
|
128
|
+
1: y,
|
|
129
|
+
2: z,
|
|
130
|
+
3: w,
|
|
131
|
+
x: Object .assign ({ enumerable: true }, x),
|
|
132
|
+
y: Object .assign ({ enumerable: true }, y),
|
|
133
|
+
z: Object .assign ({ enumerable: true }, z),
|
|
134
|
+
w: Object .assign ({ enumerable: true }, w),
|
|
135
|
+
});
|
|
147
136
|
|
|
148
137
|
return SFVec4;
|
|
149
138
|
}
|
|
@@ -47,12 +47,13 @@
|
|
|
47
47
|
|
|
48
48
|
import X3DField from "../Base/X3DField.js";
|
|
49
49
|
|
|
50
|
-
function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
|
|
50
|
+
function SFVecPrototypeTemplate (Constructor, TypeName, Type, ValueType, double)
|
|
51
51
|
{
|
|
52
52
|
const _formatter = double ? "DoubleFormat" : "FloatFormat";
|
|
53
53
|
|
|
54
54
|
return Object .assign (Object .create (X3DField .prototype),
|
|
55
55
|
{
|
|
56
|
+
constructor: Constructor,
|
|
56
57
|
[Symbol .iterator]: function* ()
|
|
57
58
|
{
|
|
58
59
|
yield* this .getValue ();
|
|
@@ -83,11 +84,11 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
|
|
|
83
84
|
},
|
|
84
85
|
abs: function ()
|
|
85
86
|
{
|
|
86
|
-
return new (this .constructor) (
|
|
87
|
+
return new (this .constructor) (this .getValue () .copy () .abs ());
|
|
87
88
|
},
|
|
88
89
|
add: function (vector)
|
|
89
90
|
{
|
|
90
|
-
return new (this .constructor) (
|
|
91
|
+
return new (this .constructor) (this .getValue () .copy () .add (vector .getValue ()));
|
|
91
92
|
},
|
|
92
93
|
distance: function (vector)
|
|
93
94
|
{
|
|
@@ -95,11 +96,11 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
|
|
|
95
96
|
},
|
|
96
97
|
divide: function (value)
|
|
97
98
|
{
|
|
98
|
-
return new (this .constructor) (
|
|
99
|
+
return new (this .constructor) (this .getValue () .copy () .divide (value));
|
|
99
100
|
},
|
|
100
101
|
divVec: function (vector)
|
|
101
102
|
{
|
|
102
|
-
return new (this .constructor) (
|
|
103
|
+
return new (this .constructor) (this .getValue () .copy () .divVec (vector .getValue ()));
|
|
103
104
|
},
|
|
104
105
|
dot: function (vector)
|
|
105
106
|
{
|
|
@@ -107,7 +108,7 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
|
|
|
107
108
|
},
|
|
108
109
|
inverse: function ()
|
|
109
110
|
{
|
|
110
|
-
return new (this .constructor) (
|
|
111
|
+
return new (this .constructor) (this .getValue () .copy () .inverse ());
|
|
111
112
|
},
|
|
112
113
|
length: function ()
|
|
113
114
|
{
|
|
@@ -115,35 +116,35 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
|
|
|
115
116
|
},
|
|
116
117
|
lerp: function (destination, t)
|
|
117
118
|
{
|
|
118
|
-
return new (this .constructor) (
|
|
119
|
+
return new (this .constructor) (this .getValue () .copy () .lerp (destination, t));
|
|
119
120
|
},
|
|
120
121
|
max: function (vector)
|
|
121
122
|
{
|
|
122
|
-
return new (this .constructor) (
|
|
123
|
+
return new (this .constructor) (this .getValue () .copy () .max (vector .getValue ()));
|
|
123
124
|
},
|
|
124
125
|
min: function (vector)
|
|
125
126
|
{
|
|
126
|
-
return new (this .constructor) (
|
|
127
|
+
return new (this .constructor) (this .getValue () .copy () .min (vector .getValue ()));
|
|
127
128
|
},
|
|
128
129
|
multiply: function (value)
|
|
129
130
|
{
|
|
130
|
-
return new (this .constructor) (
|
|
131
|
+
return new (this .constructor) (this .getValue () .copy () .multiply (value));
|
|
131
132
|
},
|
|
132
133
|
multVec: function (vector)
|
|
133
134
|
{
|
|
134
|
-
return new (this .constructor) (
|
|
135
|
+
return new (this .constructor) (this .getValue () .copy () .multVec (vector .getValue ()));
|
|
135
136
|
},
|
|
136
137
|
negate: function ()
|
|
137
138
|
{
|
|
138
|
-
return new (this .constructor) (
|
|
139
|
+
return new (this .constructor) (this .getValue () .copy () .negate ());
|
|
139
140
|
},
|
|
140
141
|
normalize: function (vector)
|
|
141
142
|
{
|
|
142
|
-
return new (this .constructor) (
|
|
143
|
+
return new (this .constructor) (this .getValue () .copy () .normalize ());
|
|
143
144
|
},
|
|
144
145
|
subtract: function (vector)
|
|
145
146
|
{
|
|
146
|
-
return new (this .constructor) (
|
|
147
|
+
return new (this .constructor) (this .getValue () .copy () .subtract (vector .getValue ()));
|
|
147
148
|
},
|
|
148
149
|
toStream: function (generator)
|
|
149
150
|
{
|
|
@@ -64,13 +64,13 @@ const foreign = {
|
|
|
64
64
|
|
|
65
65
|
const defaultParameter = new Fields .MFString ();
|
|
66
66
|
|
|
67
|
-
function FileLoader (node
|
|
67
|
+
function FileLoader (node)
|
|
68
68
|
{
|
|
69
69
|
X3DObject .call (this);
|
|
70
70
|
|
|
71
71
|
this .node = node;
|
|
72
72
|
this .browser = node .getBrowser ();
|
|
73
|
-
this .external =
|
|
73
|
+
this .external = this .browser .isExternal ();
|
|
74
74
|
this .executionContext = this .external ? node .getExecutionContext () : this .browser .currentScene;
|
|
75
75
|
this .target = "";
|
|
76
76
|
this .url = [ ];
|
|
@@ -1177,7 +1177,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1177
1177
|
m .scale (new Vector2 (1, -1));
|
|
1178
1178
|
|
|
1179
1179
|
if (g .units === "userSpaceOnUse")
|
|
1180
|
-
m .multLeft (
|
|
1180
|
+
m .multLeft (bbox .matrix .copy () .inverse ());
|
|
1181
1181
|
else
|
|
1182
1182
|
m .multLeft (new Matrix3 (2, 0, 0, 0, 2, 0, -1, -1, 1));
|
|
1183
1183
|
|
|
@@ -2690,7 +2690,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
2690
2690
|
const
|
|
2691
2691
|
scene = this .getExecutionContext (),
|
|
2692
2692
|
texCoordNode = scene .createNode ("TextureCoordinate"),
|
|
2693
|
-
invMatrix =
|
|
2693
|
+
invMatrix = bbox .matrix .copy () .inverse ();
|
|
2694
2694
|
|
|
2695
2695
|
for (const point of coordinateNode .point)
|
|
2696
2696
|
texCoordNode .point .push (invMatrix .multVecMatrix (new Vector2 (point .x, point .y)) .add (Vector2 .One) .divide (2));
|
|
@@ -66,7 +66,7 @@ X3DOptimizer .prototype = {
|
|
|
66
66
|
},
|
|
67
67
|
optimizeNodes: function (nodes, combine, removedNodes)
|
|
68
68
|
{
|
|
69
|
-
return nodes .flatMap (node => this .optimizeNode (node, combine, removedNodes));
|
|
69
|
+
return [... nodes] .flatMap (node => this .optimizeNode (node, combine, removedNodes));
|
|
70
70
|
},
|
|
71
71
|
optimizeNode: function (node, combine, removedNodes)
|
|
72
72
|
{
|
|
@@ -331,10 +331,10 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
331
331
|
componentSupportLevel = parseInt (xmlElement .getAttribute ("level"));
|
|
332
332
|
|
|
333
333
|
if (componentNameIdCharacters === null)
|
|
334
|
-
return console .warn ("XML Parser Error: Bad component statement
|
|
334
|
+
return console .warn ("XML Parser Error: Bad component statement. Expected name attribute.");
|
|
335
335
|
|
|
336
336
|
if (componentSupportLevel === null)
|
|
337
|
-
return console .warn ("XML Parser Error: Bad component statement
|
|
337
|
+
return console .warn ("XML Parser Error: Bad component statement. Expected level attribute.");
|
|
338
338
|
|
|
339
339
|
var component = this .getBrowser () .getComponent (componentNameIdCharacters, componentSupportLevel);
|
|
340
340
|
|
|
@@ -353,13 +353,13 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
353
353
|
conversionFactor = xmlElement .getAttribute ("conversionFactor"); //works for html5 as well
|
|
354
354
|
|
|
355
355
|
if (category === null)
|
|
356
|
-
return console .warn ("XML Parser Error: Bad unit statement
|
|
356
|
+
return console .warn ("XML Parser Error: Bad unit statement. Expected category attribute.");
|
|
357
357
|
|
|
358
358
|
if (name === null)
|
|
359
|
-
return console .warn ("XML Parser Error: Bad unit statement
|
|
359
|
+
return console .warn ("XML Parser Error: Bad unit statement. Expected name attribute.");
|
|
360
360
|
|
|
361
361
|
if (conversionFactor === null)
|
|
362
|
-
return console .warn ("XML Parser Error: Bad unit statement
|
|
362
|
+
return console .warn ("XML Parser Error: Bad unit statement. Expected conversionFactor attribute.");
|
|
363
363
|
|
|
364
364
|
this .getScene () .updateUnit (category, name, parseFloat (conversionFactor));
|
|
365
365
|
},
|
|
@@ -370,10 +370,10 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
370
370
|
metavalue = xmlElement .getAttribute ("content");
|
|
371
371
|
|
|
372
372
|
if (metakey === null)
|
|
373
|
-
return console .warn ("XML Parser Error: Bad meta statement
|
|
373
|
+
return console .warn ("XML Parser Error: Bad meta statement. Expected name attribute.");
|
|
374
374
|
|
|
375
375
|
if (metavalue === null)
|
|
376
|
-
return console .warn ("XML Parser Error: Bad meta statement
|
|
376
|
+
return console .warn ("XML Parser Error: Bad meta statement. Expected content attribute.");
|
|
377
377
|
|
|
378
378
|
this .getScene () .addMetaData (metakey, metavalue);
|
|
379
379
|
},
|
|
@@ -450,19 +450,19 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
450
450
|
},
|
|
451
451
|
externProtoDeclareElement: function (xmlElement)
|
|
452
452
|
{
|
|
453
|
-
|
|
453
|
+
const name = xmlElement .getAttribute ("name");
|
|
454
454
|
|
|
455
455
|
if (this .id (name))
|
|
456
456
|
{
|
|
457
|
-
|
|
457
|
+
const url = xmlElement .getAttribute ("url");
|
|
458
458
|
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
this .parser .setInput (url ?? "");
|
|
460
|
+
this .parser .sfstringValues (this .url);
|
|
461
461
|
|
|
462
|
-
this .
|
|
463
|
-
|
|
462
|
+
if (!this .url .length)
|
|
463
|
+
console .warn ("XML Parser Error: Bad ExternProtoDeclare statement. Expected url attribute with value.");
|
|
464
464
|
|
|
465
|
-
|
|
465
|
+
const externproto = new X3DExternProtoDeclaration (this .getExecutionContext (), this .url);
|
|
466
466
|
|
|
467
467
|
this .pushParent (externproto);
|
|
468
468
|
this .protoInterfaceElement (xmlElement);
|
|
@@ -654,10 +654,10 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
654
654
|
protoFieldName = xmlElement .getAttribute ("protoField");
|
|
655
655
|
|
|
656
656
|
if (nodeFieldName === null)
|
|
657
|
-
return console .warn ("XML Parser Error: Bad connect statement
|
|
657
|
+
return console .warn ("XML Parser Error: Bad connect statement. Expected nodeField attribute.");
|
|
658
658
|
|
|
659
659
|
if (protoFieldName === null)
|
|
660
|
-
return console .warn ("XML Parser Error: Bad connect statement
|
|
660
|
+
return console .warn ("XML Parser Error: Bad connect statement. Expected protoField attribute.");
|
|
661
661
|
|
|
662
662
|
try
|
|
663
663
|
{
|
|
@@ -687,7 +687,7 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
687
687
|
}
|
|
688
688
|
catch (error)
|
|
689
689
|
{
|
|
690
|
-
console .warn ("XML Parser Error: Couldn't create IS reference
|
|
690
|
+
console .warn ("XML Parser Error: Couldn't create IS reference. " + error .message);
|
|
691
691
|
}
|
|
692
692
|
},
|
|
693
693
|
protoInstanceElement: function (xmlElement)
|
|
@@ -765,7 +765,7 @@ XMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
765
765
|
}
|
|
766
766
|
catch (error)
|
|
767
767
|
{
|
|
768
|
-
console .warn ("XML Parser Error: Couldn't assign field value
|
|
768
|
+
console .warn ("XML Parser Error: Couldn't assign field value. " + error .message);
|
|
769
769
|
}
|
|
770
770
|
},
|
|
771
771
|
nodeElement: function (xmlElement)
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import X3DInfoArray
|
|
48
|
+
import X3DInfoArray from "../Base/X3DInfoArray.js";
|
|
49
|
+
import X3DExternProtoDeclaration from "./X3DExternProtoDeclaration.js"
|
|
49
50
|
|
|
50
51
|
function ExternProtoDeclarationArray (values)
|
|
51
52
|
{
|
|
52
|
-
return X3DInfoArray .call (this, values);
|
|
53
|
+
return X3DInfoArray .call (this, values, X3DExternProtoDeclaration);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
ExternProtoDeclarationArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
|
|
@@ -45,11 +45,12 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import X3DInfoArray
|
|
48
|
+
import X3DInfoArray from "../Base/X3DInfoArray.js";
|
|
49
|
+
import X3DProtoDeclaration from "./X3DProtoDeclaration.js"
|
|
49
50
|
|
|
50
|
-
function ProtoDeclarationArray (
|
|
51
|
+
function ProtoDeclarationArray (values)
|
|
51
52
|
{
|
|
52
|
-
return X3DInfoArray .call (this,
|
|
53
|
+
return X3DInfoArray .call (this, values, X3DProtoDeclaration);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
ProtoDeclarationArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
|
|
@@ -408,34 +408,33 @@ X3DExternProtoDeclaration .prototype = Object .assign (Object .create (X3DProtoD
|
|
|
408
408
|
for (const key of Reflect .ownKeys (X3DExternProtoDeclaration .prototype))
|
|
409
409
|
Object .defineProperty (X3DExternProtoDeclaration .prototype, key, { enumerable: false });
|
|
410
410
|
|
|
411
|
-
Object .
|
|
411
|
+
Object .defineProperties (X3DExternProtoDeclaration .prototype,
|
|
412
412
|
{
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
{
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
{
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
enumerable: true,
|
|
413
|
+
name:
|
|
414
|
+
{
|
|
415
|
+
get: X3DExternProtoDeclaration .prototype .getName,
|
|
416
|
+
enumerable: true,
|
|
417
|
+
},
|
|
418
|
+
fields:
|
|
419
|
+
{
|
|
420
|
+
get: X3DExternProtoDeclaration .prototype .getFieldDefinitions,
|
|
421
|
+
enumerable: true,
|
|
422
|
+
},
|
|
423
|
+
isExternProto:
|
|
424
|
+
{
|
|
425
|
+
value: true,
|
|
426
|
+
enumerable: true,
|
|
427
|
+
},
|
|
428
|
+
urls:
|
|
429
|
+
{
|
|
430
|
+
get: function () { return this ._url; },
|
|
431
|
+
enumerable: true,
|
|
432
|
+
},
|
|
433
|
+
loadState:
|
|
434
|
+
{
|
|
435
|
+
get: X3DExternProtoDeclaration .prototype .checkLoadState,
|
|
436
|
+
enumerable: true,
|
|
437
|
+
},
|
|
439
438
|
});
|
|
440
439
|
|
|
441
440
|
export default X3DExternProtoDeclaration;
|
|
@@ -542,22 +542,23 @@ X3DProtoDeclaration .prototype = Object .assign (Object .create (X3DProtoDeclara
|
|
|
542
542
|
for (const key of Reflect .ownKeys (X3DProtoDeclaration .prototype))
|
|
543
543
|
Object .defineProperty (X3DProtoDeclaration .prototype, key, { enumerable: false });
|
|
544
544
|
|
|
545
|
-
Object .
|
|
545
|
+
Object .defineProperties (X3DProtoDeclaration .prototype,
|
|
546
546
|
{
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
{
|
|
559
|
-
|
|
560
|
-
|
|
547
|
+
name:
|
|
548
|
+
{
|
|
549
|
+
get: X3DProtoDeclaration .prototype .getName,
|
|
550
|
+
enumerable: true,
|
|
551
|
+
},
|
|
552
|
+
fields:
|
|
553
|
+
{
|
|
554
|
+
get: X3DProtoDeclaration .prototype .getFieldDefinitions,
|
|
555
|
+
enumerable: true,
|
|
556
|
+
},
|
|
557
|
+
isExternProto:
|
|
558
|
+
{
|
|
559
|
+
value: false,
|
|
560
|
+
enumerable: true,
|
|
561
|
+
},
|
|
561
562
|
});
|
|
562
563
|
|
|
563
564
|
export default X3DProtoDeclaration;
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
48
|
import X3DInfoArray from "../Base/X3DInfoArray.js";
|
|
49
|
+
import X3DRoute from "./X3DRoute.js";
|
|
49
50
|
|
|
50
|
-
function RouteArray ()
|
|
51
|
+
function RouteArray (values)
|
|
51
52
|
{
|
|
52
|
-
return X3DInfoArray .call (this);
|
|
53
|
+
return X3DInfoArray .call (this, values, X3DRoute);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
RouteArray .prototype = Object .assign (Object .create (X3DInfoArray .prototype),
|