x_ite 5.0.3 → 6.1.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 +25 -1
- package/Makefile +36 -28
- package/README.md +6 -11
- package/build/bin/dist.pl +0 -6
- package/build/bin/examples-and-tests.pl +75 -0
- package/build/bin/tests-menu.pl +57 -0
- package/build/bin/version.pl +7 -4
- package/build/parts/default.start.frag.js +3 -2
- package/dist/assets/components/annotation.js +3 -2
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +3 -2
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +8 -20
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +3 -2
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +4 -3
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +38 -52
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +34 -1686
- package/dist/assets/components/geospatial.min.js +1 -1
- package/dist/assets/components/h-anim.js +71 -77
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +4 -3
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +101 -173
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +3 -2
- package/dist/assets/components/nurbs.min.js +1 -1
- package/dist/assets/components/particle-systems.js +1926 -1669
- package/dist/assets/components/particle-systems.min.js +1 -1
- package/dist/assets/components/picking.js +34 -41
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +73 -86
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +37 -57
- package/dist/assets/components/rigid-body-physics.min.js +1 -1
- package/dist/assets/components/scripting.js +3 -2
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +27 -33
- package/dist/assets/components/texturing-3d.min.js +3 -3
- package/dist/assets/components/volume-rendering.js +12 -11
- package/dist/assets/components/volume-rendering.min.js +1 -1
- package/dist/assets/components/x_ite.js +3 -2
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/images/Shading.png +0 -0
- 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/Gouraud.vs +1 -1
- package/dist/assets/shaders/webgl1/Line.fs +0 -21
- package/dist/assets/shaders/webgl1/Line.vs +0 -10
- package/dist/assets/shaders/webgl1/PBR.fs +1 -1
- package/dist/assets/shaders/webgl1/PBR.vs +1 -1
- package/dist/assets/shaders/webgl1/Phong.fs +1 -1
- package/dist/assets/shaders/webgl1/Point.vs +1 -1
- package/dist/assets/shaders/webgl2/Depth.vs +29 -1
- package/dist/assets/shaders/webgl2/Gouraud.vs +32 -4
- 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.fs +1 -1
- package/dist/assets/shaders/webgl2/PBR.vs +35 -7
- package/dist/assets/shaders/webgl2/Phong.fs +1 -1
- package/dist/assets/shaders/webgl2/Phong.vs +31 -3
- package/dist/assets/shaders/webgl2/Point.vs +30 -2
- package/dist/assets/shaders/webgl2/Unlit.vs +31 -3
- package/dist/example.html +6 -6
- package/dist/x_ite.css +199 -224
- package/dist/x_ite.js +16335 -15917
- 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 +21 -15
- package/docs/Browser-Support.md +6 -0
- package/docs/Custom-Shaders.md +18 -25
- package/docs/Features.md +11 -5
- 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 +93 -39
- package/docs/XHTML-DOM-Integration.md +6 -0
- package/docs/_config.yml +2 -2
- package/docs/assets/css/main.scss +26 -0
- package/docs/index.md +42 -50
- 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 +12 -6
- package/docs/reference/Field-Services-and-Objects.md +105 -1
- package/docs/reference/Prototype-Services.md +11 -0
- package/docs/reference/Route-Services.md +9 -0
- package/docs/reference/Scene-Services.md +17 -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 +42 -36
- 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/images/Shading.png +0 -0
- 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/Gouraud.fs +1 -1
- package/src/assets/shaders/webgl1/Gouraud.vs +2 -3
- package/src/assets/shaders/webgl1/Line.fs +3 -28
- package/src/assets/shaders/webgl1/Line.vs +6 -20
- package/src/assets/shaders/webgl1/PBR.fs +6 -6
- package/src/assets/shaders/webgl1/PBR.vs +1 -1
- package/src/assets/shaders/webgl1/Phong.fs +10 -10
- package/src/assets/shaders/webgl1/Point.vs +2 -2
- package/src/assets/shaders/webgl1/Unlit.fs +4 -4
- package/src/assets/shaders/webgl1/include/Normal.glsl +1 -1
- package/src/assets/shaders/webgl1/include/Texture.glsl +3 -8
- package/src/assets/shaders/webgl2/Depth.vs +4 -1
- package/src/assets/shaders/webgl2/Gouraud.fs +1 -1
- package/src/assets/shaders/webgl2/Gouraud.vs +8 -6
- package/src/assets/shaders/webgl2/Line.fs +11 -17
- package/src/assets/shaders/webgl2/Line.vs +17 -21
- package/src/assets/shaders/webgl2/LineTransform.fs +6 -0
- package/src/assets/shaders/webgl2/LineTransform.vs +77 -0
- package/src/assets/shaders/webgl2/PBR.fs +6 -6
- package/src/assets/shaders/webgl2/PBR.vs +10 -7
- package/src/assets/shaders/webgl2/Phong.fs +11 -11
- package/src/assets/shaders/webgl2/Phong.vs +6 -3
- package/src/assets/shaders/webgl2/Point.vs +5 -4
- package/src/assets/shaders/webgl2/Unlit.fs +5 -5
- 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/Normal.glsl +1 -1
- package/src/assets/shaders/webgl2/include/Particle.glsl +36 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +3 -3
- package/src/example.html +6 -6
- package/src/examples.js +5 -4
- package/src/standard/Math/Algorithm.js +12 -28
- package/src/standard/Math/Geometry/Line2.js +163 -0
- package/src/standard/Math/Geometry/Line3.js +3 -5
- package/src/standard/Math/Geometry/Plane3.js +0 -2
- package/src/standard/Math/Geometry/Triangle3.js +1 -1
- package/src/standard/Math/Geometry/ViewVolume.js +121 -103
- 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 +48 -34
- package/src/standard/Math/Numbers/Matrix2.js +62 -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 +12 -5
- package/src/standard/Math/Numbers/Rotation4.js +8 -1
- package/src/standard/Math/Numbers/Vector2.js +42 -9
- package/src/standard/Math/Numbers/Vector3.js +50 -14
- package/src/standard/Math/Numbers/Vector4.js +48 -11
- package/src/standard/Math/Utility/BVH.js +45 -17
- package/src/tests.js +68 -66
- 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 +24 -143
- package/src/x_ite/Browser/Core/BrowserTimings.js +6 -4
- package/src/x_ite/Browser/Core/Context.js +185 -0
- package/src/x_ite/Browser/Core/ContextMenu.js +398 -211
- 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/Followers/X3DArrayFollowerTemplate.js +1 -1
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +1 -0
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +2 -2
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +41 -2
- package/src/x_ite/Browser/Geospatial/Geocentric.js +2 -2
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +1 -1
- package/src/x_ite/Browser/Layout/ScreenText.js +18 -65
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +59 -16
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +13 -20
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +1 -4
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +0 -3
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +15 -8
- 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 +41 -37
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +21 -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/Text/X3DTextGeometry.js +2 -1
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +71 -34
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +2 -2
- package/src/x_ite/Browser/Time/X3DTimeContext.js +4 -2
- 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 +43 -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 +1 -2
- 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/ColorDamper.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/Followers/X3DFollowerNode.js +1 -1
- package/src/x_ite/Components/Geometry2D/Disk2D.js +30 -46
- 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/GeoLOD.js +1 -1
- 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/GeoViewpoint.js +26 -30
- 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 +16 -80
- 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 +2 -2
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +29 -30
- package/src/x_ite/Components/Navigation/Viewpoint.js +16 -20
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +82 -111
- package/src/x_ite/Components/Networking/Anchor.js +18 -7
- 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 +463 -882
- 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 +91 -108
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +56 -59
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +54 -71
- 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 -24
- package/src/x_ite/Components/Rendering/ColorRGBA.js +13 -25
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +26 -4
- package/src/x_ite/Components/Rendering/LineSet.js +35 -13
- package/src/x_ite/Components/Rendering/PointSet.js +35 -13
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +13 -5
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +331 -387
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +350 -140
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +116 -126
- 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 +8 -11
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -14
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +1 -10
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +220 -210
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +28 -10
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +15 -1
- package/src/x_ite/Components/Shape/Appearance.js +37 -4
- 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 +24 -3
- package/src/x_ite/Components/Shape/Shape.js +30 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +3 -1
- package/src/x_ite/Components/Sound/Sound.js +31 -41
- package/src/x_ite/Components/Text/Text.js +6 -20
- package/src/x_ite/Components/Texturing/ImageTexture.js +1 -1
- package/src/x_ite/Components/Texturing/MovieTexture.js +1 -1
- package/src/x_ite/Components/Texturing/PixelTexture.js +2 -2
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +5 -5
- package/src/x_ite/Components/Texturing/TextureProperties.js +4 -4
- 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 -5
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +5 -5
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +12 -19
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +8 -8
- 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/SFImage.js +2 -11
- 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 +22 -2
- 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 +103 -0
- package/src/x_ite/Rendering/X3DRenderObject.js +127 -148
- package/src/x_ite/X3D.js +32 -26
- package/src/x_ite.config.js +0 -5
- package/src/x_ite.css +216 -175
- package/src/x_ite.html +15 -10
- package/src/x_ite.js +49 -1
- package/x_ite.min.html +15 -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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2
|
+
*******************************************************************************
|
|
3
|
+
*
|
|
4
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5
|
+
*
|
|
6
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
7
|
+
*
|
|
8
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
9
|
+
*
|
|
10
|
+
* The copyright notice above does not evidence any actual of intended
|
|
11
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
12
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
13
|
+
* create3000.
|
|
14
|
+
*
|
|
15
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
16
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
17
|
+
* permission of create3000.
|
|
18
|
+
*
|
|
19
|
+
* NON-MILITARY USE ONLY
|
|
20
|
+
*
|
|
21
|
+
* All create3000 software are effectively free software with a non-military use
|
|
22
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
23
|
+
* source in any way you please with the exception anything that uses it must be
|
|
24
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
25
|
+
*
|
|
26
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
27
|
+
*
|
|
28
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
29
|
+
*
|
|
30
|
+
* This file is part of the X_ITE Project.
|
|
31
|
+
*
|
|
32
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
33
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
34
|
+
* Free Software Foundation.
|
|
35
|
+
*
|
|
36
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
37
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
38
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
39
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
40
|
+
*
|
|
41
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
42
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
43
|
+
* copy of the GPLv3 License.
|
|
44
|
+
*
|
|
45
|
+
* For Silvio, Joy and Adi.
|
|
46
|
+
*
|
|
47
|
+
******************************************************************************/
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
define (function ()
|
|
51
|
+
{
|
|
52
|
+
"use strict";
|
|
53
|
+
|
|
54
|
+
function VertexArray ()
|
|
55
|
+
{
|
|
56
|
+
this .vertexArray = null;
|
|
57
|
+
this .shaderNode = null;
|
|
58
|
+
this .tainted = true;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
VertexArray .prototype =
|
|
62
|
+
{
|
|
63
|
+
update: function (value = true)
|
|
64
|
+
{
|
|
65
|
+
this .tainted = this .tainted || value;
|
|
66
|
+
|
|
67
|
+
return this;
|
|
68
|
+
},
|
|
69
|
+
enable: function (gl, shaderNode)
|
|
70
|
+
{
|
|
71
|
+
if (this .tainted || this .shaderNode !== shaderNode)
|
|
72
|
+
{
|
|
73
|
+
gl .deleteVertexArray (this .vertexArray);
|
|
74
|
+
|
|
75
|
+
this .vertexArray = gl .createVertexArray ();
|
|
76
|
+
this .shaderNode = shaderNode;
|
|
77
|
+
this .tainted = false;
|
|
78
|
+
|
|
79
|
+
gl .bindVertexArray (this .vertexArray);
|
|
80
|
+
|
|
81
|
+
// console .log ("update vao");
|
|
82
|
+
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
{
|
|
87
|
+
gl .bindVertexArray (this .vertexArray);
|
|
88
|
+
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
disable: function (gl)
|
|
93
|
+
{
|
|
94
|
+
gl .bindVertexArray (null);
|
|
95
|
+
},
|
|
96
|
+
delete: function (gl)
|
|
97
|
+
{
|
|
98
|
+
gl .deleteVertexArray (this .vertexArray);
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return VertexArray;
|
|
103
|
+
});
|
|
@@ -290,7 +290,7 @@ function (TextureBuffer,
|
|
|
290
290
|
{
|
|
291
291
|
// Move.
|
|
292
292
|
|
|
293
|
-
const length = translation .
|
|
293
|
+
const length = translation .magnitude ();
|
|
294
294
|
|
|
295
295
|
if (length > distance)
|
|
296
296
|
{
|
|
@@ -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 ()
|
|
@@ -452,7 +445,7 @@ function (TextureBuffer,
|
|
|
452
445
|
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
453
446
|
|
|
454
447
|
const
|
|
455
|
-
radius = bboxSize .
|
|
448
|
+
radius = bboxSize .magnitude () / 2,
|
|
456
449
|
viewVolume = this .viewVolumes .at (-1);
|
|
457
450
|
|
|
458
451
|
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
@@ -498,7 +491,7 @@ function (TextureBuffer,
|
|
|
498
491
|
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
499
492
|
|
|
500
493
|
const
|
|
501
|
-
radius = bboxSize .
|
|
494
|
+
radius = bboxSize .magnitude () / 2,
|
|
502
495
|
viewVolume = this .viewVolumes .at (-1);
|
|
503
496
|
|
|
504
497
|
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
@@ -540,7 +533,7 @@ function (TextureBuffer,
|
|
|
540
533
|
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
541
534
|
|
|
542
535
|
const
|
|
543
|
-
radius = bboxSize .
|
|
536
|
+
radius = bboxSize .magnitude () / 2,
|
|
544
537
|
viewVolume = this .viewVolumes .at (-1);
|
|
545
538
|
|
|
546
539
|
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
@@ -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",
|