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
|
@@ -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,13 +69,11 @@ 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
|
-
return new (this .constructor) (
|
|
76
|
+
return new (this .constructor) (this .getValue () .copy () .cross (vector .getValue ()));
|
|
79
77
|
},
|
|
80
78
|
});
|
|
81
79
|
|
|
@@ -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
|
}
|
|
@@ -45,14 +45,15 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import X3DField
|
|
48
|
+
import X3DField from "../Base/X3DField.js";
|
|
49
49
|
|
|
50
|
-
function SFVecPrototypeTemplate (TypeName, Type,
|
|
50
|
+
function SFVecPrototypeTemplate (Constructor, TypeName, Type, Vector, 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 ();
|
|
@@ -75,7 +76,7 @@ function SFVecPrototypeTemplate (TypeName, Type, ValueType, double)
|
|
|
75
76
|
},
|
|
76
77
|
isDefaultValue: function ()
|
|
77
78
|
{
|
|
78
|
-
return this .getValue () .equals (
|
|
79
|
+
return this .getValue () .equals (Vector .Zero);
|
|
79
80
|
},
|
|
80
81
|
set: function (value)
|
|
81
82
|
{
|
|
@@ -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
|
{
|
|
@@ -918,7 +918,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
918
918
|
bbox = new Box2 ();
|
|
919
919
|
|
|
920
920
|
for (const points of contours)
|
|
921
|
-
bbox .add (
|
|
921
|
+
bbox .add (Box2 .Points (... points));
|
|
922
922
|
|
|
923
923
|
this .groupNodes .push (transformNode);
|
|
924
924
|
|
|
@@ -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
|
{
|
|
@@ -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;
|
|
@@ -349,9 +349,9 @@ X3DRenderObject .prototype =
|
|
|
349
349
|
const
|
|
350
350
|
projectionMatrix = new Matrix4 (),
|
|
351
351
|
cameraSpaceProjectionMatrix = new Matrix4 (),
|
|
352
|
-
localOrientation = new Rotation4 (
|
|
352
|
+
localOrientation = new Rotation4 (),
|
|
353
353
|
vector = new Vector3 (0, 0, 0),
|
|
354
|
-
rotation = new Rotation4 (
|
|
354
|
+
rotation = new Rotation4 ();
|
|
355
355
|
|
|
356
356
|
return function (direction)
|
|
357
357
|
{
|
|
@@ -805,7 +805,7 @@ X3DRenderObject .prototype =
|
|
|
805
805
|
projectionMatrix = new Matrix4 (),
|
|
806
806
|
cameraSpaceProjectionMatrix = new Matrix4 (),
|
|
807
807
|
translation = new Vector3 (0, 0, 0),
|
|
808
|
-
rotation = new Rotation4 (
|
|
808
|
+
rotation = new Rotation4 ();
|
|
809
809
|
|
|
810
810
|
return function ()
|
|
811
811
|
{
|
|
@@ -76,6 +76,7 @@ function X3DRoute (executionContext, sourceNode, sourceField, destinationNode, d
|
|
|
76
76
|
|
|
77
77
|
X3DRoute .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
78
78
|
{
|
|
79
|
+
constructor: X3DRoute,
|
|
79
80
|
getTypeName: function ()
|
|
80
81
|
{
|
|
81
82
|
return "X3DRoute";
|
|
@@ -260,40 +261,40 @@ X3DRoute .prototype = Object .assign (Object .create (X3DObject .prototype),
|
|
|
260
261
|
for (const key of Reflect .ownKeys (X3DRoute .prototype))
|
|
261
262
|
Object .defineProperty (X3DRoute .prototype, key, { enumerable: false });
|
|
262
263
|
|
|
263
|
-
Object .
|
|
264
|
+
Object .defineProperties (X3DRoute .prototype,
|
|
264
265
|
{
|
|
265
|
-
|
|
266
|
+
sourceNode:
|
|
266
267
|
{
|
|
267
|
-
|
|
268
|
+
get: function ()
|
|
269
|
+
{
|
|
270
|
+
return SFNodeCache .get (this [_sourceNode]);
|
|
271
|
+
},
|
|
272
|
+
enumerable: true,
|
|
268
273
|
},
|
|
269
|
-
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
Object .defineProperty (X3DRoute .prototype, "sourceField",
|
|
273
|
-
{
|
|
274
|
-
get: function ()
|
|
274
|
+
sourceField:
|
|
275
275
|
{
|
|
276
|
-
|
|
276
|
+
get: function ()
|
|
277
|
+
{
|
|
278
|
+
return this [_sourceField] .getName ();
|
|
279
|
+
},
|
|
280
|
+
enumerable: true,
|
|
277
281
|
},
|
|
278
|
-
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
Object .defineProperty (X3DRoute .prototype, "destinationNode",
|
|
282
|
-
{
|
|
283
|
-
get: function ()
|
|
282
|
+
destinationNode:
|
|
284
283
|
{
|
|
285
|
-
|
|
284
|
+
get: function ()
|
|
285
|
+
{
|
|
286
|
+
return SFNodeCache .get (this [_destinationNode]);
|
|
287
|
+
},
|
|
288
|
+
enumerable: true,
|
|
286
289
|
},
|
|
287
|
-
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
Object .defineProperty (X3DRoute .prototype, "destinationField",
|
|
291
|
-
{
|
|
292
|
-
get: function ()
|
|
290
|
+
destinationField:
|
|
293
291
|
{
|
|
294
|
-
|
|
292
|
+
get: function ()
|
|
293
|
+
{
|
|
294
|
+
return this [_destinationField] .getName ();
|
|
295
|
+
},
|
|
296
|
+
enumerable: true,
|
|
295
297
|
},
|
|
296
|
-
enumerable: true,
|
|
297
298
|
});
|
|
298
299
|
|
|
299
300
|
export default X3DRoute;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
$ .fn .isInViewport = function ()
|
|
2
|
-
{
|
|
3
|
-
const
|
|
4
|
-
elementTop = $(this) .offset () .top,
|
|
5
|
-
elementBottom = elementTop + $(this) .outerHeight (),
|
|
6
|
-
viewportTop = $(window) .scrollTop (),
|
|
7
|
-
viewportBottom = viewportTop + $(window) .height ();
|
|
8
|
-
|
|
9
|
-
return elementBottom > viewportTop && elementTop < viewportBottom;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
$(window) .on ("resize scroll load", () =>
|
|
13
|
-
{
|
|
14
|
-
for (const element of $("x3d-canvas"))
|
|
15
|
-
{
|
|
16
|
-
if ($(element) .isInViewport ())
|
|
17
|
-
{
|
|
18
|
-
element .browser .beginUpdate ();
|
|
19
|
-
}
|
|
20
|
-
else
|
|
21
|
-
{
|
|
22
|
-
element .browser .endUpdate ();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|