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
|
@@ -324,57 +324,50 @@ function (TextureBuffer,
|
|
|
324
324
|
{
|
|
325
325
|
/// Returns the distance to the closest object in @a direction. The maximum determinable value is avatarHeight * 2.
|
|
326
326
|
|
|
327
|
-
|
|
328
|
-
{
|
|
329
|
-
const t0 = performance .now ();
|
|
327
|
+
const t0 = performance .now ();
|
|
330
328
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
329
|
+
const
|
|
330
|
+
viewpoint = this .getViewpoint (),
|
|
331
|
+
navigationInfo = this .getNavigationInfo (),
|
|
332
|
+
collisionRadius = navigationInfo .getCollisionRadius (),
|
|
333
|
+
bottom = navigationInfo .getStepHeight () - navigationInfo .getAvatarHeight (),
|
|
334
|
+
nearValue = navigationInfo .getNearValue (),
|
|
335
|
+
avatarHeight = navigationInfo .getAvatarHeight ();
|
|
338
336
|
|
|
339
|
-
|
|
337
|
+
// Determine width and height of camera
|
|
340
338
|
|
|
341
|
-
|
|
339
|
+
// Reshape camera
|
|
342
340
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
341
|
+
Camera .ortho (-collisionRadius,
|
|
342
|
+
collisionRadius,
|
|
343
|
+
Math .min (bottom, -collisionRadius), /// TODO: bottom could be a positive value if stepHeight > avatarHeight.
|
|
344
|
+
collisionRadius,
|
|
345
|
+
nearValue,
|
|
346
|
+
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
347
|
+
projectionMatrix);
|
|
350
348
|
|
|
351
|
-
|
|
349
|
+
// Translate camera to user position and to look in the direction of the direction.
|
|
352
350
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
351
|
+
localOrientation .assign (viewpoint ._orientation .getValue ()) .inverse () .multRight (viewpoint .getOrientation ());
|
|
352
|
+
rotation .setFromToVec (Vector3 .zAxis, vector .assign (direction) .negate ()) .multRight (localOrientation);
|
|
353
|
+
viewpoint .straightenHorizon (rotation);
|
|
356
354
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
355
|
+
cameraSpaceProjectionMatrix .assign (viewpoint .getModelMatrix ());
|
|
356
|
+
cameraSpaceProjectionMatrix .translate (viewpoint .getUserPosition ());
|
|
357
|
+
cameraSpaceProjectionMatrix .rotate (rotation);
|
|
358
|
+
cameraSpaceProjectionMatrix .inverse ();
|
|
361
359
|
|
|
362
|
-
|
|
363
|
-
|
|
360
|
+
cameraSpaceProjectionMatrix .multRight (projectionMatrix);
|
|
361
|
+
cameraSpaceProjectionMatrix .multLeft (viewpoint .getCameraSpaceMatrix ());
|
|
364
362
|
|
|
365
|
-
|
|
363
|
+
this .getProjectionMatrix () .pushMatrix (cameraSpaceProjectionMatrix);
|
|
366
364
|
|
|
367
|
-
|
|
365
|
+
const depth = this .getDepth (projectionMatrix);
|
|
368
366
|
|
|
369
|
-
|
|
367
|
+
this .getProjectionMatrix () .pop ();
|
|
370
368
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
374
|
-
catch (error)
|
|
375
|
-
{
|
|
376
|
-
console .error (error);
|
|
377
|
-
}
|
|
369
|
+
this .collisionTime += performance .now () - t0;
|
|
370
|
+
return -depth;
|
|
378
371
|
};
|
|
379
372
|
})(),
|
|
380
373
|
getDepth: (function ()
|
|
@@ -613,28 +606,21 @@ function (TextureBuffer,
|
|
|
613
606
|
|
|
614
607
|
for (let i = 0, length = this .numCollisionShapes; i < length; ++ i)
|
|
615
608
|
{
|
|
616
|
-
|
|
609
|
+
const
|
|
610
|
+
context = this .collisionShapes [i],
|
|
611
|
+
collisions = context .collisions;
|
|
612
|
+
|
|
613
|
+
if (collisions .length)
|
|
617
614
|
{
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
collisions = context .collisions;
|
|
615
|
+
collisionBox .set (collisionSize, Vector3 .Zero);
|
|
616
|
+
collisionBox .multRight (invModelViewMatrix .assign (context .modelViewMatrix) .inverse ());
|
|
621
617
|
|
|
622
|
-
if (
|
|
618
|
+
if (context .shapeNode .intersectsBox (collisionBox, context .clipPlanes, modelViewMatrix .assign (context .modelViewMatrix)))
|
|
623
619
|
{
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
if (context .shapeNode .intersectsBox (collisionBox, context .clipPlanes, modelViewMatrix .assign (context .modelViewMatrix)))
|
|
628
|
-
{
|
|
629
|
-
for (const collision of collisions)
|
|
630
|
-
activeCollisions .add (collision);
|
|
631
|
-
}
|
|
620
|
+
for (const collision of collisions)
|
|
621
|
+
activeCollisions .add (collision);
|
|
632
622
|
}
|
|
633
623
|
}
|
|
634
|
-
catch (error)
|
|
635
|
-
{
|
|
636
|
-
console .error (error);
|
|
637
|
-
}
|
|
638
624
|
}
|
|
639
625
|
|
|
640
626
|
// Set isActive to FALSE for affected nodes.
|
|
@@ -667,122 +653,115 @@ function (TextureBuffer,
|
|
|
667
653
|
|
|
668
654
|
return function ()
|
|
669
655
|
{
|
|
670
|
-
|
|
656
|
+
const
|
|
657
|
+
browser = this .getBrowser (),
|
|
658
|
+
shaderNode = browser .getDepthShader ();
|
|
659
|
+
|
|
660
|
+
if (shaderNode .isValid ())
|
|
671
661
|
{
|
|
672
|
-
|
|
673
|
-
browser = this .getBrowser (),
|
|
674
|
-
shaderNode = browser .getDepthShader ();
|
|
662
|
+
// Terrain following and gravitation
|
|
675
663
|
|
|
676
|
-
if (
|
|
664
|
+
if (browser .getActiveLayer () === this)
|
|
677
665
|
{
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
if (browser .getActiveLayer () === this)
|
|
681
|
-
{
|
|
682
|
-
if (browser .getCurrentViewer () !== "WALK")
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
else if (this .getNavigationInfo () .getViewer () !== "WALK")
|
|
666
|
+
if (browser .getCurrentViewer () !== "WALK")
|
|
686
667
|
return;
|
|
668
|
+
}
|
|
669
|
+
else if (this .getNavigationInfo () .getViewer () !== "WALK")
|
|
670
|
+
return;
|
|
687
671
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
navigationInfo = this .getNavigationInfo (),
|
|
692
|
-
viewpoint = this .getViewpoint (),
|
|
693
|
-
collisionRadius = navigationInfo .getCollisionRadius (),
|
|
694
|
-
nearValue = navigationInfo .getNearValue (),
|
|
695
|
-
avatarHeight = navigationInfo .getAvatarHeight (),
|
|
696
|
-
stepHeight = navigationInfo .getStepHeight ();
|
|
672
|
+
// Get NavigationInfo values
|
|
697
673
|
|
|
698
|
-
|
|
674
|
+
const
|
|
675
|
+
navigationInfo = this .getNavigationInfo (),
|
|
676
|
+
viewpoint = this .getViewpoint (),
|
|
677
|
+
collisionRadius = navigationInfo .getCollisionRadius (),
|
|
678
|
+
nearValue = navigationInfo .getNearValue (),
|
|
679
|
+
avatarHeight = navigationInfo .getAvatarHeight (),
|
|
680
|
+
stepHeight = navigationInfo .getStepHeight ();
|
|
699
681
|
|
|
700
|
-
|
|
701
|
-
collisionRadius,
|
|
702
|
-
-collisionRadius,
|
|
703
|
-
collisionRadius,
|
|
704
|
-
nearValue,
|
|
705
|
-
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
706
|
-
projectionMatrix);
|
|
682
|
+
// Reshape viewpoint for gravite.
|
|
707
683
|
|
|
708
|
-
|
|
684
|
+
Camera .ortho (-collisionRadius,
|
|
685
|
+
collisionRadius,
|
|
686
|
+
-collisionRadius,
|
|
687
|
+
collisionRadius,
|
|
688
|
+
nearValue,
|
|
689
|
+
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
690
|
+
projectionMatrix);
|
|
709
691
|
|
|
710
|
-
|
|
711
|
-
upVector = viewpoint .getUpVector (),
|
|
712
|
-
down = rotation .setFromToVec (Vector3 .zAxis, upVector);
|
|
692
|
+
// Transform viewpoint to look down the up vector
|
|
713
693
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
cameraSpaceProjectionMatrix .inverse ();
|
|
694
|
+
const
|
|
695
|
+
upVector = viewpoint .getUpVector (),
|
|
696
|
+
down = rotation .setFromToVec (Vector3 .zAxis, upVector);
|
|
718
697
|
|
|
719
|
-
|
|
720
|
-
|
|
698
|
+
cameraSpaceProjectionMatrix .assign (viewpoint .getModelMatrix ());
|
|
699
|
+
cameraSpaceProjectionMatrix .translate (viewpoint .getUserPosition ());
|
|
700
|
+
cameraSpaceProjectionMatrix .rotate (down);
|
|
701
|
+
cameraSpaceProjectionMatrix .inverse ();
|
|
721
702
|
|
|
722
|
-
|
|
703
|
+
cameraSpaceProjectionMatrix .multRight (projectionMatrix);
|
|
704
|
+
cameraSpaceProjectionMatrix .multLeft (viewpoint .getCameraSpaceMatrix ());
|
|
723
705
|
|
|
724
|
-
|
|
706
|
+
this .getProjectionMatrix () .pushMatrix (cameraSpaceProjectionMatrix);
|
|
725
707
|
|
|
726
|
-
|
|
708
|
+
let distance = -this .getDepth (projectionMatrix);
|
|
727
709
|
|
|
728
|
-
|
|
710
|
+
this .getProjectionMatrix () .pop ();
|
|
729
711
|
|
|
730
|
-
|
|
712
|
+
// Gravite or step up
|
|
731
713
|
|
|
732
|
-
|
|
714
|
+
distance -= avatarHeight;
|
|
733
715
|
|
|
734
|
-
|
|
735
|
-
{
|
|
736
|
-
// Gravite and fall down the to the floor
|
|
716
|
+
const up = rotation .setFromToVec (Vector3 .yAxis, upVector);
|
|
737
717
|
|
|
738
|
-
|
|
718
|
+
if (distance > 0)
|
|
719
|
+
{
|
|
720
|
+
// Gravite and fall down the to the floor
|
|
739
721
|
|
|
740
|
-
|
|
722
|
+
const currentFrameRate = this .speed ? browser .getCurrentFrameRate () : 1000000;
|
|
741
723
|
|
|
742
|
-
|
|
724
|
+
this .speed -= browser .getBrowserOptions () ._Gravity .getValue () / currentFrameRate;
|
|
743
725
|
|
|
744
|
-
|
|
745
|
-
{
|
|
746
|
-
// The ground is reached.
|
|
747
|
-
y = -distance;
|
|
748
|
-
this .speed = 0;
|
|
749
|
-
}
|
|
726
|
+
let y = this .speed / currentFrameRate;
|
|
750
727
|
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
else
|
|
728
|
+
if (y < -distance)
|
|
754
729
|
{
|
|
730
|
+
// The ground is reached.
|
|
731
|
+
y = -distance;
|
|
755
732
|
this .speed = 0;
|
|
733
|
+
}
|
|
756
734
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
735
|
+
viewpoint ._positionOffset = viewpoint ._positionOffset .getValue () .add (up .multVecRot (translation .set (0, y, 0)));
|
|
736
|
+
}
|
|
737
|
+
else
|
|
738
|
+
{
|
|
739
|
+
this .speed = 0;
|
|
740
|
+
|
|
741
|
+
distance = -distance;
|
|
742
|
+
|
|
743
|
+
if (distance > 0.01 && distance < stepHeight)
|
|
744
|
+
{
|
|
745
|
+
// Step up
|
|
746
|
+
this .constrainTranslation (up .multVecRot (translation .set (0, distance, 0)), false);
|
|
747
|
+
|
|
748
|
+
//if (getBrowser () -> getBrowserOptions () -> animateStairWalks ())
|
|
749
|
+
//{
|
|
750
|
+
// float step = getBrowser () -> getCurrentSpeed () / getBrowser () -> getCurrentFrameRate ();
|
|
751
|
+
// step = abs (getViewMatrix () .mult_matrix_dir (Vector3f (0, step, 0) * up));
|
|
752
|
+
//
|
|
753
|
+
// Vector3f offset = Vector3f (0, step, 0) * up;
|
|
754
|
+
//
|
|
755
|
+
// if (math::abs (offset) > math::abs (translation) or getBrowser () -> getCurrentSpeed () == 0)
|
|
756
|
+
// offset = translation;
|
|
757
|
+
//
|
|
758
|
+
// getViewpoint () -> positionOffset () += offset;
|
|
759
|
+
//}
|
|
760
|
+
//else
|
|
761
|
+
viewpoint ._positionOffset = translation .add (viewpoint ._positionOffset .getValue ());
|
|
779
762
|
}
|
|
780
763
|
}
|
|
781
764
|
}
|
|
782
|
-
catch (error)
|
|
783
|
-
{
|
|
784
|
-
console .error (error);
|
|
785
|
-
}
|
|
786
765
|
};
|
|
787
766
|
})(),
|
|
788
767
|
depth: (function ()
|
|
@@ -799,7 +778,7 @@ function (TextureBuffer,
|
|
|
799
778
|
|
|
800
779
|
// Configure depth shader.
|
|
801
780
|
|
|
802
|
-
if (shaderNode .
|
|
781
|
+
if (shaderNode .isValid ())
|
|
803
782
|
{
|
|
804
783
|
shaderNode .enable (gl);
|
|
805
784
|
|
package/src/x_ite/X3D.js
CHANGED
|
@@ -126,35 +126,43 @@ function ($,
|
|
|
126
126
|
|
|
127
127
|
function createBrowser (url, parameter)
|
|
128
128
|
{
|
|
129
|
-
const element = $("<
|
|
129
|
+
const element = $("<x3d-canvas></x3d-canvas>");
|
|
130
130
|
|
|
131
131
|
if (url instanceof Fields .MFString)
|
|
132
132
|
element .attr ("url", url .toString ())
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return element [0];
|
|
134
|
+
return element .get (0);
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
function getBrowser (
|
|
137
|
+
function getBrowser (element)
|
|
140
138
|
{
|
|
141
|
-
return $(
|
|
139
|
+
return $(element || "x3d-canvas, X3DCanvas") .data ("browser");
|
|
142
140
|
}
|
|
143
141
|
|
|
144
|
-
function createBrowserFromElement (
|
|
142
|
+
function createBrowserFromElement (element)
|
|
145
143
|
{
|
|
146
|
-
|
|
144
|
+
try
|
|
145
|
+
{
|
|
146
|
+
element = $(element);
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
if (element .find (".x_ite-private-browser") .length)
|
|
149
|
+
return;
|
|
150
|
+
|
|
151
|
+
const browser = new X3DBrowser (element);
|
|
150
152
|
|
|
151
|
-
|
|
153
|
+
element .data ("browser", browser);
|
|
152
154
|
|
|
153
|
-
|
|
155
|
+
browser .setup ();
|
|
154
156
|
|
|
155
|
-
|
|
157
|
+
setTimeout (function () { callbacks .resolve (); }, 1);
|
|
156
158
|
|
|
157
|
-
|
|
159
|
+
return browser;
|
|
160
|
+
}
|
|
161
|
+
catch (error)
|
|
162
|
+
{
|
|
163
|
+
Fallback .show ($("x3d-canvas, X3DCanvas"), error);
|
|
164
|
+
fallbacks .resolve (error);
|
|
165
|
+
}
|
|
158
166
|
}
|
|
159
167
|
|
|
160
168
|
const
|
|
@@ -180,18 +188,10 @@ function ($,
|
|
|
180
188
|
{
|
|
181
189
|
const elements = $("X3DCanvas");
|
|
182
190
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
$.map (elements, createBrowserFromElement);
|
|
188
|
-
callbacks .resolve ();
|
|
189
|
-
}
|
|
190
|
-
catch (error)
|
|
191
|
-
{
|
|
192
|
-
Fallback .show (elements, error);
|
|
193
|
-
fallbacks .resolve (error);
|
|
194
|
-
}
|
|
191
|
+
if (elements .length)
|
|
192
|
+
console .warn ("Use of <X3DCanvas> element is depreciated, please use <x3d-canvas> element instead.");
|
|
193
|
+
|
|
194
|
+
$.map (elements, createBrowserFromElement);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -199,11 +199,17 @@ function ($,
|
|
|
199
199
|
|
|
200
200
|
Object .assign (X3D,
|
|
201
201
|
{
|
|
202
|
+
hidden: [
|
|
203
|
+
"hidden",
|
|
204
|
+
"createBrowserFromElement",
|
|
205
|
+
],
|
|
206
|
+
|
|
202
207
|
require: require,
|
|
203
208
|
define: define,
|
|
204
209
|
|
|
205
210
|
getBrowser: getBrowser,
|
|
206
211
|
createBrowser: createBrowser,
|
|
212
|
+
createBrowserFromElement: createBrowserFromElement,
|
|
207
213
|
|
|
208
214
|
X3DConstants: X3DConstants,
|
|
209
215
|
X3DBrowser: X3DBrowser,
|
package/src/x_ite.config.js
CHANGED
|
@@ -36,11 +36,6 @@ require .config ({
|
|
|
36
36
|
"location": "../node_modules/opentype.js",
|
|
37
37
|
"main": "dist/opentype.js"
|
|
38
38
|
},
|
|
39
|
-
{
|
|
40
|
-
"name": "contextMenu",
|
|
41
|
-
"location": "../node_modules/jquery-contextmenu",
|
|
42
|
-
"main": "dist/jquery.contextMenu.js"
|
|
43
|
-
},
|
|
44
39
|
{
|
|
45
40
|
"name": "nurbs",
|
|
46
41
|
"location": "lib/nurbs",
|