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
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
define ([
|
|
51
51
|
"jquery",
|
|
52
52
|
"x_ite/Fields",
|
|
53
|
+
"x_ite/Browser/Core/Context",
|
|
53
54
|
"x_ite/Browser/Core/BrowserTimings",
|
|
54
55
|
"x_ite/Browser/Core/BrowserOptions",
|
|
55
56
|
"x_ite/Browser/Core/BrowserProperties",
|
|
@@ -64,6 +65,7 @@ define ([
|
|
|
64
65
|
],
|
|
65
66
|
function ($,
|
|
66
67
|
Fields,
|
|
68
|
+
Context,
|
|
67
69
|
BrowserTimings,
|
|
68
70
|
BrowserOptions,
|
|
69
71
|
BrowserProperties,
|
|
@@ -80,114 +82,14 @@ function ($,
|
|
|
80
82
|
|
|
81
83
|
const WEBGL_LATEST_VERSION = 2;
|
|
82
84
|
|
|
83
|
-
const extensions = [
|
|
84
|
-
"ANGLE_instanced_arrays",
|
|
85
|
-
"EXT_blend_minmax",
|
|
86
|
-
"EXT_frag_depth",
|
|
87
|
-
"EXT_shader_texture_lod",
|
|
88
|
-
"EXT_texture_filter_anisotropic",
|
|
89
|
-
"OES_element_index_uint",
|
|
90
|
-
"OES_standard_derivatives",
|
|
91
|
-
"OES_texture_float",
|
|
92
|
-
"OES_texture_float_linear",
|
|
93
|
-
"OES_texture_half_float",
|
|
94
|
-
"OES_texture_half_float_linear",
|
|
95
|
-
"OES_vertex_array_object",
|
|
96
|
-
"WEBGL_compressed_texture_s3tc",
|
|
97
|
-
"WEBGL_debug_renderer_info",
|
|
98
|
-
"WEBGL_debug_shaders",
|
|
99
|
-
"WEBGL_depth_texture",
|
|
100
|
-
"WEBGL_draw_buffers",
|
|
101
|
-
"WEBGL_lose_context",
|
|
102
|
-
|
|
103
|
-
"EXT_color_buffer_float",
|
|
104
|
-
"EXT_color_buffer_half_float",
|
|
105
|
-
"EXT_disjoint_timer_query",
|
|
106
|
-
"EXT_disjoint_timer_query_webgl2",
|
|
107
|
-
"EXT_sRGB",
|
|
108
|
-
"WEBGL_color_buffer_float",
|
|
109
|
-
"WEBGL_compressed_texture_astc",
|
|
110
|
-
"WEBGL_compressed_texture_atc",
|
|
111
|
-
"WEBGL_compressed_texture_etc",
|
|
112
|
-
"WEBGL_compressed_texture_etc1",
|
|
113
|
-
"WEBGL_compressed_texture_pvrtc",
|
|
114
|
-
"WEBGL_compressed_texture_s3tc",
|
|
115
|
-
"WEBGL_compressed_texture_s3tc_srgb",
|
|
116
|
-
|
|
117
|
-
"EXT_float_blend",
|
|
118
|
-
"OES_fbo_render_mipmap",
|
|
119
|
-
"WEBGL_get_buffer_sub_data_async",
|
|
120
|
-
"WEBGL_multiview",
|
|
121
|
-
"WEBGL_security_sensitive_resources",
|
|
122
|
-
"WEBGL_shared_resources",
|
|
123
|
-
|
|
124
|
-
"EXT_clip_cull_distance",
|
|
125
|
-
"WEBGL_debug",
|
|
126
|
-
"WEBGL_dynamic_texture",
|
|
127
|
-
"WEBGL_subarray_uploads",
|
|
128
|
-
"WEBGL_texture_multisample",
|
|
129
|
-
"WEBGL_texture_source_iframe",
|
|
130
|
-
"WEBGL_video_texture",
|
|
131
|
-
|
|
132
|
-
"EXT_texture_storage",
|
|
133
|
-
"OES_depth24",
|
|
134
|
-
"WEBGL_debug_shader_precision",
|
|
135
|
-
"WEBGL_draw_elements_no_range_check",
|
|
136
|
-
"WEBGL_subscribe_uniform",
|
|
137
|
-
"WEBGL_texture_from_depth_video",
|
|
138
|
-
];
|
|
139
|
-
|
|
140
|
-
function getContext (canvas, version, preserveDrawingBuffer)
|
|
141
|
-
{
|
|
142
|
-
const options = { preserveDrawingBuffer: preserveDrawingBuffer };
|
|
143
|
-
|
|
144
|
-
let gl = null;
|
|
145
|
-
|
|
146
|
-
if (version >= 2 && ! gl)
|
|
147
|
-
{
|
|
148
|
-
gl = canvas .getContext ("webgl2", options);
|
|
149
|
-
|
|
150
|
-
if (gl)
|
|
151
|
-
gl .getVersion = function () { return 2; };
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (version >= 1 && ! gl)
|
|
155
|
-
{
|
|
156
|
-
gl = canvas .getContext ("webgl", options) ||
|
|
157
|
-
canvas .getContext ("experimental-webgl", options);
|
|
158
|
-
|
|
159
|
-
if (gl)
|
|
160
|
-
gl .getVersion = function () { return 1; };
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (! gl)
|
|
164
|
-
throw new Error ("Couldn't create WebGL context.");
|
|
165
|
-
|
|
166
|
-
// Feature detection:
|
|
167
|
-
|
|
168
|
-
// If the aliased lineWidth ranges are both 1, gl.lineWidth is probably not possible,
|
|
169
|
-
// thus we disable it completely to prevent webgl errors.
|
|
170
|
-
|
|
171
|
-
const aliasedLineWidthRange = gl .getParameter (gl .ALIASED_LINE_WIDTH_RANGE);
|
|
172
|
-
|
|
173
|
-
if (aliasedLineWidthRange [0] === 1 && aliasedLineWidthRange [1] === 1)
|
|
174
|
-
{
|
|
175
|
-
gl .lineWidth = Function .prototype;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Return context.
|
|
179
|
-
|
|
180
|
-
return gl;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
85
|
const
|
|
184
86
|
_number = Symbol (),
|
|
185
87
|
_element = Symbol (),
|
|
186
|
-
|
|
88
|
+
_shadow = Symbol (),
|
|
187
89
|
_surface = Symbol (),
|
|
188
90
|
_canvas = Symbol (),
|
|
189
91
|
_context = Symbol (),
|
|
190
|
-
|
|
92
|
+
_splashScreen = Symbol (),
|
|
191
93
|
_localStorage = Symbol (),
|
|
192
94
|
_mobile = Symbol (),
|
|
193
95
|
_browserTimings = Symbol (),
|
|
@@ -199,40 +101,37 @@ function ($,
|
|
|
199
101
|
_observer = Symbol (),
|
|
200
102
|
_privateScene = Symbol (),
|
|
201
103
|
_keydown = Symbol (),
|
|
202
|
-
_keyup = Symbol ()
|
|
104
|
+
_keyup = Symbol (),
|
|
105
|
+
_pixelPerPoint = Symbol ();
|
|
203
106
|
|
|
204
107
|
let browserNumber = 0;
|
|
205
108
|
|
|
206
109
|
function X3DCoreContext (element)
|
|
207
110
|
{
|
|
208
|
-
this [_number] = ++ browserNumber;
|
|
209
|
-
this [_element] = element;
|
|
210
|
-
|
|
211
111
|
// Get canvas & context.
|
|
212
112
|
|
|
213
113
|
const
|
|
214
|
-
|
|
215
|
-
|
|
114
|
+
shadow = $(element .prop ("shadowRoot")),
|
|
115
|
+
browser = $("<div></div>") .addClass ("x_ite-private-browser"),
|
|
116
|
+
surface = $("<div></div>") .addClass ("x_ite-private-surface") .appendTo (browser),
|
|
117
|
+
splashScreen = $("<div></div>") .hide () .addClass ("x_ite-private-splash-screen") .appendTo (browser),
|
|
216
118
|
spinner = $("<div></div>") .addClass ("x_ite-private-spinner") .appendTo (splashScreen),
|
|
217
|
-
progress = $("<div></div>") .addClass ("x_ite-private-progress") .appendTo (splashScreen)
|
|
218
|
-
surface = $("<div></div>") .addClass ("x_ite-private-surface") .appendTo (browser);
|
|
119
|
+
progress = $("<div></div>") .addClass ("x_ite-private-progress") .appendTo (splashScreen);
|
|
219
120
|
|
|
220
|
-
$("<div></div>") .addClass ("x_ite-private-x_ite") .html ("
|
|
121
|
+
$("<div></div>") .addClass ("x_ite-private-x_ite") .html (this .getName () + "<span class='x_ite-private-x3d'>X3D</span>") .appendTo (progress);
|
|
221
122
|
$("<div></div>") .addClass ("x_ite-private-progressbar") .appendTo (progress) .append ($("<div></div>"));
|
|
222
123
|
$("<div></div>") .addClass ("x_ite-private-spinner-text") .appendTo (progress);
|
|
223
124
|
|
|
224
|
-
this [
|
|
125
|
+
this [_number] = ++ browserNumber;
|
|
126
|
+
this [_element] = element;
|
|
127
|
+
this [_shadow] = shadow .length ? shadow .append (browser .hide ()) : this [_element] .prepend (browser);
|
|
225
128
|
this [_surface] = surface;
|
|
226
129
|
this [_canvas] = $("<canvas></canvas>") .addClass ("x_ite-private-canvas") .prependTo (surface);
|
|
227
|
-
this [_context] =
|
|
228
|
-
this [
|
|
229
|
-
|
|
230
|
-
const gl = this .getContext ();
|
|
130
|
+
this [_context] = Context .create (this [_canvas] [0], WEBGL_LATEST_VERSION, element .attr ("preserveDrawingBuffer") === "true");
|
|
131
|
+
this [_splashScreen] = splashScreen;
|
|
231
132
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this [_extensions] .set (extension, gl .getExtension (extension));
|
|
235
|
-
}
|
|
133
|
+
if (shadow .length)
|
|
134
|
+
shadow .prop ("loaded") .then (function () { browser .show (); });
|
|
236
135
|
|
|
237
136
|
this [_localStorage] = new DataStorage (localStorage, "X_ITE.X3DBrowser(" + this [_number] + ").");
|
|
238
137
|
this [_mobile] = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
|
|
@@ -244,6 +143,10 @@ function ($,
|
|
|
244
143
|
this [_notification] = new Notification (this .getPrivateScene ());
|
|
245
144
|
this [_contextMenu] = new ContextMenu (this .getPrivateScene ());
|
|
246
145
|
|
|
146
|
+
const inches = $("<div></div>") .hide () .css ("height", "10in") .appendTo (this [_shadow]);
|
|
147
|
+
this [_pixelPerPoint] = inches .height () / 720;
|
|
148
|
+
inches .remove ();
|
|
149
|
+
|
|
247
150
|
$(".x_ite-console") .empty ();
|
|
248
151
|
|
|
249
152
|
this .addChildObjects ("controlKey", new Fields .SFBool (),
|
|
@@ -259,8 +162,8 @@ function ($,
|
|
|
259
162
|
// Setup browser nodes.
|
|
260
163
|
|
|
261
164
|
this [_browserTimings] .setup ();
|
|
262
|
-
this [_browserOptions] .setup ()
|
|
263
|
-
this [_browserProperties] .setup ()
|
|
165
|
+
this [_browserOptions] .setup ();
|
|
166
|
+
this [_browserProperties] .setup ();
|
|
264
167
|
this [_renderingProperties] .setup ();
|
|
265
168
|
this [_notification] .setup ();
|
|
266
169
|
this [_contextMenu] .setup ();
|
|
@@ -335,6 +238,10 @@ function ($,
|
|
|
335
238
|
{
|
|
336
239
|
return this [_element];
|
|
337
240
|
},
|
|
241
|
+
getShadow: function ()
|
|
242
|
+
{
|
|
243
|
+
return this [_shadow];
|
|
244
|
+
},
|
|
338
245
|
getSurface: function ()
|
|
339
246
|
{
|
|
340
247
|
return this [_surface];
|
|
@@ -351,10 +258,6 @@ function ($,
|
|
|
351
258
|
{
|
|
352
259
|
return this [_context];
|
|
353
260
|
},
|
|
354
|
-
getExtension: function (name)
|
|
355
|
-
{
|
|
356
|
-
return this [_extensions] .get (name);
|
|
357
|
-
},
|
|
358
261
|
getMobile: function ()
|
|
359
262
|
{
|
|
360
263
|
return this [_mobile];
|
|
@@ -481,7 +384,7 @@ function ($,
|
|
|
481
384
|
else
|
|
482
385
|
{
|
|
483
386
|
if (! this .getLoading ())
|
|
484
|
-
this .getCanvas () .
|
|
387
|
+
this .getCanvas () .show ();
|
|
485
388
|
}
|
|
486
389
|
},
|
|
487
390
|
setBrowserEventHandler: function (name)
|
|
@@ -544,15 +447,6 @@ function ($,
|
|
|
544
447
|
this ._altKey = true;
|
|
545
448
|
break;
|
|
546
449
|
}
|
|
547
|
-
case 37: // Left
|
|
548
|
-
case 38: // Up
|
|
549
|
-
case 39: // Right
|
|
550
|
-
case 40: // Down
|
|
551
|
-
{
|
|
552
|
-
// Prevent bug in Firefox that event loop is broken when pressing these keys.
|
|
553
|
-
this .requestAnimationFrame ();
|
|
554
|
-
break;
|
|
555
|
-
}
|
|
556
450
|
case 49: // 1
|
|
557
451
|
{
|
|
558
452
|
if (this .getDebug ())
|
|
@@ -782,15 +676,6 @@ function ($,
|
|
|
782
676
|
this ._altKey = false;
|
|
783
677
|
break;
|
|
784
678
|
}
|
|
785
|
-
case 37: // Left
|
|
786
|
-
case 38: // Up
|
|
787
|
-
case 39: // Right
|
|
788
|
-
case 40: // Down
|
|
789
|
-
{
|
|
790
|
-
// Prevent bug in Firefox that event loop is broken when pressing these keys.
|
|
791
|
-
this .requestAnimationFrame ();
|
|
792
|
-
break;
|
|
793
|
-
}
|
|
794
679
|
case 225: // Alt Gr
|
|
795
680
|
{
|
|
796
681
|
this ._altGrKey = false;
|
|
@@ -802,11 +687,15 @@ function ($,
|
|
|
802
687
|
{
|
|
803
688
|
// The textarea must be visible to make copy work.
|
|
804
689
|
const $temp = $("<textarea></textarea>");
|
|
805
|
-
this .
|
|
690
|
+
this .getShadow () .find (".x_ite-private-browser") .prepend ($temp);
|
|
806
691
|
$temp .text (text) .select ();
|
|
807
692
|
document .execCommand ("copy");
|
|
808
693
|
$temp .remove ();
|
|
809
694
|
},
|
|
695
|
+
getPixelPerPoint: function ()
|
|
696
|
+
{
|
|
697
|
+
return this [_pixelPerPoint];
|
|
698
|
+
},
|
|
810
699
|
};
|
|
811
700
|
|
|
812
701
|
return X3DCoreContext;
|
|
@@ -247,6 +247,10 @@ function ($,
|
|
|
247
247
|
cx .fillRect (0, 0, canvas .width, canvas .height);
|
|
248
248
|
cx .fillStyle = "rgba(255,255,255,1)";
|
|
249
249
|
|
|
250
|
+
cx .save ();
|
|
251
|
+
cx .translate (0, canvas .height);
|
|
252
|
+
cx .scale (1, -1);
|
|
253
|
+
|
|
250
254
|
// Draw glyphs.
|
|
251
255
|
|
|
252
256
|
if (fontStyle ._horizontal .getValue ())
|
|
@@ -312,13 +316,16 @@ function ($,
|
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
318
|
|
|
319
|
+
cx .restore ();
|
|
320
|
+
|
|
315
321
|
// Transfer texture data.
|
|
316
322
|
|
|
317
323
|
const imageData = cx .getImageData (0, 0, canvas .width, canvas .height);
|
|
318
324
|
|
|
319
|
-
// If the
|
|
325
|
+
// If the canvas is to large imageData is null.
|
|
326
|
+
|
|
320
327
|
if (imageData)
|
|
321
|
-
this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data .buffer),
|
|
328
|
+
this .textureNode .setTexture (canvas .width, canvas .height, true, new Uint8Array (imageData .data .buffer), false);
|
|
322
329
|
else
|
|
323
330
|
this .textureNode .clear ();
|
|
324
331
|
};
|
|
@@ -458,12 +465,12 @@ function ($,
|
|
|
458
465
|
},
|
|
459
466
|
transformLine: function (line)
|
|
460
467
|
{
|
|
461
|
-
// Apply
|
|
468
|
+
// Apply screen nodes transformation in place here.
|
|
462
469
|
return line .multLineMatrix (Matrix4 .inverse (this .matrix));
|
|
463
470
|
},
|
|
464
471
|
transformMatrix: function (matrix)
|
|
465
472
|
{
|
|
466
|
-
// Apply
|
|
473
|
+
// Apply screen nodes transformation in place here.
|
|
467
474
|
return matrix .multLeft (this .matrix);
|
|
468
475
|
},
|
|
469
476
|
});
|
|
@@ -57,24 +57,13 @@ function ($,
|
|
|
57
57
|
"use strict";
|
|
58
58
|
|
|
59
59
|
const
|
|
60
|
-
_pointSize = Symbol (),
|
|
61
60
|
_screenTextureProperties = Symbol ();
|
|
62
61
|
|
|
63
|
-
function X3DLayoutContext ()
|
|
62
|
+
function X3DLayoutContext ()
|
|
63
|
+
{ }
|
|
64
64
|
|
|
65
65
|
X3DLayoutContext .prototype =
|
|
66
66
|
{
|
|
67
|
-
getPointSize: function ()
|
|
68
|
-
{
|
|
69
|
-
if (this [_pointSize] === undefined)
|
|
70
|
-
{
|
|
71
|
-
const div = $("<div></div>") .css ("height", "1in") .css ("display", "none");
|
|
72
|
-
this [_pointSize] = div .appendTo ($("body")) .height () / 72;
|
|
73
|
-
div .remove ();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return this [_pointSize];
|
|
77
|
-
},
|
|
78
67
|
getScreenTextureProperties: function ()
|
|
79
68
|
{
|
|
80
69
|
this [_screenTextureProperties] = new TextureProperties (this .getPrivateScene ());
|
|
@@ -82,8 +71,8 @@ function ($,
|
|
|
82
71
|
this [_screenTextureProperties] ._boundaryModeS = "CLAMP";
|
|
83
72
|
this [_screenTextureProperties] ._boundaryModeT = "CLAMP";
|
|
84
73
|
this [_screenTextureProperties] ._boundaryModeR = "CLAMP";
|
|
85
|
-
this [_screenTextureProperties] ._minificationFilter = "
|
|
86
|
-
this [_screenTextureProperties] ._magnificationFilter = "
|
|
74
|
+
this [_screenTextureProperties] ._minificationFilter = "NEAREST_PIXEL";
|
|
75
|
+
this [_screenTextureProperties] ._magnificationFilter = "NEAREST_PIXEL";
|
|
87
76
|
this [_screenTextureProperties] ._generateMipMaps = false;
|
|
88
77
|
|
|
89
78
|
this [_screenTextureProperties] .setup ();
|
|
@@ -173,9 +173,6 @@ function ($,
|
|
|
173
173
|
},
|
|
174
174
|
mousedown: function (event)
|
|
175
175
|
{
|
|
176
|
-
if (this .getBrowser () .getContextMenu () .getActive ())
|
|
177
|
-
return;
|
|
178
|
-
|
|
179
176
|
if (this .button >= 0)
|
|
180
177
|
return;
|
|
181
178
|
|
|
@@ -449,21 +446,24 @@ function ($,
|
|
|
449
446
|
// End rotate (button 0).
|
|
450
447
|
|
|
451
448
|
event .button = 0;
|
|
449
|
+
event .pageX = this .touch1 .x;
|
|
450
|
+
event .pageY = this .touch1 .y;
|
|
452
451
|
|
|
453
452
|
this .mouseup (event);
|
|
454
453
|
|
|
455
454
|
// Start dblclick (button 0).
|
|
456
455
|
|
|
457
|
-
if (this .
|
|
456
|
+
if (this .tapedTwice)
|
|
458
457
|
{
|
|
459
|
-
event .button = 0;
|
|
460
|
-
event .pageX = this .touch1 .x;
|
|
461
|
-
event .pageY = this .touch1 .y;
|
|
462
|
-
|
|
463
458
|
this .dblclick (event);
|
|
464
459
|
}
|
|
460
|
+
else
|
|
461
|
+
{
|
|
462
|
+
this .tapedTwice = true;
|
|
463
|
+
|
|
464
|
+
setTimeout (function () { this .tapedTwice = false; } .bind (this), 300);
|
|
465
|
+
}
|
|
465
466
|
|
|
466
|
-
this .tapStart = this .getBrowser () .getCurrentTime ();
|
|
467
467
|
break;
|
|
468
468
|
}
|
|
469
469
|
case 1:
|
|
@@ -650,17 +650,10 @@ function ($,
|
|
|
650
650
|
|
|
651
651
|
return function (rotationChange)
|
|
652
652
|
{
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
this .disconnect ();
|
|
656
|
-
this .getBrowser () .prepareEvents () .addInterest ("spin", this);
|
|
653
|
+
this .disconnect ();
|
|
654
|
+
this .getBrowser () .prepareEvents () .addInterest ("spin", this);
|
|
657
655
|
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
catch (error)
|
|
661
|
-
{
|
|
662
|
-
console .error (error);
|
|
663
|
-
}
|
|
656
|
+
this .rotation .assign (rotation .assign (Rotation4 .Identity) .slerp (rotationChange, SPIN_FACTOR));
|
|
664
657
|
};
|
|
665
658
|
})(),
|
|
666
659
|
addMove: (function ()
|
|
@@ -51,6 +51,7 @@ define ([
|
|
|
51
51
|
"jquery",
|
|
52
52
|
"x_ite/Browser/Navigation/X3DViewer",
|
|
53
53
|
"x_ite/Components/Followers/OrientationChaser",
|
|
54
|
+
"x_ite/Rendering/VertexArray",
|
|
54
55
|
"standard/Math/Numbers/Vector3",
|
|
55
56
|
"standard/Math/Numbers/Rotation4",
|
|
56
57
|
"standard/Math/Numbers/Matrix4",
|
|
@@ -60,6 +61,7 @@ define ([
|
|
|
60
61
|
function ($,
|
|
61
62
|
X3DViewer,
|
|
62
63
|
OrientationChaser,
|
|
64
|
+
VertexArray,
|
|
63
65
|
Vector3,
|
|
64
66
|
Rotation4,
|
|
65
67
|
Matrix4,
|
|
@@ -94,10 +96,11 @@ function ($,
|
|
|
94
96
|
this .toVector = new Vector3 (0, 0, 0);
|
|
95
97
|
this .direction = new Vector3 (0, 0, 0);
|
|
96
98
|
this .startTime = 0;
|
|
97
|
-
this .lineBuffer = gl .createBuffer ();
|
|
98
99
|
this .lineCount = 2;
|
|
99
100
|
this .lineVertices = new Array (this .lineCount * 4);
|
|
100
101
|
this .lineArray = new Float32Array (this .lineVertices);
|
|
102
|
+
this .lineBuffer = gl .createBuffer ();
|
|
103
|
+
this .lineArrayObject = new VertexArray ();
|
|
101
104
|
this .event = null;
|
|
102
105
|
this .lookAround = false;
|
|
103
106
|
this .orientationChaser = new OrientationChaser (executionContext);
|
|
@@ -156,9 +159,6 @@ function ($,
|
|
|
156
159
|
},
|
|
157
160
|
mousedown: function (event)
|
|
158
161
|
{
|
|
159
|
-
if (this .getBrowser () .getContextMenu () .getActive ())
|
|
160
|
-
return;
|
|
161
|
-
|
|
162
162
|
if (this .button >= 0)
|
|
163
163
|
return;
|
|
164
164
|
|
|
@@ -691,10 +691,12 @@ function ($,
|
|
|
691
691
|
shaderNode = browser .getLineShader (),
|
|
692
692
|
lineWidth = gl .getParameter (gl .LINE_WIDTH);
|
|
693
693
|
|
|
694
|
-
if (shaderNode .
|
|
694
|
+
if (shaderNode .isValid ())
|
|
695
695
|
{
|
|
696
696
|
shaderNode .enable (gl);
|
|
697
|
-
|
|
697
|
+
|
|
698
|
+
if (this .lineArrayObject .enable (gl, shaderNode))
|
|
699
|
+
shaderNode .enableVertexAttribute (gl, this .lineBuffer, 0, 0);
|
|
698
700
|
|
|
699
701
|
gl .uniform1i (shaderNode .x3d_NumClipPlanes, 0);
|
|
700
702
|
gl .uniform1i (shaderNode .x3d_FogType, 0);
|
|
@@ -744,7 +746,7 @@ function ($,
|
|
|
744
746
|
// Transfer line.
|
|
745
747
|
|
|
746
748
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .lineBuffer);
|
|
747
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .lineArray, gl .
|
|
749
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .lineArray, gl .DYNAMIC_DRAW);
|
|
748
750
|
},
|
|
749
751
|
disconnect: function ()
|
|
750
752
|
{
|
|
@@ -762,6 +764,11 @@ function ($,
|
|
|
762
764
|
},
|
|
763
765
|
dispose: function ()
|
|
764
766
|
{
|
|
767
|
+
const gl = this .getBrowser () .getContext ();
|
|
768
|
+
|
|
769
|
+
gl .deleteBuffer (this .lineBuffer);
|
|
770
|
+
this .lineArrayObject .delete (gl);
|
|
771
|
+
|
|
765
772
|
this .disconnect ();
|
|
766
773
|
this .getBrowser () ._controlKey .removeInterest ("set_controlKey__", this);
|
|
767
774
|
this .getBrowser () .getSurface () .unbind (".X3DFlyViewer");
|
|
@@ -122,29 +122,21 @@ function (X3DBaseNode,
|
|
|
122
122
|
|
|
123
123
|
return function (x, y, result)
|
|
124
124
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
viewport = this .getViewport () .getRectangle (this .getBrowser ()),
|
|
131
|
-
projectionMatrix = viewpoint .getProjectionMatrixWithLimits (navigationInfo .getNearValue (), navigationInfo .getFarValue (viewpoint), viewport);
|
|
125
|
+
const
|
|
126
|
+
navigationInfo = this .getNavigationInfo (),
|
|
127
|
+
viewpoint = this .getActiveViewpoint (),
|
|
128
|
+
viewport = this .getViewport () .getRectangle (this .getBrowser ()),
|
|
129
|
+
projectionMatrix = viewpoint .getProjectionMatrixWithLimits (navigationInfo .getNearValue (), navigationInfo .getFarValue (viewpoint), viewport);
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
// Far plane point
|
|
132
|
+
ViewVolume .unProjectPoint (x, this .getBrowser () .getViewport () [3] - y, 0.9, Matrix4 .Identity, projectionMatrix, viewport, far);
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
if (viewpoint instanceof OrthoViewpoint)
|
|
135
|
+
return result .set (far .x, far .y, -this .getDistanceToCenter (distance) .abs ());
|
|
138
136
|
|
|
139
|
-
|
|
137
|
+
const direction = far .normalize ();
|
|
140
138
|
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
catch (error)
|
|
144
|
-
{
|
|
145
|
-
console .error (error);
|
|
146
|
-
return result .set (0, 0, 0);
|
|
147
|
-
}
|
|
139
|
+
return result .assign (direction) .multiply (this .getDistanceToCenter (distance) .abs () / direction .dot (axis));
|
|
148
140
|
};
|
|
149
141
|
})(),
|
|
150
142
|
getDistanceToCenter: function (distance, positionOffset)
|
|
@@ -194,7 +186,7 @@ function (X3DBaseNode,
|
|
|
194
186
|
})(),
|
|
195
187
|
touch: function (x, y)
|
|
196
188
|
{
|
|
197
|
-
this .getBrowser () .touch (x, y);
|
|
189
|
+
this .getBrowser () .touch (x, y, false);
|
|
198
190
|
|
|
199
191
|
return this .getBrowser () .getHits () .length;
|
|
200
192
|
},
|
|
@@ -85,10 +85,13 @@ function (Fields,
|
|
|
85
85
|
this [_loading] = false;
|
|
86
86
|
this [_location] = getBaseURI (this .getElement () [0]);
|
|
87
87
|
|
|
88
|
-
this .getCanvas () .
|
|
88
|
+
this .getCanvas () .hide ();
|
|
89
89
|
|
|
90
90
|
if (this .getBrowserOptions () .getSplashScreen ())
|
|
91
|
-
|
|
91
|
+
{
|
|
92
|
+
this .getContextMenu () .hide ();
|
|
93
|
+
this .getSplashScreen () .show ();
|
|
94
|
+
}
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
X3DNetworkingContext .prototype =
|
|
@@ -127,28 +130,29 @@ function (Fields,
|
|
|
127
130
|
{
|
|
128
131
|
this .resetLoadCount ();
|
|
129
132
|
|
|
130
|
-
this .
|
|
133
|
+
this .getShadow () .find (".x_ite-private-world-info") .remove ();
|
|
131
134
|
|
|
132
135
|
if (this .getBrowserOptions () .getSplashScreen ())
|
|
133
136
|
{
|
|
137
|
+
this .getContextMenu () .hide ();
|
|
134
138
|
this .getCanvas () .stop (true, true) .animate ({ "delay": 1 }, 1) .fadeOut (0);
|
|
135
139
|
this .getSplashScreen () .stop (true, true) .animate ({ "delay": 1 }, 1) .fadeIn (0);
|
|
136
140
|
}
|
|
137
141
|
else
|
|
138
142
|
{
|
|
139
|
-
this .getCanvas () .
|
|
143
|
+
this .getCanvas () .hide ();
|
|
140
144
|
}
|
|
141
145
|
}
|
|
142
146
|
else
|
|
143
147
|
{
|
|
144
148
|
if (this .getBrowserOptions () .getSplashScreen ())
|
|
145
149
|
{
|
|
146
|
-
this .getSplashScreen () .stop (true, true) .
|
|
147
|
-
this .getCanvas () .stop (true, true) .
|
|
150
|
+
this .getSplashScreen () .stop (true, true) .show () .fadeOut (2000);
|
|
151
|
+
this .getCanvas () .stop (true, true) .hide () .fadeIn (2000);
|
|
148
152
|
}
|
|
149
153
|
else
|
|
150
154
|
{
|
|
151
|
-
this .getCanvas () .
|
|
155
|
+
this .getCanvas () .show ();
|
|
152
156
|
}
|
|
153
157
|
}
|
|
154
158
|
},
|