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
|
@@ -66,9 +66,6 @@ function (TextureProperties,
|
|
|
66
66
|
_maxCombinedTextureUnits = Symbol (),
|
|
67
67
|
_textureMemory = Symbol (),
|
|
68
68
|
_combinedTextureUnits = Symbol (),
|
|
69
|
-
_texture2DUnit = Symbol (),
|
|
70
|
-
_texture3DUnit = Symbol (),
|
|
71
|
-
_textureCubeUnit = Symbol (),
|
|
72
69
|
_texture2DUnits = Symbol (),
|
|
73
70
|
_texture3DUnits = Symbol (),
|
|
74
71
|
_textureCubeUnits = Symbol (),
|
|
@@ -102,6 +99,8 @@ function (TextureProperties,
|
|
|
102
99
|
{
|
|
103
100
|
const gl = this .getContext ();
|
|
104
101
|
|
|
102
|
+
gl .pixelStorei (gl .UNPACK_ALIGNMENT, 1);
|
|
103
|
+
|
|
105
104
|
this [_maxTextureSize] = gl .getParameter (gl .MAX_TEXTURE_SIZE);
|
|
106
105
|
this [_maxCombinedTextureUnits] = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
|
107
106
|
this [_textureMemory] = NaN;
|
|
@@ -109,12 +108,9 @@ function (TextureProperties,
|
|
|
109
108
|
// Get texture Units
|
|
110
109
|
|
|
111
110
|
this [_combinedTextureUnits] = [...Array (this [_maxCombinedTextureUnits]) .keys ()];
|
|
112
|
-
this [
|
|
113
|
-
this [
|
|
114
|
-
this [
|
|
115
|
-
this [_texture2DUnits] = [this [_texture2DUnit]];
|
|
116
|
-
this [_texture3DUnits] = [this [_texture3DUnit]];
|
|
117
|
-
this [_textureCubeUnits] = [this [_textureCubeUnit]];
|
|
111
|
+
this [_texture2DUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
112
|
+
this [_texture3DUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
113
|
+
this [_textureCubeUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
118
114
|
|
|
119
115
|
// Default Texture 2D Unit
|
|
120
116
|
|
|
@@ -122,11 +118,9 @@ function (TextureProperties,
|
|
|
122
118
|
|
|
123
119
|
this [_defaultTexture2D] = gl .createTexture ();
|
|
124
120
|
|
|
121
|
+
gl .activeTexture (gl .TEXTURE0 + this [_texture2DUnits] [0]);
|
|
125
122
|
gl .bindTexture (gl .TEXTURE_2D, this [_defaultTexture2D]);
|
|
126
|
-
gl .texImage2D
|
|
127
|
-
|
|
128
|
-
gl .activeTexture (gl .TEXTURE0 + this [_texture2DUnit]);
|
|
129
|
-
gl .bindTexture (gl .TEXTURE_2D, this [_defaultTexture2D]);
|
|
123
|
+
gl .texImage2D (gl .TEXTURE_2D, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
130
124
|
|
|
131
125
|
// Default Texture 3D Unit
|
|
132
126
|
|
|
@@ -134,27 +128,23 @@ function (TextureProperties,
|
|
|
134
128
|
{
|
|
135
129
|
this [_defaultTexture3D] = gl .createTexture ();
|
|
136
130
|
|
|
131
|
+
gl .activeTexture (gl .TEXTURE0 + this [_texture3DUnits] [0]);
|
|
137
132
|
gl .bindTexture (gl .TEXTURE_3D, this [_defaultTexture3D]);
|
|
138
|
-
gl .texImage3D
|
|
139
|
-
|
|
140
|
-
gl .activeTexture (gl .TEXTURE0 + this [_texture3DUnit]);
|
|
141
|
-
gl .bindTexture (gl .TEXTURE_3D, this [_defaultTexture3D]);
|
|
133
|
+
gl .texImage3D (gl .TEXTURE_3D, 0, gl .RGBA, 1, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
142
134
|
}
|
|
143
135
|
|
|
144
136
|
// Default Texture Cube Unit
|
|
145
137
|
|
|
146
138
|
this [_defaultTextureCube] = gl .createTexture ();
|
|
147
139
|
|
|
140
|
+
gl .activeTexture (gl .TEXTURE0 + this [_textureCubeUnits] [0]);
|
|
148
141
|
gl .bindTexture (gl .TEXTURE_CUBE_MAP, this [_defaultTextureCube]);
|
|
149
|
-
gl .texImage2D
|
|
150
|
-
gl .texImage2D
|
|
151
|
-
gl .texImage2D
|
|
152
|
-
gl .texImage2D
|
|
153
|
-
gl .texImage2D
|
|
154
|
-
gl .texImage2D
|
|
155
|
-
|
|
156
|
-
gl .activeTexture (gl .TEXTURE0 + this [_textureCubeUnit]);
|
|
157
|
-
gl .bindTexture (gl .TEXTURE_CUBE_MAP, this [_defaultTextureCube]);
|
|
142
|
+
gl .texImage2D (gl .TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
143
|
+
gl .texImage2D (gl .TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
144
|
+
gl .texImage2D (gl .TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
145
|
+
gl .texImage2D (gl .TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
146
|
+
gl .texImage2D (gl .TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
147
|
+
gl .texImage2D (gl .TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl .RGBA, 1, 1, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
|
|
158
148
|
|
|
159
149
|
// Init texture units.
|
|
160
150
|
|
|
@@ -182,7 +172,7 @@ function (TextureProperties,
|
|
|
182
172
|
{
|
|
183
173
|
-- this [_texture2DUnitIndex];
|
|
184
174
|
|
|
185
|
-
return this [_texture2DUnits] .
|
|
175
|
+
return this [_texture2DUnits] .pop ();
|
|
186
176
|
}
|
|
187
177
|
else
|
|
188
178
|
{
|
|
@@ -194,9 +184,9 @@ function (TextureProperties,
|
|
|
194
184
|
if (textureUnit === undefined)
|
|
195
185
|
return;
|
|
196
186
|
|
|
197
|
-
|
|
187
|
+
++ this [_texture2DUnitIndex];
|
|
198
188
|
|
|
199
|
-
this [_texture2DUnits] .
|
|
189
|
+
this [_texture2DUnits] .push (textureUnit);
|
|
200
190
|
},
|
|
201
191
|
getTexture2DUnit: function ()
|
|
202
192
|
{
|
|
@@ -251,15 +241,15 @@ function (TextureProperties,
|
|
|
251
241
|
},
|
|
252
242
|
getDefaultTexture2DUnit: function ()
|
|
253
243
|
{
|
|
254
|
-
return this [
|
|
244
|
+
return this [_texture2DUnits] [0];
|
|
255
245
|
},
|
|
256
246
|
getDefaultTexture3DUnit: function ()
|
|
257
247
|
{
|
|
258
|
-
return this [
|
|
248
|
+
return this [_texture3DUnits] [0];
|
|
259
249
|
},
|
|
260
250
|
getDefaultTextureCubeUnit: function ()
|
|
261
251
|
{
|
|
262
|
-
return this [
|
|
252
|
+
return this [_textureCubeUnits] [0];
|
|
263
253
|
},
|
|
264
254
|
getTextureMemory: function ()
|
|
265
255
|
{
|
|
@@ -277,7 +267,7 @@ function (TextureProperties,
|
|
|
277
267
|
{
|
|
278
268
|
this [_defaultTextureProperties] = new TextureProperties (this .getPrivateScene ());
|
|
279
269
|
this [_defaultTextureProperties] ._magnificationFilter = "NICEST";
|
|
280
|
-
this [_defaultTextureProperties] ._minificationFilter = "
|
|
270
|
+
this [_defaultTextureProperties] ._minificationFilter = "NEAREST_PIXEL_AVG_MIPMAP";
|
|
281
271
|
this [_defaultTextureProperties] ._textureCompression = "NICEST";
|
|
282
272
|
this [_defaultTextureProperties] ._generateMipMaps = true;
|
|
283
273
|
|
|
@@ -93,7 +93,7 @@ function (Vector3)
|
|
|
93
93
|
return function (now)
|
|
94
94
|
{
|
|
95
95
|
const
|
|
96
|
-
time = (
|
|
96
|
+
time = (performance .timeOrigin + now) / 1000,
|
|
97
97
|
interval = time - this [_currentTime];
|
|
98
98
|
|
|
99
99
|
this [_currentTime] = time;
|
|
@@ -109,7 +109,9 @@ function (Vector3)
|
|
|
109
109
|
this [_currentSpeed] = lastPosition .subtract (this [_currentPosition]) .abs () * this [_currentFrameRate];
|
|
110
110
|
}
|
|
111
111
|
else
|
|
112
|
+
{
|
|
112
113
|
this [_currentSpeed] = 0;
|
|
114
|
+
}
|
|
113
115
|
};
|
|
114
116
|
})(),
|
|
115
117
|
};
|
|
@@ -417,7 +417,7 @@ function ($,
|
|
|
417
417
|
|
|
418
418
|
// arguments .length === 1
|
|
419
419
|
|
|
420
|
-
if (!(url instanceof Fields .MFString))
|
|
420
|
+
if (! (url instanceof Fields .MFString))
|
|
421
421
|
throw new Error ("Browser.createX3DFromURL: url must be of type MFString.");
|
|
422
422
|
|
|
423
423
|
const
|
|
@@ -465,12 +465,12 @@ function ($,
|
|
|
465
465
|
{
|
|
466
466
|
if (loader !== this [_loader])
|
|
467
467
|
{
|
|
468
|
-
reject ();
|
|
468
|
+
reject ("Loading of X3D file aborted.");
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
if (! this .getBrowserOptions () .getSplashScreen ())
|
|
473
|
-
this .getCanvas () .
|
|
473
|
+
this .getCanvas () .show ();
|
|
474
474
|
|
|
475
475
|
if (scene)
|
|
476
476
|
{
|
|
@@ -486,7 +486,7 @@ function ($,
|
|
|
486
486
|
|
|
487
487
|
setTimeout (function () { this .getSplashScreen () .find (".x_ite-private-spinner-text") .text (_ ("Failed loading world.")); } .bind (this), 31);
|
|
488
488
|
|
|
489
|
-
reject ();
|
|
489
|
+
reject ("Couldn't load X3D file.");
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
.bind (this),
|
|
@@ -494,7 +494,7 @@ function ($,
|
|
|
494
494
|
{
|
|
495
495
|
if (loader !== this [_loader])
|
|
496
496
|
{
|
|
497
|
-
reject ();
|
|
497
|
+
reject ("Change viewpoint aborted.");
|
|
498
498
|
return;
|
|
499
499
|
}
|
|
500
500
|
|
|
@@ -509,7 +509,7 @@ function ($,
|
|
|
509
509
|
{
|
|
510
510
|
if (loader !== this [_loader])
|
|
511
511
|
{
|
|
512
|
-
reject ();
|
|
512
|
+
reject ("Loading of file aborted.");
|
|
513
513
|
return;
|
|
514
514
|
}
|
|
515
515
|
|
|
@@ -771,6 +771,7 @@ function ($,
|
|
|
771
771
|
this .setLive (true);
|
|
772
772
|
this .getExecutionContext () .setLive (true);
|
|
773
773
|
this .advanceTime (performance .now ());
|
|
774
|
+
this .addBrowserEvent ();
|
|
774
775
|
},
|
|
775
776
|
endUpdate: function ()
|
|
776
777
|
{
|
|
@@ -104,6 +104,7 @@ function ($,
|
|
|
104
104
|
_world = Symbol (),
|
|
105
105
|
_changedTime = Symbol (),
|
|
106
106
|
_renderCallback = Symbol (),
|
|
107
|
+
_previousTime = Symbol (),
|
|
107
108
|
_systemTime = Symbol (),
|
|
108
109
|
_systemStartTime = Symbol (),
|
|
109
110
|
_browserTime = Symbol (),
|
|
@@ -147,6 +148,7 @@ function ($,
|
|
|
147
148
|
"finished", new SFTime ());
|
|
148
149
|
|
|
149
150
|
this [_changedTime] = 0;
|
|
151
|
+
this [_previousTime] = 0;
|
|
150
152
|
this [_renderCallback] = this .traverse .bind (this);
|
|
151
153
|
this [_systemTime] = 0;
|
|
152
154
|
this [_systemStartTime] = 0;
|
|
@@ -255,14 +257,32 @@ function ($,
|
|
|
255
257
|
|
|
256
258
|
this [_changedTime] = this .getCurrentTime ();
|
|
257
259
|
|
|
258
|
-
|
|
260
|
+
requestAnimationFrame (this [_renderCallback]);
|
|
259
261
|
},
|
|
260
|
-
|
|
262
|
+
limitFrameRate: function (now)
|
|
261
263
|
{
|
|
262
|
-
|
|
264
|
+
if (now === this [_previousTime])
|
|
265
|
+
{
|
|
266
|
+
requestAnimationFrame (this [_renderCallback]);
|
|
267
|
+
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
else
|
|
271
|
+
{
|
|
272
|
+
this [_previousTime] = now;
|
|
273
|
+
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
263
276
|
},
|
|
264
277
|
traverse: function (now)
|
|
265
278
|
{
|
|
279
|
+
// Limit frame rate.
|
|
280
|
+
|
|
281
|
+
if (this .limitFrameRate (now))
|
|
282
|
+
return;
|
|
283
|
+
|
|
284
|
+
// Start rendering.
|
|
285
|
+
|
|
266
286
|
const gl = this .getContext ();
|
|
267
287
|
|
|
268
288
|
const t0 = performance .now ();
|
|
@@ -287,9 +307,6 @@ function ($,
|
|
|
287
307
|
this ._sensorEvents .processInterests ();
|
|
288
308
|
this .processEvents ();
|
|
289
309
|
|
|
290
|
-
// XXX: The depth buffer must be cleared here, although it is cleared in each layer, otherwise there is a
|
|
291
|
-
// XXX: phantom image in the depth buffer at least in Firefox.
|
|
292
|
-
|
|
293
310
|
const t3 = performance .now ();
|
|
294
311
|
gl .clearColor (0, 0, 0, 0);
|
|
295
312
|
gl .clear (gl .COLOR_BUFFER_BIT);
|
|
@@ -334,12 +351,20 @@ function ($,
|
|
|
334
351
|
|
|
335
352
|
contexts .push (context);
|
|
336
353
|
|
|
337
|
-
Object .
|
|
354
|
+
for (const key of Object .keys (context .prototype) .concat (Object .getOwnPropertySymbols (context .prototype)))
|
|
355
|
+
{
|
|
356
|
+
if (X3DBrowserContext .prototype .hasOwnProperty (key))
|
|
357
|
+
continue;
|
|
338
358
|
|
|
339
|
-
|
|
340
|
-
|
|
359
|
+
Object .defineProperty (X3DBrowserContext .prototype, key,
|
|
360
|
+
{
|
|
361
|
+
value: context .prototype [key],
|
|
362
|
+
enumerable: false,
|
|
363
|
+
writable: true,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
341
366
|
|
|
342
|
-
$("X3DCanvas") .each (function (i, canvas)
|
|
367
|
+
$("x3d-canvas, X3DCanvas") .each (function (i, canvas)
|
|
343
368
|
{
|
|
344
369
|
const browser = X3D .getBrowser (canvas);
|
|
345
370
|
|
|
@@ -140,6 +140,8 @@ function (Fields,
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
destinationField .setModificationTime (sourceField .getModificationTime ());
|
|
143
145
|
}
|
|
144
146
|
catch (error)
|
|
145
147
|
{
|
|
@@ -173,6 +175,8 @@ function (Fields,
|
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
}
|
|
178
|
+
|
|
179
|
+
destinationField .setModificationTime (sourceField .getModificationTime ());
|
|
176
180
|
}
|
|
177
181
|
|
|
178
182
|
copy .setup ();
|
|
@@ -49,14 +49,12 @@
|
|
|
49
49
|
|
|
50
50
|
define ([
|
|
51
51
|
"x_ite/Base/X3DChildObject",
|
|
52
|
-
"x_ite/Base/FieldDefinitionArray",
|
|
53
52
|
"x_ite/Components/Core/X3DNode",
|
|
54
53
|
"x_ite/Execution/X3DExecutionContext",
|
|
55
54
|
"x_ite/Base/X3DConstants",
|
|
56
55
|
"x_ite/InputOutput/Generator",
|
|
57
56
|
],
|
|
58
57
|
function (X3DChildObject,
|
|
59
|
-
FieldDefinitionArray,
|
|
60
58
|
X3DNode,
|
|
61
59
|
X3DExecutionContext,
|
|
62
60
|
X3DConstants,
|
|
@@ -193,7 +193,6 @@ function (Fields,
|
|
|
193
193
|
const gl = this .getBrowser () .getContext ();
|
|
194
194
|
|
|
195
195
|
gl .bindTexture (this .getTarget (), this .getTexture ());
|
|
196
|
-
gl .pixelStorei (gl .UNPACK_FLIP_Y_WEBGL, false);
|
|
197
196
|
|
|
198
197
|
if (this .isComplete ())
|
|
199
198
|
{
|
|
@@ -202,14 +201,12 @@ function (Fields,
|
|
|
202
201
|
for (let i = 0; i < 6; ++ i)
|
|
203
202
|
{
|
|
204
203
|
const
|
|
205
|
-
gl = this .getBrowser () .getContext (),
|
|
206
204
|
texture = textures [i],
|
|
207
205
|
width = texture .getWidth (),
|
|
208
206
|
height = texture .getHeight (),
|
|
209
207
|
data = texture .getData ();
|
|
210
208
|
|
|
211
209
|
gl .pixelStorei (gl .UNPACK_FLIP_Y_WEBGL, !texture .getFlipY ());
|
|
212
|
-
gl .pixelStorei (gl .UNPACK_ALIGNMENT, 1);
|
|
213
210
|
|
|
214
211
|
if (data instanceof Uint8Array)
|
|
215
212
|
{
|
|
@@ -217,10 +214,12 @@ function (Fields,
|
|
|
217
214
|
}
|
|
218
215
|
else
|
|
219
216
|
{
|
|
220
|
-
gl .texImage2D
|
|
217
|
+
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, gl .RGBA, gl .UNSIGNED_BYTE, data);
|
|
221
218
|
}
|
|
222
219
|
}
|
|
223
220
|
|
|
221
|
+
gl .pixelStorei (gl .UNPACK_FLIP_Y_WEBGL, false);
|
|
222
|
+
|
|
224
223
|
this .updateTextureProperties ();
|
|
225
224
|
}
|
|
226
225
|
else
|
|
@@ -219,7 +219,6 @@ function (Fields,
|
|
|
219
219
|
renderer .getProjectionMatrix () .pushMatrix (projectionMatrix);
|
|
220
220
|
|
|
221
221
|
gl .bindTexture (this .getTarget (), this .getTexture ());
|
|
222
|
-
gl .pixelStorei (gl .UNPACK_FLIP_Y_WEBGL, false);
|
|
223
222
|
|
|
224
223
|
for (let i = 0; i < 6; ++ i)
|
|
225
224
|
{
|
|
@@ -231,17 +230,7 @@ function (Fields,
|
|
|
231
230
|
renderer .getCameraSpaceMatrix () .rotate (rotations [i]);
|
|
232
231
|
renderer .getCameraSpaceMatrix () .scale (scales [i]);
|
|
233
232
|
|
|
234
|
-
|
|
235
|
-
{
|
|
236
|
-
renderer .getViewMatrix () .pushMatrix (invCameraSpaceMatrix .assign (renderer .getCameraSpaceMatrix () .get ()) .inverse ());
|
|
237
|
-
}
|
|
238
|
-
catch (error)
|
|
239
|
-
{
|
|
240
|
-
console .error (error);
|
|
241
|
-
|
|
242
|
-
renderer .getViewMatrix () .pushMatrix (Matrix4 .Identity);
|
|
243
|
-
}
|
|
244
|
-
|
|
233
|
+
renderer .getViewMatrix () .pushMatrix (invCameraSpaceMatrix .assign (renderer .getCameraSpaceMatrix () .get ()) .inverse ());
|
|
245
234
|
renderer .getModelViewMatrix () .pushMatrix (invCameraSpaceMatrix);
|
|
246
235
|
|
|
247
236
|
// Setup headlight if enabled.
|
|
@@ -78,7 +78,7 @@ function (Fields,
|
|
|
78
78
|
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
79
79
|
new X3DFieldDefinition (X3DConstants .inputOnly, "set_bind", new Fields .SFBool ()),
|
|
80
80
|
new X3DFieldDefinition (X3DConstants .inputOutput, "skyAngle", new Fields .MFFloat ()),
|
|
81
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "skyColor", new Fields .MFColor (
|
|
81
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "skyColor", new Fields .MFColor (new Fields .SFColor ())),
|
|
82
82
|
new X3DFieldDefinition (X3DConstants .inputOutput, "groundAngle", new Fields .MFFloat ()),
|
|
83
83
|
new X3DFieldDefinition (X3DConstants .inputOutput, "groundColor", new Fields .MFColor ()),
|
|
84
84
|
new X3DFieldDefinition (X3DConstants .inputOutput, "transparency", new Fields .SFFloat ()),
|