x_ite 8.7.4 → 8.7.6
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/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 +21 -23
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +35 -36
- 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 +37 -32
- 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 +25 -25
- 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 +26 -27
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +15 -15
- 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 +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 +1187 -1686
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_includes/scripts.html +0 -1
- package/docs/_posts/components/CADGeometry/QuadSet.md +1 -1
- package/docs/_posts/components/CubeMapTexturing/ComposedCubeMapTexture.md +1 -1
- package/docs/_posts/components/CubeMapTexturing/GeneratedCubeMapTexture.md +1 -1
- package/docs/_posts/components/EnvironmentalEffects/Background.md +1 -1
- package/docs/_posts/components/EnvironmentalEffects/Fog.md +1 -1
- package/docs/_posts/components/EnvironmentalEffects/LocalFog.md +1 -1
- package/docs/_posts/components/EnvironmentalEffects/TextureBackground.md +1 -1
- package/docs/_posts/components/EnvironmentalSensor/ProximitySensor.md +1 -1
- package/docs/_posts/components/EnvironmentalSensor/TransformSensor.md +1 -1
- package/docs/_posts/components/EnvironmentalSensor/VisibilitySensor.md +1 -1
- package/docs/_posts/components/EventUtilities/IntegerSequencer.md +1 -1
- package/docs/_posts/components/Followers/ColorChaser.md +1 -1
- package/docs/_posts/components/Followers/ColorDamper.md +1 -1
- package/docs/_posts/components/Followers/CoordinateChaser.md +1 -1
- package/docs/_posts/components/Followers/ScalarChaser.md +1 -1
- package/docs/_posts/components/Geometry2D/Arc2D.md +1 -1
- package/docs/_posts/components/Geometry2D/ArcClose2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Circle2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Disk2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Polyline2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Polypoint2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Rectangle2D.md +1 -1
- package/docs/_posts/components/Geometry2D/TriangleSet2D.md +1 -1
- package/docs/_posts/components/Geometry3D/Box.md +1 -1
- package/docs/_posts/components/Geometry3D/Cone.md +1 -1
- package/docs/_posts/components/Geometry3D/Cylinder.md +1 -1
- package/docs/_posts/components/Geometry3D/ElevationGrid.md +1 -1
- package/docs/_posts/components/Geometry3D/Extrusion.md +1 -1
- package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +1 -1
- package/docs/_posts/components/Geometry3D/Sphere.md +1 -1
- package/docs/_posts/components/Geospatial/GeoElevationGrid.md +1 -1
- package/docs/_posts/components/Geospatial/GeoLOD.md +1 -1
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +1 -1
- package/docs/_posts/components/Grouping/Group.md +1 -1
- package/docs/_posts/components/Grouping/Switch.md +1 -1
- package/docs/_posts/components/Grouping/Transform.md +1 -1
- package/docs/_posts/components/HAnim/HAnimHumanoid.md +1 -1
- package/docs/_posts/components/Interpolation/ColorInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/OrientationInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/PositionInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +1 -1
- package/docs/_posts/components/Interpolation/ScalarInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/SplineScalarInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/SquadOrientationInterpolator.md +1 -1
- package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +1 -1
- package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +1 -1
- package/docs/_posts/components/Layering/LayerSet.md +1 -1
- package/docs/_posts/components/Layering/Viewport.md +1 -1
- package/docs/_posts/components/Lighting/DirectionalLight.md +1 -1
- package/docs/_posts/components/Lighting/PointLight.md +1 -1
- package/docs/_posts/components/Lighting/SpotLight.md +1 -1
- package/docs/_posts/components/NURBS/NurbsCurve.md +1 -1
- package/docs/_posts/components/NURBS/NurbsPatchSurface.md +1 -1
- package/docs/_posts/components/NURBS/NurbsSweptSurface.md +1 -1
- package/docs/_posts/components/Navigation/Billboard.md +1 -1
- package/docs/_posts/components/Navigation/Collision.md +1 -1
- package/docs/_posts/components/Navigation/NavigationInfo.md +1 -1
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +1 -1
- package/docs/_posts/components/Navigation/Viewpoint.md +1 -1
- package/docs/_posts/components/Networking/Anchor.md +1 -1
- package/docs/_posts/components/Networking/Inline.md +1 -1
- package/docs/_posts/components/Networking/LoadSensor.md +1 -1
- package/docs/_posts/components/ParticleSystems/ConeEmitter.md +1 -1
- package/docs/_posts/components/ParticleSystems/ExplosionEmitter.md +1 -1
- package/docs/_posts/components/ParticleSystems/ForcePhysicsModel.md +1 -1
- package/docs/_posts/components/ParticleSystems/ParticleSystem.md +1 -1
- package/docs/_posts/components/ParticleSystems/PointEmitter.md +1 -1
- package/docs/_posts/components/ParticleSystems/PolylineEmitter.md +1 -1
- package/docs/_posts/components/ParticleSystems/SurfaceEmitter.md +1 -1
- package/docs/_posts/components/ParticleSystems/VolumeEmitter.md +1 -1
- package/docs/_posts/components/ParticleSystems/WindPhysicsModel.md +1 -1
- package/docs/_posts/components/Picking/LinePickSensor.md +1 -1
- package/docs/_posts/components/Picking/PointPickSensor.md +1 -1
- package/docs/_posts/components/Picking/PrimitivePickSensor.md +1 -1
- package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +1 -1
- package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +1 -1
- package/docs/_posts/components/Rendering/ClipPlane.md +1 -1
- package/docs/_posts/components/Rendering/Color.md +1 -1
- package/docs/_posts/components/Rendering/ColorRGBA.md +1 -1
- package/docs/_posts/components/Rendering/Coordinate.md +1 -1
- package/docs/_posts/components/Rendering/IndexedLineSet.md +1 -1
- package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +1 -1
- package/docs/_posts/components/Rendering/IndexedTriangleSet.md +1 -1
- package/docs/_posts/components/Rendering/LineSet.md +1 -1
- package/docs/_posts/components/Rendering/PointSet.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/BallJoint.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/CollidableShape.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/CollisionCollection.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +1 -1
- package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +1 -1
- package/docs/_posts/components/Shaders/ComposedShader.md +1 -1
- package/docs/_posts/components/Shaders/FloatVertexAttribute.md +1 -1
- package/docs/_posts/components/Shaders/ShaderPart.md +1 -1
- package/docs/_posts/components/Shape/Appearance.md +1 -1
- package/docs/_posts/components/Shape/FillProperties.md +1 -1
- package/docs/_posts/components/Shape/LineProperties.md +1 -1
- package/docs/_posts/components/Shape/Material.md +1 -1
- package/docs/_posts/components/Shape/TwoSidedMaterial.md +1 -1
- package/docs/_posts/components/Sound/AudioClip.md +1 -1
- package/docs/_posts/components/Text/FontStyle.md +1 -1
- package/docs/_posts/components/Text/Text.md +1 -1
- package/docs/_posts/components/Texturing/ImageTexture.md +1 -1
- package/docs/_posts/components/Texturing/MovieTexture.md +1 -1
- package/docs/_posts/components/Texturing/MultiTexture.md +1 -1
- package/docs/_posts/components/Texturing/PixelTexture.md +1 -1
- package/docs/_posts/components/Texturing3D/ImageTexture3D.md +1 -1
- package/docs/_posts/components/Texturing3D/ImageTextureAtlas.md +1 -1
- package/docs/_posts/components/Time/TimeSensor.md +1 -1
- package/docs/_posts/components/VolumeRendering/EdgeEnhancementVolumeStyle.md +1 -1
- package/docs/_posts/components/VolumeRendering/IsoSurfaceVolumeData.md +1 -1
- package/docs/_posts/components/VolumeRendering/SegmentedVolumeData.md +1 -1
- package/docs/_posts/components/VolumeRendering/ShadedVolumeStyle.md +1 -1
- package/docs/_posts/components/VolumeRendering/ToneMappedVolumeStyle.md +1 -1
- package/docs/_posts/components/VolumeRendering/VolumeData.md +1 -1
- package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
- package/docs/_posts/custom-shaders.md +1 -1
- package/docs/_posts/getting-started.md +7 -2
- package/docs/_posts/reference/browser-services.md +6 -0
- package/docs/_posts/reference/field-services-and-objects.md +26 -6
- package/docs/_posts/tutorials/adding-backgrounds.md +2 -2
- package/docs/_posts/tutorials/adding-sound.md +1 -1
- package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
- package/docs/_posts/tutorials/building-elevation-grids.md +1 -1
- package/docs/_posts/tutorials/building-primitive-shapes.md +2 -2
- package/docs/_posts/tutorials/controlling-appearance-with-materials.md +1 -1
- package/docs/_posts/tutorials/controlling-detail.md +1 -1
- package/docs/_posts/tutorials/hello-world.md +1 -1
- package/docs/_posts/tutorials/naming-nodes.md +1 -1
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +1 -1
- package/package.json +3 -3
- package/src/lib/jquery.js +13 -0
- package/src/standard/Geospatial/UniversalTransverseMercator.js +0 -1
- package/src/standard/Math/Algorithms/eigen_decomposition.js +9 -9
- package/src/standard/Math/Geometry/Box2.js +37 -24
- package/src/standard/Math/Geometry/Box3.js +37 -24
- package/src/standard/Math/Geometry/Cylinder3.js +1 -1
- package/src/standard/Math/Geometry/Line2.js +1 -1
- package/src/standard/Math/Geometry/Line3.js +1 -1
- package/src/standard/Math/Geometry/Plane3.js +1 -1
- package/src/standard/Math/Geometry/Sphere3.js +14 -14
- 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 -58
- 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 +70 -132
- package/src/standard/Math/Numbers/Rotation4.js +15 -42
- package/src/standard/Math/Numbers/Vector2.js +12 -78
- package/src/standard/Math/Numbers/Vector3.js +17 -94
- package/src/standard/Math/Numbers/Vector4.js +22 -94
- package/src/x_ite/Base/X3DInfoArray.js +9 -7
- package/src/x_ite/Base/X3DObject.js +9 -32
- package/src/x_ite/Base/X3DObjectArrayField.js +35 -64
- package/src/x_ite/Browser/Core/BrowserOptions.js +37 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +21 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +4 -4
- package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +12 -7
- package/src/x_ite/Browser/Layout/ScreenText.js +9 -4
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +9 -9
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -3
- package/src/x_ite/Browser/Navigation/WalkViewer.js +2 -2
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +7 -7
- package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +0 -1
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +2 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +61 -68
- package/src/x_ite/Browser/X3DBrowserContext.js +8 -8
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +1 -1
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +1 -1
- package/src/x_ite/Components/Followers/OrientationChaser.js +3 -3
- package/src/x_ite/Components/Followers/OrientationDamper.js +3 -3
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +2 -3
- package/src/x_ite/Components/Geometry3D/Box.js +3 -10
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -1
- package/src/x_ite/Components/Geometry3D/Cylinder.js +2 -2
- package/src/x_ite/Components/Geometry3D/Extrusion.js +3 -3
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +2 -2
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +2 -2
- package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
- package/src/x_ite/Components/Layout/Layout.js +1 -1
- package/src/x_ite/Components/Navigation/Billboard.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +12 -13
- package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +7 -7
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +1 -1
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +9 -9
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +2 -2
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +3 -3
- package/src/x_ite/Components/TextureProjector/X3DTextureProjectorNode.js +1 -1
- 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 +129 -53
- package/src/x_ite/Fields/ArrayFields.js +1 -1
- 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/SFNodeCache.js +2 -2
- 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 +11 -18
- package/src/x_ite/Fields/SFVec4.js +12 -23
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +17 -16
- package/src/x_ite/Parser/SVGParser.js +3 -3
- package/src/x_ite/Parser/X3DOptimizer.js +1 -1
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +26 -27
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +16 -15
- package/src/x_ite/Rendering/X3DRenderObject.js +3 -3
- package/src/x_ite/Routing/X3DRoute.js +26 -25
- package/src/x_ite/X3DCanvasElement.js +1 -0
- package/docs/assets/js/autoupdate.js +0 -25
- package/src/x_ite/Execution/Scene.js +0 -145
|
@@ -68,13 +68,9 @@ function Matrix4 ()
|
|
|
68
68
|
Matrix4 .prototype =
|
|
69
69
|
{
|
|
70
70
|
constructor: Matrix4,
|
|
71
|
-
order: 4,
|
|
72
|
-
length: 16,
|
|
73
71
|
[Symbol .iterator]: function* ()
|
|
74
72
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
for (let i = 0; i < length; ++ i)
|
|
73
|
+
for (let i = 0; i < 16; ++ i)
|
|
78
74
|
yield this [i];
|
|
79
75
|
},
|
|
80
76
|
copy: function ()
|
|
@@ -672,118 +668,97 @@ Matrix4 .prototype =
|
|
|
672
668
|
},
|
|
673
669
|
};
|
|
674
670
|
|
|
675
|
-
Object .
|
|
671
|
+
Object .defineProperties (Matrix4 .prototype,
|
|
676
672
|
{
|
|
677
|
-
|
|
673
|
+
order: { value: 4 },
|
|
674
|
+
length: { value: 16 },
|
|
675
|
+
x:
|
|
678
676
|
{
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
})(),
|
|
683
|
-
enumerable: false,
|
|
684
|
-
configurable: false
|
|
685
|
-
});
|
|
677
|
+
get: (function ()
|
|
678
|
+
{
|
|
679
|
+
const vector = new Vector4 (0, 0, 0, 0);
|
|
686
680
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
681
|
+
return function () { return vector .set (this [0], this [1], this [2], this [3]); };
|
|
682
|
+
})(),
|
|
683
|
+
},
|
|
684
|
+
y:
|
|
690
685
|
{
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
})(),
|
|
695
|
-
enumerable: false,
|
|
696
|
-
configurable: false
|
|
697
|
-
});
|
|
686
|
+
get: (function ()
|
|
687
|
+
{
|
|
688
|
+
const vector = new Vector4 (0, 0, 0, 0);
|
|
698
689
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
690
|
+
return function () { return vector .set (this [4], this [5], this [6], this [7]); };
|
|
691
|
+
})(),
|
|
692
|
+
},
|
|
693
|
+
z:
|
|
702
694
|
{
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
})(),
|
|
707
|
-
enumerable: false,
|
|
708
|
-
configurable: false
|
|
709
|
-
});
|
|
695
|
+
get: (function ()
|
|
696
|
+
{
|
|
697
|
+
const vector = new Vector4 (0, 0, 0, 0);
|
|
710
698
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
699
|
+
return function () { return vector .set (this [8], this [9], this [10], this [11]); };
|
|
700
|
+
})(),
|
|
701
|
+
},
|
|
702
|
+
w:
|
|
714
703
|
{
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
})(),
|
|
719
|
-
enumerable: false,
|
|
720
|
-
configurable: false
|
|
721
|
-
});
|
|
704
|
+
get: (function ()
|
|
705
|
+
{
|
|
706
|
+
const vector = new Vector4 (0, 0, 0, 0);
|
|
722
707
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
708
|
+
return function () { return vector .set (this [12], this [13], this [14], this [15]); };
|
|
709
|
+
})(),
|
|
710
|
+
},
|
|
711
|
+
xAxis:
|
|
726
712
|
{
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
})(),
|
|
731
|
-
enumerable: false,
|
|
732
|
-
configurable: false
|
|
733
|
-
});
|
|
713
|
+
get: (function ()
|
|
714
|
+
{
|
|
715
|
+
const vector = new Vector3 (0, 0, 0);
|
|
734
716
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
717
|
+
return function () { return vector .set (this [0], this [1], this [2]); };
|
|
718
|
+
})(),
|
|
719
|
+
},
|
|
720
|
+
yAxis:
|
|
738
721
|
{
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
})(),
|
|
743
|
-
enumerable: false,
|
|
744
|
-
configurable: false
|
|
745
|
-
});
|
|
722
|
+
get: (function ()
|
|
723
|
+
{
|
|
724
|
+
const vector = new Vector3 (0, 0, 0);
|
|
746
725
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
726
|
+
return function () { return vector .set (this [4], this [5], this [6]); };
|
|
727
|
+
})(),
|
|
728
|
+
},
|
|
729
|
+
zAxis:
|
|
750
730
|
{
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
})(),
|
|
755
|
-
enumerable: false,
|
|
756
|
-
configurable: false
|
|
757
|
-
});
|
|
731
|
+
get: (function ()
|
|
732
|
+
{
|
|
733
|
+
const vector = new Vector3 (0, 0, 0);
|
|
758
734
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
735
|
+
return function () { return vector .set (this [8], this [9], this [10]); };
|
|
736
|
+
})(),
|
|
737
|
+
},
|
|
738
|
+
origin:
|
|
762
739
|
{
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
})(),
|
|
767
|
-
enumerable: false,
|
|
768
|
-
configurable: false
|
|
769
|
-
});
|
|
740
|
+
get: (function ()
|
|
741
|
+
{
|
|
742
|
+
const vector = new Vector3 (0, 0, 0);
|
|
770
743
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
744
|
+
return function () { return vector .set (this [12], this [13], this [14]); };
|
|
745
|
+
})(),
|
|
746
|
+
},
|
|
747
|
+
submatrix:
|
|
774
748
|
{
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
return function ()
|
|
749
|
+
get: (function ()
|
|
778
750
|
{
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
751
|
+
const matrix = new Matrix3 ();
|
|
752
|
+
|
|
753
|
+
return function ()
|
|
754
|
+
{
|
|
755
|
+
matrix [0] = this [0]; matrix [1] = this [1]; matrix [2] = this [ 2];
|
|
756
|
+
matrix [3] = this [4]; matrix [4] = this [5]; matrix [5] = this [ 6];
|
|
757
|
+
matrix [6] = this [8]; matrix [7] = this [9]; matrix [8] = this [10];
|
|
758
|
+
return matrix;
|
|
759
|
+
};
|
|
760
|
+
})(),
|
|
761
|
+
},
|
|
787
762
|
});
|
|
788
763
|
|
|
789
764
|
Object .assign (Matrix4,
|
|
@@ -811,22 +786,6 @@ Object .assign (Matrix4,
|
|
|
811
786
|
matrix [6], matrix [7], matrix [8], 0,
|
|
812
787
|
0, 0, 0, 1);
|
|
813
788
|
},
|
|
814
|
-
transpose: function (matrix)
|
|
815
|
-
{
|
|
816
|
-
return matrix .copy () .transpose ();
|
|
817
|
-
},
|
|
818
|
-
inverse: function (matrix)
|
|
819
|
-
{
|
|
820
|
-
return matrix .copy () .inverse ();
|
|
821
|
-
},
|
|
822
|
-
multLeft: function (lhs, rhs)
|
|
823
|
-
{
|
|
824
|
-
return lhs .copy () .multLeft (rhs);
|
|
825
|
-
},
|
|
826
|
-
multRight: function (lhs, rhs)
|
|
827
|
-
{
|
|
828
|
-
return lhs .copy () .multRight (rhs);
|
|
829
|
-
},
|
|
830
789
|
});
|
|
831
790
|
|
|
832
791
|
const
|
|
@@ -60,7 +60,6 @@ function Quaternion (x, y, z, w)
|
|
|
60
60
|
Quaternion .prototype =
|
|
61
61
|
{
|
|
62
62
|
constructor: Quaternion,
|
|
63
|
-
length: 4,
|
|
64
63
|
[Symbol .iterator]: function* ()
|
|
65
64
|
{
|
|
66
65
|
yield this .x;
|
|
@@ -95,24 +94,22 @@ Quaternion .prototype =
|
|
|
95
94
|
},
|
|
96
95
|
setMatrix: function (matrix)
|
|
97
96
|
{
|
|
98
|
-
let i;
|
|
99
|
-
|
|
100
97
|
// First, find largest diagonal in matrix:
|
|
101
98
|
if (matrix [0] > matrix [4])
|
|
102
99
|
{
|
|
103
|
-
i = matrix [0] > matrix [8] ? 0 : 2;
|
|
100
|
+
var i = matrix [0] > matrix [8] ? 0 : 2;
|
|
104
101
|
}
|
|
105
102
|
else
|
|
106
103
|
{
|
|
107
|
-
i = matrix [4] > matrix [8] ? 1 : 2;
|
|
104
|
+
var i = matrix [4] > matrix [8] ? 1 : 2;
|
|
108
105
|
}
|
|
109
106
|
|
|
110
|
-
const
|
|
107
|
+
const scaleRow = matrix [0] + matrix [4] + matrix [8];
|
|
111
108
|
|
|
112
|
-
if (
|
|
109
|
+
if (scaleRow > matrix [i * 3 + i])
|
|
113
110
|
{
|
|
114
111
|
// Compute w first:
|
|
115
|
-
this [3] = Math .sqrt (
|
|
112
|
+
this [3] = Math .sqrt (scaleRow + 1) / 2;
|
|
116
113
|
|
|
117
114
|
// And compute other values:
|
|
118
115
|
const d = 4 * this [3];
|
|
@@ -260,9 +257,9 @@ Quaternion .prototype =
|
|
|
260
257
|
const
|
|
261
258
|
{ x: qx, y: qy, z: qz, w: qw } = this,
|
|
262
259
|
{ x: vx, y: vy, z: vz } = vector,
|
|
263
|
-
a
|
|
264
|
-
b
|
|
265
|
-
c
|
|
260
|
+
a = qw * qw - qx * qx - qy * qy - qz * qz,
|
|
261
|
+
b = 2 * (vx * qx + vy * qy + vz * qz),
|
|
262
|
+
c = 2 * qw;
|
|
266
263
|
|
|
267
264
|
vector .x = a * vx + b * qx + c * (qy * vz - qz * vy);
|
|
268
265
|
vector .y = a * vy + b * qy + c * (qz * vx - qx * vz);
|
|
@@ -275,9 +272,9 @@ Quaternion .prototype =
|
|
|
275
272
|
const
|
|
276
273
|
{ x: qx, y: qy, z: qz, w: qw } = this,
|
|
277
274
|
{ x: vx, y: vy, z: vz } = vector,
|
|
278
|
-
a
|
|
279
|
-
b
|
|
280
|
-
c
|
|
275
|
+
a = qw * qw - qx * qx - qy * qy - qz * qz,
|
|
276
|
+
b = 2 * (vx * qx + vy * qy + vz * qz),
|
|
277
|
+
c = 2 * qw;
|
|
281
278
|
|
|
282
279
|
vector .x = a * vx + b * qx - c * (qy * vz - qz * vy);
|
|
283
280
|
vector .y = a * vy + b * qy - c * (qz * vx - qx * vz);
|
|
@@ -402,138 +399,85 @@ Quaternion .prototype =
|
|
|
402
399
|
},
|
|
403
400
|
};
|
|
404
401
|
|
|
405
|
-
Object .
|
|
406
|
-
{
|
|
407
|
-
get: function () { return this .x; },
|
|
408
|
-
set: function (value) { this .x = value; },
|
|
409
|
-
enumerable: false,
|
|
410
|
-
configurable: false
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
Object .defineProperty (Quaternion .prototype, "1",
|
|
414
|
-
{
|
|
415
|
-
get: function () { return this .y; },
|
|
416
|
-
set: function (value) { this .y = value; },
|
|
417
|
-
enumerable: false,
|
|
418
|
-
configurable: false
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
Object .defineProperty (Quaternion .prototype, "2",
|
|
422
|
-
{
|
|
423
|
-
get: function () { return this .z; },
|
|
424
|
-
set: function (value) { this .z = value; },
|
|
425
|
-
enumerable: false,
|
|
426
|
-
configurable: false
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
Object .defineProperty (Quaternion .prototype, "3",
|
|
430
|
-
{
|
|
431
|
-
get: function () { return this .w; },
|
|
432
|
-
set: function (value) { this .w = value; },
|
|
433
|
-
enumerable: false,
|
|
434
|
-
configurable: false
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
Object .defineProperty (Quaternion .prototype, "real",
|
|
402
|
+
Object .defineProperties (Quaternion .prototype,
|
|
438
403
|
{
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
configurable: false
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
Object .defineProperty (Quaternion .prototype, "imag",
|
|
445
|
-
{
|
|
446
|
-
get: (function ()
|
|
404
|
+
length: { value: 4 },
|
|
405
|
+
0:
|
|
447
406
|
{
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return function ()
|
|
451
|
-
{
|
|
452
|
-
return result .set (this .x,
|
|
453
|
-
this .y,
|
|
454
|
-
this .z);
|
|
455
|
-
};
|
|
456
|
-
})(),
|
|
457
|
-
enumerable: false,
|
|
458
|
-
configurable: false
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
Object .assign (Quaternion,
|
|
462
|
-
{
|
|
463
|
-
negate: function (quat)
|
|
464
|
-
{
|
|
465
|
-
return quat .copy () .negate ();
|
|
407
|
+
get: function () { return this .x; },
|
|
408
|
+
set: function (value) { this .x = value; },
|
|
466
409
|
},
|
|
467
|
-
|
|
410
|
+
1:
|
|
468
411
|
{
|
|
469
|
-
|
|
412
|
+
get: function () { return this .y; },
|
|
413
|
+
set: function (value) { this .y = value; },
|
|
470
414
|
},
|
|
471
|
-
|
|
415
|
+
2:
|
|
472
416
|
{
|
|
473
|
-
|
|
417
|
+
get: function () { return this .z; },
|
|
418
|
+
set: function (value) { this .z = value; },
|
|
474
419
|
},
|
|
475
|
-
|
|
420
|
+
3:
|
|
476
421
|
{
|
|
477
|
-
|
|
422
|
+
get: function () { return this .w; },
|
|
423
|
+
set: function (value) { this .w = value; },
|
|
478
424
|
},
|
|
479
|
-
|
|
425
|
+
real:
|
|
480
426
|
{
|
|
481
|
-
|
|
427
|
+
get: function () { return this .w; },
|
|
482
428
|
},
|
|
483
|
-
|
|
429
|
+
imag:
|
|
484
430
|
{
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
{
|
|
497
|
-
return quat .copy () .normalize ();
|
|
498
|
-
},
|
|
499
|
-
slerp: function (source, destination, t)
|
|
500
|
-
{
|
|
501
|
-
return source .copy () .slerp (destination, t);
|
|
502
|
-
},
|
|
503
|
-
squad: function (source, a, b, destination, t)
|
|
504
|
-
{
|
|
505
|
-
return source .copy () .squad (a, b, destination, t);
|
|
506
|
-
},
|
|
507
|
-
/*
|
|
508
|
-
bezier: function (q0, a, b, q1, t)
|
|
509
|
-
{
|
|
510
|
-
return q0 .copy () .squad (a, b, q1, t);
|
|
431
|
+
get: (function ()
|
|
432
|
+
{
|
|
433
|
+
const result = new Vector3 (0, 0, 0);
|
|
434
|
+
|
|
435
|
+
return function ()
|
|
436
|
+
{
|
|
437
|
+
return result .set (this .x,
|
|
438
|
+
this .y,
|
|
439
|
+
this .z);
|
|
440
|
+
};
|
|
441
|
+
})(),
|
|
511
442
|
},
|
|
512
|
-
|
|
513
|
-
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
Object .assign (Quaternion,
|
|
446
|
+
{
|
|
447
|
+
Identity: new Quaternion (0, 0, 0, 1),
|
|
448
|
+
spline: (function ()
|
|
514
449
|
{
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
450
|
+
const
|
|
451
|
+
q0 = new Quaternion (0, 0, 0, 1),
|
|
452
|
+
q1 = new Quaternion (0, 0, 0, 1),
|
|
453
|
+
q2 = new Quaternion (0, 0, 0, 1),
|
|
454
|
+
q1_i = new Quaternion (0, 0, 0, 1);
|
|
455
|
+
|
|
456
|
+
return function (Q0, Q1, Q2)
|
|
457
|
+
{
|
|
458
|
+
q0 .assign (Q0);
|
|
459
|
+
q1 .assign (Q1);
|
|
460
|
+
q2 .assign (Q2);
|
|
518
461
|
|
|
519
|
-
|
|
520
|
-
|
|
462
|
+
// If the dot product is smaller than 0 we must negate the quaternion to prevent flipping. If we negate all
|
|
463
|
+
// the terms we get a different quaternion but it represents the same rotation.
|
|
521
464
|
|
|
522
|
-
|
|
523
|
-
|
|
465
|
+
if (q0 .dot (q1) < 0)
|
|
466
|
+
q0 .negate ();
|
|
524
467
|
|
|
525
|
-
|
|
526
|
-
|
|
468
|
+
if (q2 .dot (q1) < 0)
|
|
469
|
+
q2 .negate ();
|
|
527
470
|
|
|
528
|
-
|
|
471
|
+
q1_i .assign (q1) .inverse ();
|
|
529
472
|
|
|
530
|
-
|
|
473
|
+
// The result must be normalized as it will be used in slerp and we can only slerp normalized vectors.
|
|
531
474
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
475
|
+
return q1 .multRight (
|
|
476
|
+
t1 .assign (q1_i) .multRight (q0) .log () .add (t2 .assign (q1_i) .multRight (q2) .log ()) .divide (-4) .exp ()
|
|
477
|
+
)
|
|
478
|
+
.normalize () .copy ();
|
|
479
|
+
};
|
|
480
|
+
})(),
|
|
537
481
|
});
|
|
538
482
|
|
|
539
483
|
const
|
|
@@ -541,10 +485,4 @@ const
|
|
|
541
485
|
t2 = new Quaternion (0, 0, 0, 1),
|
|
542
486
|
t3 = new Quaternion (0, 0, 0, 1);
|
|
543
487
|
|
|
544
|
-
const
|
|
545
|
-
q0 = new Quaternion (0, 0, 0, 1),
|
|
546
|
-
q1 = new Quaternion (0, 0, 0, 1),
|
|
547
|
-
q2 = new Quaternion (0, 0, 0, 1),
|
|
548
|
-
q1_i = new Quaternion (0, 0, 0, 1);
|
|
549
|
-
|
|
550
488
|
export default Quaternion;
|
|
@@ -108,7 +108,6 @@ function Rotation4 (x, y, z, angle)
|
|
|
108
108
|
Rotation4 .prototype =
|
|
109
109
|
{
|
|
110
110
|
constructor: Rotation4,
|
|
111
|
-
length: 4,
|
|
112
111
|
[Symbol .iterator]: function* ()
|
|
113
112
|
{
|
|
114
113
|
yield this [_x];
|
|
@@ -379,7 +378,6 @@ const x = {
|
|
|
379
378
|
this .set (x, this [_y], this [_z], this [_angle]);
|
|
380
379
|
},
|
|
381
380
|
enumerable: true,
|
|
382
|
-
configurable: false
|
|
383
381
|
};
|
|
384
382
|
|
|
385
383
|
const y = {
|
|
@@ -393,7 +391,6 @@ const y = {
|
|
|
393
391
|
this .set (this [_x], y, this [_z], this [_angle]);
|
|
394
392
|
},
|
|
395
393
|
enumerable: true,
|
|
396
|
-
configurable: false
|
|
397
394
|
};
|
|
398
395
|
|
|
399
396
|
const z = {
|
|
@@ -407,7 +404,6 @@ const z = {
|
|
|
407
404
|
this .set (this [_x], this [_y], z, this [_angle]);
|
|
408
405
|
},
|
|
409
406
|
enumerable: true,
|
|
410
|
-
configurable: false
|
|
411
407
|
};
|
|
412
408
|
|
|
413
409
|
const angle = {
|
|
@@ -421,56 +417,33 @@ const angle = {
|
|
|
421
417
|
this .set (this [_x], this [_y], this [_z], angle);
|
|
422
418
|
},
|
|
423
419
|
enumerable: true,
|
|
424
|
-
configurable: false
|
|
425
420
|
};
|
|
426
421
|
|
|
427
|
-
Object .
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
422
|
+
Object .defineProperties (Rotation4 .prototype,
|
|
423
|
+
{
|
|
424
|
+
length: { value: 4 },
|
|
425
|
+
x: x,
|
|
426
|
+
y: y,
|
|
427
|
+
z: z,
|
|
428
|
+
angle: angle,
|
|
429
|
+
});
|
|
431
430
|
|
|
432
431
|
x .enumerable = false;
|
|
433
432
|
y .enumerable = false;
|
|
434
433
|
z .enumerable = false;
|
|
435
434
|
angle .enumerable = false;
|
|
436
435
|
|
|
437
|
-
Object .
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
436
|
+
Object .defineProperties (Rotation4 .prototype,
|
|
437
|
+
{
|
|
438
|
+
0: x,
|
|
439
|
+
1: y,
|
|
440
|
+
2: z,
|
|
441
|
+
3: angle,
|
|
442
|
+
});
|
|
441
443
|
|
|
442
444
|
Object .assign (Rotation4,
|
|
443
445
|
{
|
|
444
446
|
Identity: new Rotation4 (),
|
|
445
|
-
inverse: function (rotation)
|
|
446
|
-
{
|
|
447
|
-
return rotation .copy () .inverse ();
|
|
448
|
-
},
|
|
449
|
-
multRight: function (lhs, rhs)
|
|
450
|
-
{
|
|
451
|
-
return lhs .copy () .multRight (rhs);
|
|
452
|
-
},
|
|
453
|
-
normalize: function (rotation)
|
|
454
|
-
{
|
|
455
|
-
return rotation .copy () .normalize ();
|
|
456
|
-
},
|
|
457
|
-
slerp: function (source, destination, t)
|
|
458
|
-
{
|
|
459
|
-
return source .copy () .slerp (destination, t);
|
|
460
|
-
},
|
|
461
|
-
squad: function (source, a, b, destination, t)
|
|
462
|
-
{
|
|
463
|
-
return source .copy () .squad (a, b, destination, t);
|
|
464
|
-
},
|
|
465
|
-
/*
|
|
466
|
-
bezier: function (source, a, b, destination, t)
|
|
467
|
-
{
|
|
468
|
-
const copy = Object .create (this .prototype);
|
|
469
|
-
copy [_quaternion] = Quaternion .bezier (source [_quaternion], a, b, destination [_quaternion], t);
|
|
470
|
-
copy .update ();
|
|
471
|
-
return copy;
|
|
472
|
-
},
|
|
473
|
-
*/
|
|
474
447
|
spline: function (r0, r1, r2)
|
|
475
448
|
{
|
|
476
449
|
const copy = Object .create (this .prototype);
|