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
package/dist/x_ite.zip
CHANGED
|
Binary file
|
package/docs/_config.yml
CHANGED
|
@@ -263,11 +263,21 @@ None
|
|
|
263
263
|
|
|
264
264
|
#### void **setTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
|
|
265
265
|
|
|
266
|
-
Sets the SFMatrix3d/f to the passed values. *translation* is an SFVec2d/f object, *rotation* is a Number, *scaleFactor* is a SFVec2d/f object, *scaleOrientation* is a Number and *center* is a SFVec2d/f object.
|
|
266
|
+
Sets the SFMatrix3d/f to the passed values. *translation* is an SFVec2d/f object, *rotation* is a Number, *scaleFactor* is a SFVec2d/f object, *scaleOrientation* is a Number and *center* is a SFVec2d/f object.
|
|
267
267
|
|
|
268
|
-
|
|
268
|
+
Any of the rightmost parameters can be omitted, or any parameter can be `null`. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
#### void **getTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
|
|
271
|
+
|
|
272
|
+
Decomposes the SFMatrix3d/f and returns the components in the passed *translation*, *rotation*, and *scaleFactor* objects*. rotation* is a SFVec3d/f, where x and y are the complex value of the rotation and z is the rotation angle in radians. The other types of the parameters are the same as in **setTransform**.
|
|
273
|
+
|
|
274
|
+
Any of the rightmost parameters can be omitted, or any parameter can be `null`. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
|
|
275
|
+
|
|
276
|
+
A center of any value can be specified around which the rotation and scaling will take place.
|
|
277
|
+
|
|
278
|
+
#### Number **determinant** ()
|
|
279
|
+
|
|
280
|
+
Returns the determinant of this object's matrix.
|
|
271
281
|
|
|
272
282
|
#### SFMatrix3d/f **inverse** ()
|
|
273
283
|
|
|
@@ -327,11 +337,21 @@ None
|
|
|
327
337
|
|
|
328
338
|
#### void **setTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
|
|
329
339
|
|
|
330
|
-
Sets the SFMatrix4d/f to the passed values. *translation* is an SFVec3d/f object, *rotation* is a SFRotation object, *scaleFactor* is a SFVec3d/f object, *scaleOrientation* is a SFRotation object and *center* is a SFVec3d/f object.
|
|
340
|
+
Sets the SFMatrix4d/f to the passed values. *translation* is an SFVec3d/f object, *rotation* is a SFRotation object, *scaleFactor* is a SFVec3d/f object, *scaleOrientation* is a SFRotation object and *center* is a SFVec3d/f object.
|
|
341
|
+
|
|
342
|
+
Any of the rightmost parameters can be omitted. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
|
|
343
|
+
|
|
344
|
+
#### void **getTransform** (*translation*, *rotation*, *scaleFactor*, *scaleOrientation*, *center*)
|
|
345
|
+
|
|
346
|
+
Decomposes the SFMatrix4d/f and returns the components in the passed *translation*, *rotation*, and *scaleFactor* objects. The types of the parameters are the same as in **setTransform**.
|
|
347
|
+
|
|
348
|
+
Any of the rightmost parameters can be omitted. In other words, the method can take from 0 to 5 parameters. For example, you can specify 0 parameters (resulting in a identity matrix), 1 parameter (a translation), 2 parameters (a translation and a rotation), 3 parameters (a translation, rotation and a scaleFactor), etc. Any unspecified parameter is set to its default as specified in the **Transform** node section of the X3D specification.
|
|
349
|
+
|
|
350
|
+
A center of any value can be specified around which the rotation and scaling will take place.
|
|
331
351
|
|
|
332
|
-
####
|
|
352
|
+
#### Number **determinant** ()
|
|
333
353
|
|
|
334
|
-
|
|
354
|
+
Returns the determinant of this object's matrix.
|
|
335
355
|
|
|
336
356
|
#### SFMatrix4d/f **inverse** ()
|
|
337
357
|
|
|
@@ -814,7 +834,7 @@ Returns true if the passed MF* *array* of the same type is equals to this object
|
|
|
814
834
|
|
|
815
835
|
#### Other Array functions
|
|
816
836
|
|
|
817
|
-
Common Array functions like `at`, `
|
|
837
|
+
Common Array functions like `at`, `entries`, `every`, `fill`, `filter`, `find`, `findIndex`, `findLast`, `findLastIndex`, `forEach`, `includes`, `indexOf`, `join`, `keys`, `lastIndexOf`, `map`, `pop`, `push`, `reduce`, `reduceRight`, `reverse`, `shift`, `slice`, `some`, `sort`, `splice`, `toReversed`, `toSorted`, `toSpliced`, `unshift`, `values`, `with` are also available.
|
|
818
838
|
|
|
819
839
|
## MFBool Object
|
|
820
840
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x_ite",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.5",
|
|
4
4
|
"description": "X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.",
|
|
5
5
|
"homepage": "https://create3000.github.io/x_ite/",
|
|
6
6
|
"author": "Holger Seelig <holger.seelig@gmail.com>",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"css-element-queries": "^1.2.3",
|
|
60
60
|
"dicom-parser": "^1.8.21",
|
|
61
61
|
"jpeg-js": "^0.4.4",
|
|
62
|
-
"jpeg-lossless-decoder-js": "2.0.
|
|
62
|
+
"jpeg-lossless-decoder-js": "^2.0.7",
|
|
63
63
|
"jquery": "^3.7.0",
|
|
64
64
|
"jquery-fullscreen-plugin": "^1.1.5",
|
|
65
65
|
"jquery-mousewheel": "^3.1.13",
|
|
@@ -55,23 +55,23 @@ function eigen_decomposition (matrix, result)
|
|
|
55
55
|
{
|
|
56
56
|
const
|
|
57
57
|
ORDER = matrix .order,
|
|
58
|
+
SIZE = matrix .length,
|
|
58
59
|
values = result .values,
|
|
59
60
|
vectors = result .vectors;
|
|
60
61
|
|
|
61
62
|
let
|
|
62
|
-
sm,
|
|
63
|
-
theta,
|
|
64
|
-
c, s, t,
|
|
65
|
-
tau,
|
|
66
|
-
h, g,
|
|
67
|
-
thresh,
|
|
68
|
-
p, q, i, j
|
|
69
|
-
SIZE = matrix .length;
|
|
63
|
+
sm, // smallest entry
|
|
64
|
+
theta, // angle for Jacobi rotation
|
|
65
|
+
c, s, t, // cosine, sine, tangent of theta
|
|
66
|
+
tau, // sine / (1 + cos)
|
|
67
|
+
h, g, // two scrap values
|
|
68
|
+
thresh, // threshold below which no rotation done
|
|
69
|
+
p, q, i, j; // indices
|
|
70
70
|
|
|
71
71
|
// initializations
|
|
72
72
|
for (i = 0; i < ORDER; ++ i)
|
|
73
73
|
{
|
|
74
|
-
a [i] = a [i]
|
|
74
|
+
a [i] = a [i] ?? [ ];
|
|
75
75
|
b [i] = values [i] = matrix .get1 (i, i);
|
|
76
76
|
z [i] = 0;
|
|
77
77
|
|
|
@@ -203,33 +203,33 @@ Box2 .prototype =
|
|
|
203
203
|
},
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
Object .
|
|
206
|
+
Object .defineProperties (Box2 .prototype,
|
|
207
207
|
{
|
|
208
|
-
|
|
208
|
+
size:
|
|
209
209
|
{
|
|
210
|
-
|
|
211
|
-
min = new Vector2 (0, 0),
|
|
212
|
-
max = new Vector2 (0, 0);
|
|
213
|
-
|
|
214
|
-
return function ()
|
|
210
|
+
get: (function ()
|
|
215
211
|
{
|
|
216
|
-
|
|
212
|
+
const
|
|
213
|
+
min = new Vector2 (0, 0),
|
|
214
|
+
max = new Vector2 (0, 0);
|
|
217
215
|
|
|
218
|
-
return
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
enumerable: true,
|
|
222
|
-
configurable: false
|
|
223
|
-
});
|
|
216
|
+
return function ()
|
|
217
|
+
{
|
|
218
|
+
this .getAbsoluteExtents (min, max);
|
|
224
219
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
220
|
+
return max .subtract (min);
|
|
221
|
+
};
|
|
222
|
+
})(),
|
|
223
|
+
enumerable: true,
|
|
224
|
+
},
|
|
225
|
+
center:
|
|
228
226
|
{
|
|
229
|
-
|
|
227
|
+
get: function ()
|
|
228
|
+
{
|
|
229
|
+
return this .matrix .origin;
|
|
230
|
+
},
|
|
231
|
+
enumerable: true,
|
|
230
232
|
},
|
|
231
|
-
enumerable: true,
|
|
232
|
-
configurable: false
|
|
233
233
|
});
|
|
234
234
|
|
|
235
235
|
export default Box2;
|
|
@@ -611,33 +611,33 @@ Box3 .prototype =
|
|
|
611
611
|
},
|
|
612
612
|
};
|
|
613
613
|
|
|
614
|
-
Object .
|
|
614
|
+
Object .defineProperties (Box3 .prototype,
|
|
615
615
|
{
|
|
616
|
-
|
|
616
|
+
size:
|
|
617
617
|
{
|
|
618
|
-
|
|
619
|
-
min = new Vector3 (0, 0, 0),
|
|
620
|
-
max = new Vector3 (0, 0, 0);
|
|
621
|
-
|
|
622
|
-
return function ()
|
|
618
|
+
get: (function ()
|
|
623
619
|
{
|
|
624
|
-
|
|
620
|
+
const
|
|
621
|
+
min = new Vector3 (0, 0, 0),
|
|
622
|
+
max = new Vector3 (0, 0, 0);
|
|
625
623
|
|
|
626
|
-
return
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
enumerable: true,
|
|
630
|
-
configurable: false
|
|
631
|
-
});
|
|
624
|
+
return function ()
|
|
625
|
+
{
|
|
626
|
+
this .getAbsoluteExtents (min, max);
|
|
632
627
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
628
|
+
return max .subtract (min);
|
|
629
|
+
};
|
|
630
|
+
})(),
|
|
631
|
+
enumerable: true,
|
|
632
|
+
},
|
|
633
|
+
center:
|
|
636
634
|
{
|
|
637
|
-
|
|
635
|
+
get: function ()
|
|
636
|
+
{
|
|
637
|
+
return this .matrix .origin;
|
|
638
|
+
},
|
|
639
|
+
enumerable: true,
|
|
638
640
|
},
|
|
639
|
-
enumerable: true,
|
|
640
|
-
configurable: false
|
|
641
641
|
});
|
|
642
642
|
|
|
643
643
|
export default Box3;
|
|
@@ -64,7 +64,6 @@ function Color3 (r, g, b)
|
|
|
64
64
|
Color3 .prototype =
|
|
65
65
|
{
|
|
66
66
|
constructor: Color3,
|
|
67
|
-
length: 3,
|
|
68
67
|
[Symbol .iterator]: function* ()
|
|
69
68
|
{
|
|
70
69
|
yield this [_r];
|
|
@@ -180,35 +179,28 @@ Color3 .prototype =
|
|
|
180
179
|
const r = {
|
|
181
180
|
get: function () { return this [_r]; },
|
|
182
181
|
set: function (value) { this [_r] = clamp (value, 0, 1); },
|
|
183
|
-
enumerable: true,
|
|
184
|
-
configurable: false
|
|
185
182
|
};
|
|
186
183
|
|
|
187
184
|
const g = {
|
|
188
185
|
get: function () { return this [_g]; },
|
|
189
186
|
set: function (value) { this [_g] = clamp (value, 0, 1); },
|
|
190
|
-
enumerable: true,
|
|
191
|
-
configurable: false
|
|
192
187
|
};
|
|
193
188
|
|
|
194
189
|
const b = {
|
|
195
190
|
get: function () { return this [_b]; },
|
|
196
191
|
set: function (value) { this [_b] = clamp (value, 0, 1); },
|
|
197
|
-
enumerable: true,
|
|
198
|
-
configurable: false
|
|
199
192
|
};
|
|
200
193
|
|
|
201
|
-
Object .
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
Object .
|
|
210
|
-
|
|
211
|
-
Object .defineProperty (Color3 .prototype, "2", b);
|
|
194
|
+
Object .defineProperties (Color3 .prototype,
|
|
195
|
+
{
|
|
196
|
+
length: { value: 3 },
|
|
197
|
+
0: r,
|
|
198
|
+
1: g,
|
|
199
|
+
2: b,
|
|
200
|
+
r: Object .assign ({ enumerable: true }, r),
|
|
201
|
+
g: Object .assign ({ enumerable: true }, g),
|
|
202
|
+
b: Object .assign ({ enumerable: true }, b),
|
|
203
|
+
});
|
|
212
204
|
|
|
213
205
|
Object .assign (Color3,
|
|
214
206
|
{
|
|
@@ -67,7 +67,6 @@ function Color4 (r, g, b, a)
|
|
|
67
67
|
Color4 .prototype =
|
|
68
68
|
{
|
|
69
69
|
constructor: Color4,
|
|
70
|
-
length: 4,
|
|
71
70
|
[Symbol .iterator]: function* ()
|
|
72
71
|
{
|
|
73
72
|
yield this [_r];
|
|
@@ -135,45 +134,35 @@ Color4 .prototype =
|
|
|
135
134
|
const r = {
|
|
136
135
|
get: function () { return this [_r]; },
|
|
137
136
|
set: function (value) { this [_r] = clamp (value, 0, 1); },
|
|
138
|
-
enumerable: true,
|
|
139
|
-
configurable: false
|
|
140
137
|
};
|
|
141
138
|
|
|
142
139
|
const g = {
|
|
143
140
|
get: function () { return this [_g]; },
|
|
144
141
|
set: function (value) { this [_g] = clamp (value, 0, 1); },
|
|
145
|
-
enumerable: true,
|
|
146
|
-
configurable: false
|
|
147
142
|
};
|
|
148
143
|
|
|
149
144
|
const b = {
|
|
150
145
|
get: function () { return this [_b]; },
|
|
151
146
|
set: function (value) { this [_b] = clamp (value, 0, 1); },
|
|
152
|
-
enumerable: true,
|
|
153
|
-
configurable: false
|
|
154
147
|
};
|
|
155
148
|
|
|
156
149
|
const a = {
|
|
157
150
|
get: function () { return this [_a]; },
|
|
158
151
|
set: function (value) { this [_a] = clamp (value, 0, 1); },
|
|
159
|
-
enumerable: true,
|
|
160
|
-
configurable: false
|
|
161
152
|
};
|
|
162
153
|
|
|
163
|
-
Object .
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Object .
|
|
174
|
-
|
|
175
|
-
Object .defineProperty (Color4 .prototype, "2", b);
|
|
176
|
-
Object .defineProperty (Color4 .prototype, "3", a);
|
|
154
|
+
Object .defineProperties (Color4 .prototype,
|
|
155
|
+
{
|
|
156
|
+
length: { value: 4 },
|
|
157
|
+
0: r,
|
|
158
|
+
1: g,
|
|
159
|
+
2: b,
|
|
160
|
+
3: a,
|
|
161
|
+
r: Object .assign ({ enumerable: true }, r),
|
|
162
|
+
g: Object .assign ({ enumerable: true }, g),
|
|
163
|
+
b: Object .assign ({ enumerable: true }, b),
|
|
164
|
+
a: Object .assign ({ enumerable: true }, a),
|
|
165
|
+
});
|
|
177
166
|
|
|
178
167
|
Object .assign (Color4,
|
|
179
168
|
{
|
|
@@ -54,7 +54,6 @@ function Complex (real, imag)
|
|
|
54
54
|
Complex .prototype =
|
|
55
55
|
{
|
|
56
56
|
constructor: Complex,
|
|
57
|
-
length: 2,
|
|
58
57
|
[Symbol .iterator]: function* ()
|
|
59
58
|
{
|
|
60
59
|
yield this .real;
|
|
@@ -156,75 +155,81 @@ Complex .prototype =
|
|
|
156
155
|
},
|
|
157
156
|
toString: function ()
|
|
158
157
|
{
|
|
159
|
-
|
|
160
|
-
return this .real + " " + this .imag + "i";
|
|
158
|
+
let string = "";
|
|
161
159
|
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
};
|
|
160
|
+
string += this .real;
|
|
165
161
|
|
|
166
|
-
|
|
167
|
-
{
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
162
|
+
if (this .imag < 0)
|
|
163
|
+
{
|
|
164
|
+
string += this .imag;
|
|
165
|
+
string += "i";
|
|
166
|
+
}
|
|
167
|
+
else if (this .imag > 0)
|
|
168
|
+
{
|
|
169
|
+
string += "+";
|
|
170
|
+
string += this .imag;
|
|
171
|
+
string += "i";
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return string;
|
|
175
175
|
},
|
|
176
|
-
|
|
177
|
-
configurable: false
|
|
178
|
-
});
|
|
176
|
+
};
|
|
179
177
|
|
|
180
|
-
Object .
|
|
178
|
+
Object .defineProperties (Complex .prototype,
|
|
181
179
|
{
|
|
182
|
-
|
|
180
|
+
length: { value: 2 },
|
|
181
|
+
0:
|
|
183
182
|
{
|
|
184
|
-
|
|
183
|
+
get: function ()
|
|
184
|
+
{
|
|
185
|
+
return this .real;
|
|
186
|
+
},
|
|
187
|
+
set: function (value)
|
|
188
|
+
{
|
|
189
|
+
this .real = value;
|
|
190
|
+
},
|
|
185
191
|
},
|
|
186
|
-
|
|
192
|
+
1:
|
|
187
193
|
{
|
|
188
|
-
|
|
194
|
+
get: function ()
|
|
195
|
+
{
|
|
196
|
+
return this .imag;
|
|
197
|
+
},
|
|
198
|
+
set: function (value)
|
|
199
|
+
{
|
|
200
|
+
this .imag = value;
|
|
201
|
+
},
|
|
189
202
|
},
|
|
190
|
-
|
|
191
|
-
configurable: false
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
Object .defineProperty (Complex .prototype, "magnitude",
|
|
195
|
-
{
|
|
196
|
-
get: function ()
|
|
203
|
+
magnitude:
|
|
197
204
|
{
|
|
198
|
-
|
|
205
|
+
get: function ()
|
|
199
206
|
{
|
|
200
|
-
if (this .
|
|
201
|
-
|
|
207
|
+
if (this .real)
|
|
208
|
+
{
|
|
209
|
+
if (this .imag)
|
|
210
|
+
return Math .hypot (this .real, this .imag);
|
|
202
211
|
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
return Math .abs (this .real);
|
|
213
|
+
}
|
|
205
214
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
enumerable: false,
|
|
213
|
-
configurable: false
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
Object .defineProperty (Complex .prototype, "angle",
|
|
217
|
-
{
|
|
218
|
-
get: function ()
|
|
219
|
-
{
|
|
220
|
-
return Math .atan2 (this .imag, this .real);
|
|
215
|
+
return Math .abs (this .imag);
|
|
216
|
+
},
|
|
217
|
+
set: function (magnitude)
|
|
218
|
+
{
|
|
219
|
+
this .setPolar (magnitude, this .angle);
|
|
220
|
+
},
|
|
221
221
|
},
|
|
222
|
-
|
|
222
|
+
angle:
|
|
223
223
|
{
|
|
224
|
-
|
|
224
|
+
get: function ()
|
|
225
|
+
{
|
|
226
|
+
return Math .atan2 (this .imag, this .real);
|
|
227
|
+
},
|
|
228
|
+
set: function (angle)
|
|
229
|
+
{
|
|
230
|
+
this .setPolar (this .magnitude, angle);
|
|
231
|
+
},
|
|
225
232
|
},
|
|
226
|
-
enumerable: false,
|
|
227
|
-
configurable: false
|
|
228
233
|
});
|
|
229
234
|
|
|
230
235
|
Object .assign (Complex,
|
|
@@ -45,8 +45,7 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import Vector2
|
|
49
|
-
import Algorithm from "../Algorithm.js";
|
|
48
|
+
import Vector2 from "./Vector2.js";
|
|
50
49
|
|
|
51
50
|
function Matrix2 ()
|
|
52
51
|
{
|
|
@@ -64,13 +63,9 @@ function Matrix2 ()
|
|
|
64
63
|
Matrix2 .prototype =
|
|
65
64
|
{
|
|
66
65
|
constructor: Matrix2,
|
|
67
|
-
order: 2,
|
|
68
|
-
length: 4,
|
|
69
66
|
[Symbol .iterator]: function* ()
|
|
70
67
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (let i = 0; i < length; ++ i)
|
|
68
|
+
for (let i = 0; i < 4; ++ i)
|
|
74
69
|
yield this [i];
|
|
75
70
|
},
|
|
76
71
|
copy: function ()
|
|
@@ -236,49 +231,40 @@ Matrix2 .prototype =
|
|
|
236
231
|
},
|
|
237
232
|
};
|
|
238
233
|
|
|
239
|
-
Object .
|
|
234
|
+
Object .defineProperties (Matrix2 .prototype,
|
|
240
235
|
{
|
|
241
|
-
|
|
236
|
+
order: { value: 2 },
|
|
237
|
+
length: { value: 4 },
|
|
238
|
+
x:
|
|
242
239
|
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
})(),
|
|
247
|
-
enumerable: false,
|
|
248
|
-
configurable: false
|
|
249
|
-
});
|
|
240
|
+
get: (function ()
|
|
241
|
+
{
|
|
242
|
+
const vector = new Vector2 (0, 0);
|
|
250
243
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
244
|
+
return function () { return vector .set (this [0], this [1]); };
|
|
245
|
+
})(),
|
|
246
|
+
},
|
|
247
|
+
y:
|
|
254
248
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
})(),
|
|
259
|
-
enumerable: false,
|
|
260
|
-
configurable: false
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
Object .defineProperty (Matrix2 .prototype, "xAxis",
|
|
264
|
-
{
|
|
265
|
-
get: function () { return this [0]; },
|
|
266
|
-
enumerable: false,
|
|
267
|
-
configurable: false
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
Object .defineProperty (Matrix2 .prototype, "origin",
|
|
271
|
-
{
|
|
272
|
-
get: function () { return this [2]; },
|
|
273
|
-
enumerable: false,
|
|
274
|
-
configurable: false
|
|
275
|
-
});
|
|
249
|
+
get: (function ()
|
|
250
|
+
{
|
|
251
|
+
const vector = new Vector2 (0, 0);
|
|
276
252
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
253
|
+
return function () { return vector .set (this [2], this [3]); };
|
|
254
|
+
})(),
|
|
255
|
+
},
|
|
256
|
+
xAxis:
|
|
257
|
+
{
|
|
258
|
+
get: function () { return this [0]; },
|
|
259
|
+
},
|
|
260
|
+
origin:
|
|
261
|
+
{
|
|
262
|
+
get: function () { return this [2]; },
|
|
263
|
+
},
|
|
264
|
+
submatrix:
|
|
265
|
+
{
|
|
266
|
+
get: function () { return this [0]; },
|
|
267
|
+
},
|
|
282
268
|
});
|
|
283
269
|
|
|
284
270
|
Object .assign (Matrix2,
|