x_ite 5.0.2 → 6.0.0
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/settings.json +12 -5
- package/.vscode/tasks.json +21 -0
- package/Makefile +10 -15
- package/README.md +6 -11
- package/build/bin/dist.pl +0 -6
- package/build/bin/version.pl +1 -4
- package/dist/assets/components/annotation.js +2 -2
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +2 -2
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +6 -19
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +2 -2
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +3 -3
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +4 -4
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +32 -1685
- package/dist/assets/components/geospatial.min.js +1 -1
- package/dist/assets/components/h-anim.js +70 -77
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +3 -3
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +38 -52
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +277 -194
- package/dist/assets/components/nurbs.min.js +1 -1
- package/dist/assets/components/particle-systems.js +1918 -1658
- package/dist/assets/components/particle-systems.min.js +1 -1
- package/dist/assets/components/picking.js +33 -41
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +72 -86
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +36 -57
- package/dist/assets/components/rigid-body-physics.min.js +1 -1
- package/dist/assets/components/scripting.js +2 -2
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +26 -75
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +10 -10
- package/dist/assets/components/volume-rendering.min.js +1 -1
- package/dist/assets/components/x_ite.js +2 -2
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Line.fs +0 -21
- package/dist/assets/shaders/webgl1/Line.vs +0 -10
- package/dist/assets/shaders/webgl1/PBR.vs +1 -1
- package/dist/assets/shaders/webgl2/Depth.vs +29 -1
- package/dist/assets/shaders/webgl2/Gouraud.vs +31 -3
- package/dist/assets/shaders/webgl2/Line.fs +24 -12
- package/dist/assets/shaders/webgl2/Line.vs +36 -11
- package/dist/assets/shaders/webgl2/LineTransform.fs +4 -0
- package/dist/assets/shaders/webgl2/LineTransform.vs +57 -0
- package/dist/assets/shaders/webgl2/PBR.vs +35 -7
- package/dist/assets/shaders/webgl2/Phong.vs +31 -3
- package/dist/assets/shaders/webgl2/Point.vs +29 -1
- package/dist/assets/shaders/webgl2/Unlit.vs +31 -3
- package/dist/example.html +6 -6
- package/dist/x_ite.css +180 -208
- package/dist/x_ite.js +16477 -16629
- package/dist/x_ite.min.js +17 -17
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +6 -0
- package/docs/Accessing-the-External-Browser.md +20 -14
- package/docs/Browser-Support.md +6 -0
- package/docs/Custom-Shaders.md +17 -24
- package/docs/Features.md +7 -1
- package/docs/Gemfile +44 -0
- package/docs/Gemfile.lock +122 -0
- package/docs/Glossary.md +6 -0
- package/docs/How-To-Configure-Your-Web-Server.md +6 -0
- package/docs/Supported-Nodes.md +9 -1
- package/docs/What's-New.md +31 -0
- package/docs/XHTML-DOM-Integration.md +6 -0
- package/docs/_config.yml +1 -1
- package/docs/assets/css/main.scss +26 -0
- package/docs/index.md +38 -46
- package/docs/reference/Browser-Services.md +9 -3
- package/docs/reference/Constants-Services.md +6 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +6 -0
- package/docs/reference/Field-Services-and-Objects.md +6 -0
- package/docs/reference/Prototype-Services.md +6 -0
- package/docs/reference/Route-Services.md +6 -0
- package/docs/reference/Scene-Services.md +8 -2
- package/docs/reference/Script-Node-Authoring-Interface.md +7 -1
- package/docs/tutorials/Adding-backgrounds.md +6 -0
- package/docs/tutorials/Adding-fog.md +6 -0
- package/docs/tutorials/Adding-sound.md +6 -0
- package/docs/tutorials/Animating-transforms.md +6 -0
- package/docs/tutorials/Basic-Nodes.md +6 -0
- package/docs/tutorials/Building-a-X3D-world.md +6 -0
- package/docs/tutorials/Building-elevation-grids.md +6 -0
- package/docs/tutorials/Building-extruded-shapes.md +6 -0
- package/docs/tutorials/Building-primitive-shapes.md +6 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +6 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +6 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +6 -0
- package/docs/tutorials/Controlling-detail.md +6 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +6 -0
- package/docs/tutorials/Controlling-navigation.md +6 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +6 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +6 -0
- package/docs/tutorials/Creating-new-node-types.md +6 -0
- package/docs/tutorials/Grouping-nodes.md +6 -0
- package/docs/tutorials/Hello,-World!.md +6 -0
- package/docs/tutorials/Improving-Performance.md +6 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +6 -0
- package/docs/tutorials/Introducing-X3D.md +6 -0
- package/docs/tutorials/Introducing-animation.md +6 -0
- package/docs/tutorials/Introducing-script-use.md +6 -0
- package/docs/tutorials/Lighting-your-world.md +6 -0
- package/docs/tutorials/Mapping-textures.md +6 -0
- package/docs/tutorials/Naming-nodes.md +6 -0
- package/docs/tutorials/Providing-information-about-your-world.md +6 -0
- package/docs/tutorials/Sensing-the-viewer.md +6 -0
- package/docs/tutorials/Sensing-viewer-actions.md +6 -0
- package/docs/tutorials/Transforming-Shapes.md +6 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +6 -0
- package/docs/tutorials/index.md +6 -0
- package/package.json +6 -7
- package/src/assets/components/geometry2d.js +1 -1
- package/src/assets/components/key-device-sensor.js +1 -1
- package/src/assets/components/layout.js +1 -1
- package/src/assets/components/particle-systems.js +1 -1
- package/src/assets/components/volume-rendering.js +1 -1
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +1 -9
- package/src/assets/shaders/webgl1/Line.fs +3 -28
- package/src/assets/shaders/webgl1/Line.vs +5 -19
- package/src/assets/shaders/webgl1/PBR.vs +1 -1
- package/src/assets/shaders/webgl1/Point.vs +2 -3
- package/src/assets/shaders/webgl2/Depth.vs +4 -1
- package/src/assets/shaders/webgl2/Gouraud.vs +5 -3
- package/src/assets/shaders/webgl2/Line.fs +11 -17
- package/src/assets/shaders/webgl2/Line.vs +16 -20
- package/src/assets/shaders/webgl2/LineTransform.fs +6 -0
- package/src/assets/shaders/webgl2/LineTransform.vs +77 -0
- package/src/assets/shaders/webgl2/PBR.vs +10 -7
- package/src/assets/shaders/webgl2/Phong.vs +6 -3
- package/src/assets/shaders/webgl2/Point.vs +6 -6
- package/src/assets/shaders/webgl2/Unlit.vs +6 -3
- package/src/assets/shaders/webgl2/include/Line2.glsl +20 -0
- package/src/assets/shaders/webgl2/include/Particle.glsl +36 -0
- package/src/example.html +6 -6
- package/src/standard/Math/Algorithm.js +12 -28
- package/src/standard/Math/Geometry/Plane3.js +0 -2
- package/src/standard/Math/Geometry/ViewVolume.js +88 -83
- package/src/standard/Math/Numbers/Color3.js +6 -0
- package/src/standard/Math/Numbers/Color4.js +7 -0
- package/src/standard/Math/Numbers/Complex.js +5 -0
- package/src/standard/Math/Numbers/Matrix2.js +20 -2
- package/src/standard/Math/Numbers/Matrix3.js +129 -110
- package/src/standard/Math/Numbers/Matrix4.js +138 -119
- package/src/standard/Math/Numbers/Quaternion.js +7 -0
- package/src/standard/Math/Numbers/Rotation4.js +7 -0
- package/src/standard/Math/Numbers/Vector2.js +8 -5
- package/src/standard/Math/Numbers/Vector3.js +16 -10
- package/src/standard/Math/Numbers/Vector4.js +12 -7
- package/src/standard/Math/Utility/BVH.js +45 -17
- package/src/tests.js +6 -1
- package/src/x_ite/Base/X3DBaseNode.js +22 -11
- package/src/x_ite/Base/X3DField.js +1 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +2 -2
- package/src/x_ite/Browser/Core/BrowserTimings.js +4 -2
- package/src/x_ite/Browser/Core/Context.js +185 -0
- package/src/x_ite/Browser/Core/ContextMenu.js +299 -193
- package/src/x_ite/Browser/Core/Notification.js +1 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +35 -146
- package/src/x_ite/Browser/Layout/ScreenText.js +11 -4
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +4 -15
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +12 -19
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +14 -7
- package/src/x_ite/Browser/Navigation/X3DViewer.js +12 -20
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +11 -7
- package/src/x_ite/Browser/ParticleSystems/BVH.glsl +183 -0
- package/src/x_ite/Browser/ParticleSystems/Box3.glsl +47 -0
- package/src/x_ite/Browser/ParticleSystems/GeometryTypes.js +66 -0
- package/src/x_ite/Browser/ParticleSystems/Line3.glsl +55 -0
- package/src/x_ite/Browser/ParticleSystems/Plane3.glsl +160 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +27 -3
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +37 -37
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +19 -13
- package/src/x_ite/Browser/Shaders/Shader.js +33 -12
- package/src/x_ite/Browser/Shaders/ShaderSource.js +6 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +16 -10
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +50 -9
- package/src/x_ite/Browser/Text/X3DTextContext.js +4 -13
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +23 -33
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +2 -2
- package/src/x_ite/Browser/Time/X3DTimeContext.js +3 -1
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +7 -6
- package/src/x_ite/Browser/X3DBrowserContext.js +35 -10
- package/src/x_ite/Components/Core/X3DNode.js +4 -0
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +0 -2
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +3 -4
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +1 -12
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +0 -1
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +1 -1
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +76 -77
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +2 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +51 -65
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +1 -1
- package/src/x_ite/Components/Followers/X3DChaserNode.js +18 -32
- package/src/x_ite/Components/Followers/X3DDamperNode.js +1 -6
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +1 -1
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +12 -4
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +4 -4
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +10 -27
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +5 -10
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +9 -16
- package/src/x_ite/Components/Geospatial/GeoTransform.js +6 -18
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +20 -27
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +8 -8
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +0 -4
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +68 -75
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +4 -11
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +1 -1
- package/src/x_ite/Components/Layout/LayoutGroup.js +4 -9
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +1 -1
- package/src/x_ite/Components/Layout/ScreenGroup.js +18 -23
- package/src/x_ite/Components/Lighting/DirectionalLight.js +28 -36
- package/src/x_ite/Components/Lighting/PointLight.js +32 -47
- package/src/x_ite/Components/Lighting/SpotLight.js +33 -48
- package/src/x_ite/Components/Navigation/Billboard.js +49 -56
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +82 -111
- package/src/x_ite/Components/Networking/Anchor.js +10 -4
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +6 -6
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +44 -36
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +26 -17
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +20 -7
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +461 -876
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +39 -35
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +112 -128
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +105 -112
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +138 -176
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +16 -11
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +807 -217
- package/src/x_ite/Components/Picking/LinePickSensor.js +31 -39
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +90 -107
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +48 -55
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +53 -70
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +8 -15
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +43 -50
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +32 -39
- package/src/x_ite/Components/Rendering/ClipPlane.js +3 -11
- package/src/x_ite/Components/Rendering/Color.js +12 -37
- package/src/x_ite/Components/Rendering/ColorRGBA.js +13 -38
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +12 -4
- package/src/x_ite/Components/Rendering/LineSet.js +21 -13
- package/src/x_ite/Components/Rendering/PointSet.js +21 -13
- package/src/x_ite/Components/Rendering/X3DColorNode.js +13 -0
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +13 -5
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +248 -325
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +305 -134
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +99 -122
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +24 -38
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +10 -17
- package/src/x_ite/Components/Shaders/ComposedShader.js +35 -75
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +5 -15
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +7 -24
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +7 -24
- package/src/x_ite/Components/Shaders/ShaderPart.js +1 -10
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +219 -209
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +1 -1
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +23 -1
- package/src/x_ite/Components/Shape/Appearance.js +12 -0
- package/src/x_ite/Components/Shape/FillProperties.js +12 -1
- package/src/x_ite/Components/Shape/LineProperties.js +33 -1
- package/src/x_ite/Components/Shape/PointProperties.js +23 -1
- package/src/x_ite/Components/Shape/Shape.js +27 -34
- package/src/x_ite/Components/Sound/Sound.js +30 -40
- package/src/x_ite/Components/Text/Text.js +6 -20
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +5 -26
- package/src/x_ite/Components/Texturing/TextureProperties.js +4 -4
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +21 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +5 -4
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +24 -33
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +5 -26
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +5 -26
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +12 -19
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +7 -7
- package/src/x_ite/Components.js +2 -2
- package/src/x_ite/Fallback.js +9 -3
- package/src/x_ite/Fields/SFColor.js +4 -0
- package/src/x_ite/Fields/SFColorRGBA.js +4 -0
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +4 -0
- package/src/x_ite/Fields/SFRotation.js +4 -0
- package/src/x_ite/Fields/SFString.js +4 -0
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +4 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/Rendering/TextureBuffer.js +43 -36
- package/src/x_ite/Rendering/VertexArray.js +101 -0
- package/src/x_ite/Rendering/X3DRenderObject.js +123 -144
- package/src/x_ite/X3D.js +32 -26
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +200 -162
- package/src/x_ite.html +26 -10
- package/src/x_ite.js +42 -0
- package/x_ite.min.html +26 -10
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/spinner.css +0 -67
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
define ([
|
|
51
51
|
"x_ite/Components/Core/X3DBindableNode",
|
|
52
|
+
"x_ite/Rendering/VertexArray",
|
|
52
53
|
"x_ite/Rendering/TraverseType",
|
|
53
54
|
"x_ite/Base/X3DConstants",
|
|
54
55
|
"standard/Math/Geometry/ViewVolume",
|
|
@@ -59,6 +60,7 @@ define ([
|
|
|
59
60
|
"standard/Math/Algorithm",
|
|
60
61
|
],
|
|
61
62
|
function (X3DBindableNode,
|
|
63
|
+
VertexArray,
|
|
62
64
|
TraverseType,
|
|
63
65
|
X3DConstants,
|
|
64
66
|
ViewVolume,
|
|
@@ -174,19 +176,28 @@ function (X3DBindableNode,
|
|
|
174
176
|
{
|
|
175
177
|
X3DBindableNode .prototype .initialize .call (this);
|
|
176
178
|
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
this .
|
|
182
|
-
this .
|
|
183
|
-
this .
|
|
184
|
-
this .
|
|
185
|
-
this .
|
|
186
|
-
this .
|
|
187
|
-
this .
|
|
188
|
-
this .
|
|
189
|
-
this .
|
|
179
|
+
const
|
|
180
|
+
browser = this .getBrowser (),
|
|
181
|
+
gl = browser .getContext ();
|
|
182
|
+
|
|
183
|
+
this .colorBuffer = gl .createBuffer ();
|
|
184
|
+
this .sphereBuffer = gl .createBuffer ();
|
|
185
|
+
this .texCoordBuffer = gl .createBuffer ();
|
|
186
|
+
this .cubeBuffer = gl .createBuffer ();
|
|
187
|
+
this .texCoordBuffers = new Array (browser .getMaxTextures ()) .fill (gl .createBuffer ());
|
|
188
|
+
this .frontBuffer = gl .createBuffer ();
|
|
189
|
+
this .backBuffer = gl .createBuffer ();
|
|
190
|
+
this .leftBuffer = gl .createBuffer ();
|
|
191
|
+
this .rightBuffer = gl .createBuffer ();
|
|
192
|
+
this .topBuffer = gl .createBuffer ();
|
|
193
|
+
this .bottomBuffer = gl .createBuffer ();
|
|
194
|
+
this .sphereArrayObject = new VertexArray ();
|
|
195
|
+
this .frontArrayObject = new VertexArray ();
|
|
196
|
+
this .backArrayObject = new VertexArray ();
|
|
197
|
+
this .leftArrayObject = new VertexArray ();
|
|
198
|
+
this .rightArrayObject = new VertexArray ();
|
|
199
|
+
this .topArrayObject = new VertexArray ();
|
|
200
|
+
this .bottomArrayObject = new VertexArray ();
|
|
190
201
|
|
|
191
202
|
this ._groundAngle .addInterest ("build", this);
|
|
192
203
|
this ._groundColor .addInterest ("build", this);
|
|
@@ -283,7 +294,7 @@ function (X3DBindableNode,
|
|
|
283
294
|
},
|
|
284
295
|
getColor: function (theta, color, angle)
|
|
285
296
|
{
|
|
286
|
-
const index = Algorithm .upperBound (angle, 0, angle .length, theta
|
|
297
|
+
const index = Algorithm .upperBound (angle, 0, angle .length, theta);
|
|
287
298
|
|
|
288
299
|
return color [index];
|
|
289
300
|
},
|
|
@@ -431,12 +442,12 @@ function (X3DBindableNode,
|
|
|
431
442
|
// Transfer colors.
|
|
432
443
|
|
|
433
444
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
434
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (this .colors), gl .
|
|
445
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (this .colors), gl .DYNAMIC_DRAW);
|
|
435
446
|
|
|
436
447
|
// Transfer sphere.
|
|
437
448
|
|
|
438
449
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .sphereBuffer);
|
|
439
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (this .sphere), gl .
|
|
450
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (this .sphere), gl .DYNAMIC_DRAW);
|
|
440
451
|
this .sphereCount = this .sphere .length / 4;
|
|
441
452
|
},
|
|
442
453
|
transferRectangle: function ()
|
|
@@ -446,27 +457,27 @@ function (X3DBindableNode,
|
|
|
446
457
|
// Transfer texCoords.
|
|
447
458
|
|
|
448
459
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .texCoordBuffers [0]);
|
|
449
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (texCoords), gl .
|
|
460
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (texCoords), gl .DYNAMIC_DRAW);
|
|
450
461
|
|
|
451
462
|
// Transfer rectangle.
|
|
452
463
|
|
|
453
464
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .frontBuffer);
|
|
454
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (frontVertices), gl .
|
|
465
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (frontVertices), gl .DYNAMIC_DRAW);
|
|
455
466
|
|
|
456
467
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .backBuffer);
|
|
457
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (backVertices), gl .
|
|
468
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (backVertices), gl .DYNAMIC_DRAW);
|
|
458
469
|
|
|
459
470
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .leftBuffer);
|
|
460
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (leftVertices), gl .
|
|
471
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (leftVertices), gl .DYNAMIC_DRAW);
|
|
461
472
|
|
|
462
473
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .rightBuffer);
|
|
463
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (rightVertices), gl .
|
|
474
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (rightVertices), gl .DYNAMIC_DRAW);
|
|
464
475
|
|
|
465
476
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .topBuffer);
|
|
466
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (topVertices), gl .
|
|
477
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (topVertices), gl .DYNAMIC_DRAW);
|
|
467
478
|
|
|
468
479
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .bottomBuffer);
|
|
469
|
-
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (bottomVertices), gl .
|
|
480
|
+
gl .bufferData (gl .ARRAY_BUFFER, new Float32Array (bottomVertices), gl .DYNAMIC_DRAW);
|
|
470
481
|
},
|
|
471
482
|
traverse: function (type, renderObject)
|
|
472
483
|
{
|
|
@@ -504,48 +515,41 @@ function (X3DBindableNode,
|
|
|
504
515
|
|
|
505
516
|
return function (gl, renderObject, viewport)
|
|
506
517
|
{
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
if (this .hidden)
|
|
510
|
-
return;
|
|
518
|
+
if (this .hidden)
|
|
519
|
+
return;
|
|
511
520
|
|
|
512
|
-
|
|
521
|
+
// Setup context.
|
|
513
522
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
523
|
+
gl .disable (gl .DEPTH_TEST);
|
|
524
|
+
gl .depthMask (false);
|
|
525
|
+
gl .enable (gl .CULL_FACE);
|
|
526
|
+
gl .frontFace (gl .CCW);
|
|
518
527
|
|
|
519
|
-
|
|
528
|
+
// Get background scale.
|
|
520
529
|
|
|
521
|
-
|
|
530
|
+
const farValue = -ViewVolume .unProjectPointMatrix (0, 0, 1, invProjectionMatrix .assign (renderObject .getProjectionMatrix () .get ()) .inverse (), viewport, farVector) .z * 0.8;
|
|
522
531
|
|
|
523
|
-
|
|
532
|
+
// Get projection matrix.
|
|
524
533
|
|
|
525
|
-
|
|
534
|
+
this .projectionMatrixArray .set (renderObject .getProjectionMatrix () .get ());
|
|
526
535
|
|
|
527
|
-
|
|
536
|
+
// Rotate and scale background.
|
|
528
537
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
538
|
+
modelViewMatrix .assign (this .modelMatrix);
|
|
539
|
+
modelViewMatrix .multRight (renderObject .getViewMatrix () .get ());
|
|
540
|
+
modelViewMatrix .get (null, rotation);
|
|
541
|
+
modelViewMatrix .identity ();
|
|
542
|
+
modelViewMatrix .rotate (rotation);
|
|
543
|
+
modelViewMatrix .scale (scale .set (farValue, farValue, farValue));
|
|
535
544
|
|
|
536
|
-
|
|
545
|
+
this .modelViewMatrixArray .set (modelViewMatrix);
|
|
537
546
|
|
|
538
|
-
|
|
547
|
+
// Draw background sphere and texture cube.
|
|
539
548
|
|
|
540
|
-
|
|
549
|
+
this .drawSphere (renderObject);
|
|
541
550
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
catch (error)
|
|
546
|
-
{
|
|
547
|
-
console .error (error);
|
|
548
|
-
}
|
|
551
|
+
if (this .textures)
|
|
552
|
+
this .drawCube (renderObject);
|
|
549
553
|
};
|
|
550
554
|
})(),
|
|
551
555
|
drawSphere: function (renderObject)
|
|
@@ -560,7 +564,7 @@ function (X3DBindableNode,
|
|
|
560
564
|
gl = browser .getContext (),
|
|
561
565
|
shaderNode = browser .getBackgroundSphereShader ();
|
|
562
566
|
|
|
563
|
-
if (shaderNode .
|
|
567
|
+
if (shaderNode .isValid ())
|
|
564
568
|
{
|
|
565
569
|
shaderNode .enable (gl);
|
|
566
570
|
|
|
@@ -570,8 +574,11 @@ function (X3DBindableNode,
|
|
|
570
574
|
|
|
571
575
|
// Enable vertex attribute arrays.
|
|
572
576
|
|
|
573
|
-
|
|
574
|
-
|
|
577
|
+
if (this .sphereArrayObject .enable (gl, shaderNode))
|
|
578
|
+
{
|
|
579
|
+
shaderNode .enableColorAttribute (gl, this .colorBuffer, 0, 0);
|
|
580
|
+
shaderNode .enableVertexAttribute (gl, this .sphereBuffer, 0, 0);
|
|
581
|
+
}
|
|
575
582
|
|
|
576
583
|
// Uniforms
|
|
577
584
|
|
|
@@ -588,10 +595,6 @@ function (X3DBindableNode,
|
|
|
588
595
|
// Draw.
|
|
589
596
|
|
|
590
597
|
gl .drawArrays (gl .TRIANGLES, 0, this .sphereCount);
|
|
591
|
-
|
|
592
|
-
// Disable vertex attribute arrays.
|
|
593
|
-
|
|
594
|
-
shaderNode .disableColorAttribute (gl);
|
|
595
598
|
}
|
|
596
599
|
},
|
|
597
600
|
drawCube: (function ()
|
|
@@ -607,7 +610,7 @@ function (X3DBindableNode,
|
|
|
607
610
|
gl = browser .getContext (),
|
|
608
611
|
shaderNode = browser .getUnlitShader ();
|
|
609
612
|
|
|
610
|
-
if (shaderNode .
|
|
613
|
+
if (shaderNode .isValid ())
|
|
611
614
|
{
|
|
612
615
|
shaderNode .enable (gl);
|
|
613
616
|
|
|
@@ -615,10 +618,6 @@ function (X3DBindableNode,
|
|
|
615
618
|
|
|
616
619
|
shaderNode .setLocalObjects (gl, this .localObjects);
|
|
617
620
|
|
|
618
|
-
// Enable vertex attribute arrays.
|
|
619
|
-
|
|
620
|
-
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
621
|
-
|
|
622
621
|
// Uniforms
|
|
623
622
|
|
|
624
623
|
gl .uniform1i (shaderNode .x3d_FogType, 0);
|
|
@@ -638,20 +637,16 @@ function (X3DBindableNode,
|
|
|
638
637
|
|
|
639
638
|
// Draw.
|
|
640
639
|
|
|
641
|
-
this .drawRectangle (gl, browser, shaderNode, renderObject, this .frontTexture, this .frontBuffer);
|
|
642
|
-
this .drawRectangle (gl, browser, shaderNode, renderObject, this .backTexture, this .backBuffer);
|
|
643
|
-
this .drawRectangle (gl, browser, shaderNode, renderObject, this .leftTexture, this .leftBuffer);
|
|
644
|
-
this .drawRectangle (gl, browser, shaderNode, renderObject, this .rightTexture, this .rightBuffer);
|
|
645
|
-
this .drawRectangle (gl, browser, shaderNode, renderObject, this .topTexture, this .topBuffer);
|
|
646
|
-
this .drawRectangle (gl, browser, shaderNode, renderObject, this .bottomTexture, this .bottomBuffer);
|
|
647
|
-
|
|
648
|
-
// Disable vertex attribute arrays.
|
|
649
|
-
|
|
650
|
-
shaderNode .disableTexCoordAttribute (gl);
|
|
640
|
+
this .drawRectangle (gl, browser, shaderNode, renderObject, this .frontTexture, this .frontBuffer, this .frontArrayObject);
|
|
641
|
+
this .drawRectangle (gl, browser, shaderNode, renderObject, this .backTexture, this .backBuffer, this .backArrayObject);
|
|
642
|
+
this .drawRectangle (gl, browser, shaderNode, renderObject, this .leftTexture, this .leftBuffer, this .leftArrayObject);
|
|
643
|
+
this .drawRectangle (gl, browser, shaderNode, renderObject, this .rightTexture, this .rightBuffer, this .rightArrayObject);
|
|
644
|
+
this .drawRectangle (gl, browser, shaderNode, renderObject, this .topTexture, this .topBuffer, this .topArrayObject);
|
|
645
|
+
this .drawRectangle (gl, browser, shaderNode, renderObject, this .bottomTexture, this .bottomBuffer, this .bottomArrayObject);
|
|
651
646
|
}
|
|
652
647
|
};
|
|
653
648
|
})(),
|
|
654
|
-
drawRectangle: function (gl, browser, shaderNode, renderObject, texture, buffer)
|
|
649
|
+
drawRectangle: function (gl, browser, shaderNode, renderObject, texture, buffer, vertexArray)
|
|
655
650
|
{
|
|
656
651
|
if (texture && (texture .checkLoadState () === X3DConstants .COMPLETE_STATE || texture .getData ()))
|
|
657
652
|
{
|
|
@@ -662,7 +657,11 @@ function (X3DBindableNode,
|
|
|
662
657
|
else
|
|
663
658
|
gl .disable (gl .BLEND);
|
|
664
659
|
|
|
665
|
-
|
|
660
|
+
if (vertexArray .enable (gl, shaderNode))
|
|
661
|
+
{
|
|
662
|
+
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers, 0, 0);
|
|
663
|
+
shaderNode .enableVertexAttribute (gl, buffer, 0, 0);
|
|
664
|
+
}
|
|
666
665
|
|
|
667
666
|
// Draw.
|
|
668
667
|
|
|
@@ -71,15 +71,8 @@ function (X3DConstants,
|
|
|
71
71
|
set: function (fogNode, modelViewMatrix)
|
|
72
72
|
{
|
|
73
73
|
this .fogNode = fogNode;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
this .fogMatrix .set (modelViewMatrix .submatrix .inverse ());
|
|
78
|
-
}
|
|
79
|
-
catch (error)
|
|
80
|
-
{
|
|
81
|
-
this .fogMatrix .set (Matrix3 .Identity);
|
|
82
|
-
}
|
|
74
|
+
|
|
75
|
+
this .fogMatrix .set (modelViewMatrix .submatrix .inverse ());
|
|
83
76
|
},
|
|
84
77
|
setShaderUniforms: function (gl, shaderObject)
|
|
85
78
|
{
|
|
@@ -165,61 +165,54 @@ function (Fields,
|
|
|
165
165
|
|
|
166
166
|
return function ()
|
|
167
167
|
{
|
|
168
|
-
|
|
168
|
+
if (this .inside && this .getTraversed ())
|
|
169
169
|
{
|
|
170
|
-
if (this .
|
|
170
|
+
if (this .viewpointNode)
|
|
171
171
|
{
|
|
172
|
-
|
|
173
|
-
{
|
|
174
|
-
const modelMatrix = this .modelMatrix;
|
|
172
|
+
const modelMatrix = this .modelMatrix;
|
|
175
173
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
centerOfRotationMatrix .assign (this .viewpointNode .getModelMatrix ());
|
|
175
|
+
centerOfRotationMatrix .translate (this .viewpointNode .getUserCenterOfRotation ());
|
|
176
|
+
centerOfRotationMatrix .multRight (invModelMatrix .assign (modelMatrix) .inverse ());
|
|
179
177
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
modelMatrix .multRight (this .viewpointNode .getViewMatrix ());
|
|
179
|
+
modelMatrix .get (null, orientation);
|
|
180
|
+
modelMatrix .inverse ();
|
|
183
181
|
|
|
184
|
-
|
|
182
|
+
position .set (modelMatrix [12], modelMatrix [13], modelMatrix [14]);
|
|
185
183
|
|
|
186
|
-
|
|
184
|
+
orientation .inverse ();
|
|
187
185
|
|
|
188
|
-
|
|
186
|
+
centerOfRotation .set (centerOfRotationMatrix [12], centerOfRotationMatrix [13], centerOfRotationMatrix [14]);
|
|
189
187
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
if (this ._isActive .getValue ())
|
|
189
|
+
{
|
|
190
|
+
if (! this ._position_changed .getValue () .equals (position))
|
|
191
|
+
this ._position_changed = position;
|
|
194
192
|
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
if (! this ._orientation_changed .getValue () .equals (orientation))
|
|
194
|
+
this ._orientation_changed = orientation;
|
|
197
195
|
|
|
198
|
-
|
|
199
|
-
this ._centerOfRotation_changed = centerOfRotation;
|
|
200
|
-
}
|
|
201
|
-
else
|
|
202
|
-
{
|
|
203
|
-
this ._isActive = true;
|
|
204
|
-
this ._enterTime = this .getBrowser () .getCurrentTime ();
|
|
205
|
-
this ._position_changed = position;
|
|
206
|
-
this ._orientation_changed = orientation;
|
|
196
|
+
if (! this ._centerOfRotation_changed .getValue () .equals (centerOfRotation))
|
|
207
197
|
this ._centerOfRotation_changed = centerOfRotation;
|
|
208
|
-
}
|
|
209
198
|
}
|
|
210
|
-
|
|
211
|
-
else
|
|
212
|
-
{
|
|
213
|
-
if (this ._isActive .getValue ())
|
|
199
|
+
else
|
|
214
200
|
{
|
|
215
|
-
this ._isActive
|
|
216
|
-
this .
|
|
201
|
+
this ._isActive = true;
|
|
202
|
+
this ._enterTime = this .getBrowser () .getCurrentTime ();
|
|
203
|
+
this ._position_changed = position;
|
|
204
|
+
this ._orientation_changed = orientation;
|
|
205
|
+
this ._centerOfRotation_changed = centerOfRotation;
|
|
217
206
|
}
|
|
218
207
|
}
|
|
219
208
|
}
|
|
220
|
-
|
|
209
|
+
else
|
|
221
210
|
{
|
|
222
|
-
|
|
211
|
+
if (this ._isActive .getValue ())
|
|
212
|
+
{
|
|
213
|
+
this ._isActive = false;
|
|
214
|
+
this ._exitTime = this .getBrowser () .getCurrentTime ();
|
|
215
|
+
}
|
|
223
216
|
}
|
|
224
217
|
|
|
225
218
|
this .inside = false;
|
|
@@ -236,42 +229,35 @@ function (Fields,
|
|
|
236
229
|
|
|
237
230
|
return function (type, renderObject)
|
|
238
231
|
{
|
|
239
|
-
|
|
232
|
+
switch (type)
|
|
240
233
|
{
|
|
241
|
-
|
|
234
|
+
case TraverseType .CAMERA:
|
|
242
235
|
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
236
|
+
this .viewpointNode = renderObject .getViewpoint ();
|
|
237
|
+
this .modelMatrix .assign (renderObject .getModelViewMatrix () .get ());
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
case TraverseType .DISPLAY:
|
|
241
|
+
{
|
|
242
|
+
this .setTraversed (true);
|
|
243
|
+
|
|
244
|
+
if (this .inside)
|
|
247
245
|
return;
|
|
246
|
+
|
|
247
|
+
if (this ._size .getValue () .equals (infinity))
|
|
248
|
+
{
|
|
249
|
+
this .inside = true;
|
|
248
250
|
}
|
|
249
|
-
|
|
251
|
+
else
|
|
250
252
|
{
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (this .inside)
|
|
254
|
-
return;
|
|
255
|
-
|
|
256
|
-
if (this ._size .getValue () .equals (infinity))
|
|
257
|
-
{
|
|
258
|
-
this .inside = true;
|
|
259
|
-
}
|
|
260
|
-
else
|
|
261
|
-
{
|
|
262
|
-
invModelViewMatrix .assign (renderObject .getModelViewMatrix () .get ()) .inverse ();
|
|
253
|
+
invModelViewMatrix .assign (renderObject .getModelViewMatrix () .get ()) .inverse ();
|
|
263
254
|
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
return;
|
|
255
|
+
this .inside = this .containsPoint (invModelViewMatrix .origin);
|
|
268
256
|
}
|
|
257
|
+
|
|
258
|
+
return;
|
|
269
259
|
}
|
|
270
260
|
}
|
|
271
|
-
catch (error)
|
|
272
|
-
{
|
|
273
|
-
console .error (error);
|
|
274
|
-
}
|
|
275
261
|
};
|
|
276
262
|
})(),
|
|
277
263
|
containsPoint: function (point)
|
|
@@ -170,33 +170,24 @@ function (X3DFollowerNode,
|
|
|
170
170
|
},
|
|
171
171
|
prepareEvents: function ()
|
|
172
172
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
numBuffers = buffer .length,
|
|
178
|
-
fraction = this .updateBuffer ();
|
|
179
|
-
|
|
180
|
-
this .output = this .interpolate (this .previousValue,
|
|
181
|
-
buffer [numBuffers - 1],
|
|
182
|
-
this .stepResponse ((numBuffers - 1 + fraction) * this .stepTime));
|
|
183
|
-
|
|
184
|
-
for (var i = numBuffers - 2; i >= 0; -- i)
|
|
185
|
-
{
|
|
186
|
-
this .step (buffer [i], buffer [i + 1], this .stepResponse ((i + fraction) * this .stepTime));
|
|
187
|
-
}
|
|
173
|
+
var
|
|
174
|
+
buffer = this .getBuffer (),
|
|
175
|
+
numBuffers = buffer .length,
|
|
176
|
+
fraction = this .updateBuffer ();
|
|
188
177
|
|
|
189
|
-
|
|
178
|
+
this .output = this .interpolate (this .previousValue,
|
|
179
|
+
buffer [numBuffers - 1],
|
|
180
|
+
this .stepResponse ((numBuffers - 1 + fraction) * this .stepTime));
|
|
190
181
|
|
|
191
|
-
|
|
192
|
-
this .set_active (false);
|
|
193
|
-
}
|
|
194
|
-
catch (error)
|
|
182
|
+
for (var i = numBuffers - 2; i >= 0; -- i)
|
|
195
183
|
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
//console .error (error);
|
|
184
|
+
this .step (buffer [i], buffer [i + 1], this .stepResponse ((i + fraction) * this .stepTime));
|
|
199
185
|
}
|
|
186
|
+
|
|
187
|
+
this .setValue (this .output);
|
|
188
|
+
|
|
189
|
+
if (this .equals (this .output, this .destination, this .getTolerance ()))
|
|
190
|
+
this .set_active (false);
|
|
200
191
|
},
|
|
201
192
|
updateBuffer: function ()
|
|
202
193
|
{
|
|
@@ -222,15 +213,10 @@ function (X3DFollowerNode,
|
|
|
222
213
|
|
|
223
214
|
for (var i = 0; i < seconds; ++ i)
|
|
224
215
|
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
this .assign (buffer, i, this .interpolate (this .destination, buffer [seconds], alpha))
|
|
230
|
-
}
|
|
231
|
-
catch (error)
|
|
232
|
-
{ }
|
|
233
|
-
}
|
|
216
|
+
var alpha = i / seconds;
|
|
217
|
+
|
|
218
|
+
this .assign (buffer, i, this .interpolate (this .destination, buffer [seconds], alpha))
|
|
219
|
+
}
|
|
234
220
|
}
|
|
235
221
|
else
|
|
236
222
|
{
|
|
@@ -117,12 +117,7 @@ function (X3DFollowerNode,
|
|
|
117
117
|
|
|
118
118
|
for (var i = 0; i < order; ++ i)
|
|
119
119
|
{
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
this .assign (buffer, i + 1, this .interpolate (buffer [i], buffer [i + 1], alpha));
|
|
123
|
-
}
|
|
124
|
-
catch (error)
|
|
125
|
-
{ }
|
|
120
|
+
this .assign (buffer, i + 1, this .interpolate (buffer [i], buffer [i + 1], alpha));
|
|
126
121
|
}
|
|
127
122
|
|
|
128
123
|
this .setValue (buffer [order]);
|
|
@@ -144,7 +144,10 @@ function (Fields,
|
|
|
144
144
|
const attribNodes = this .getAttrib ();
|
|
145
145
|
|
|
146
146
|
for (const attribNode of attribNodes)
|
|
147
|
+
{
|
|
147
148
|
attribNode .removeInterest ("requestRebuild", this);
|
|
149
|
+
attribNode ._attribute_changed .removeInterest ("updateVertexArrays", this);
|
|
150
|
+
}
|
|
148
151
|
|
|
149
152
|
attribNodes .length = 0;
|
|
150
153
|
|
|
@@ -157,7 +160,12 @@ function (Fields,
|
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
for (const attribNode of attribNodes)
|
|
163
|
+
{
|
|
160
164
|
attribNode .addInterest ("requestRebuild", this);
|
|
165
|
+
attribNode ._attribute_changed .addInterest ("updateVertexArrays", this);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
this .updateVertexArrays ();
|
|
161
169
|
},
|
|
162
170
|
set_fogCoord__: function ()
|
|
163
171
|
{
|
|
@@ -350,8 +358,8 @@ function (Fields,
|
|
|
350
358
|
normalPerVertex = this ._normalPerVertex .getValue (),
|
|
351
359
|
coordIndex = this .createCoordIndex (),
|
|
352
360
|
attribNodes = this .getAttrib (),
|
|
353
|
-
|
|
354
|
-
|
|
361
|
+
numAttribNodes = attribNodes .length,
|
|
362
|
+
attribArrays = this .getAttribs (),
|
|
355
363
|
fogCoordNode = this .fogCoordNode,
|
|
356
364
|
colorNode = this .getColor (),
|
|
357
365
|
texCoordNode = this .getTexCoord (),
|
|
@@ -388,8 +396,8 @@ function (Fields,
|
|
|
388
396
|
index = coordIndex [c],
|
|
389
397
|
point = points [index];
|
|
390
398
|
|
|
391
|
-
for (let a = 0; a <
|
|
392
|
-
attribNodes [a] .addValue (index,
|
|
399
|
+
for (let a = 0; a < numAttribNodes; ++ a)
|
|
400
|
+
attribNodes [a] .addValue (index, attribArrays [a]);
|
|
393
401
|
|
|
394
402
|
if (fogCoordNode)
|
|
395
403
|
fogCoordNode .addDepth (index, fogDepthArray);
|
|
@@ -177,8 +177,8 @@ function (Fields,
|
|
|
177
177
|
normalPerVertex = this ._normalPerVertex .getValue (),
|
|
178
178
|
coordIndex = this ._coordIndex .getValue (),
|
|
179
179
|
attribNodes = this .getAttrib (),
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
numAttribNodes = attribNodes .length,
|
|
181
|
+
attribArrays = this .getAttribs (),
|
|
182
182
|
fogCoordNode = this .getFogCoord (),
|
|
183
183
|
colorNode = this .getColor (),
|
|
184
184
|
texCoordNode = this .getTexCoord (),
|
|
@@ -203,8 +203,8 @@ function (Fields,
|
|
|
203
203
|
{
|
|
204
204
|
const index = coordIndex [i];
|
|
205
205
|
|
|
206
|
-
for (let a = 0; a <
|
|
207
|
-
attribNodes [a] .addValue (index,
|
|
206
|
+
for (let a = 0; a < numAttribNodes; ++ a)
|
|
207
|
+
attribNodes [a] .addValue (index, attribArrays [a]);
|
|
208
208
|
|
|
209
209
|
if (fogCoordNode)
|
|
210
210
|
fogCoordNode .addDepth (index, fogDepthArray);
|