x_ite 4.7.12 → 5.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 +9 -2
- package/Makefile +27 -24
- package/build/bin/version-number.pl +1 -1
- package/build/bin/version.pl +3 -3
- package/build/parts/default.start.frag.js +2 -2
- package/build/parts/x_ite.end.frag.js +1 -2
- package/build/parts/x_ite.start.frag.js +4 -7
- package/dist/assets/components/annotation.js +312 -312
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +536 -538
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +797 -796
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +487 -472
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +486 -505
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +1221 -1271
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +2657 -2653
- package/dist/assets/components/geospatial.min.js +1 -2
- package/dist/assets/components/h-anim.js +640 -640
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +547 -549
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +1435 -1433
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +3942 -3964
- package/dist/assets/components/nurbs.min.js +1 -2
- package/dist/assets/components/particle-systems.js +3227 -3238
- package/dist/assets/components/particle-systems.min.js +1 -2
- package/dist/assets/components/picking.js +1704 -1712
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +553 -553
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +3255 -3265
- package/dist/assets/components/rigid-body-physics.min.js +1 -59
- package/dist/assets/components/scripting.js +544 -549
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +2716 -2651
- package/dist/assets/components/texturing-3d.min.js +131 -48
- package/dist/assets/components/volume-rendering.js +2815 -2804
- package/dist/assets/components/volume-rendering.min.js +1 -3
- package/dist/assets/components/x_ite.js +142 -144
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/Gouraud.fs +52 -15
- package/dist/assets/shaders/webgl1/Gouraud.vs +8 -9
- package/dist/assets/shaders/webgl1/{Wireframe.fs → Line.fs} +0 -0
- package/dist/assets/shaders/webgl1/{Wireframe.vs → Line.vs} +1 -1
- package/dist/assets/shaders/webgl1/PBR.fs +785 -0
- package/dist/assets/shaders/webgl1/PBR.vs +37 -0
- package/dist/assets/shaders/webgl1/Phong.fs +204 -32
- package/dist/assets/shaders/webgl1/Phong.vs +2 -3
- package/dist/assets/shaders/webgl1/{PointSet.fs → Point.fs} +59 -33
- package/dist/assets/shaders/webgl1/{PointSet.vs → Point.vs} +2 -2
- package/dist/assets/shaders/webgl1/Unlit.fs +73 -18
- package/dist/assets/shaders/webgl1/Unlit.vs +2 -3
- package/dist/assets/shaders/webgl2/Gouraud.fs +31 -19
- package/dist/assets/shaders/webgl2/Gouraud.vs +8 -9
- package/dist/assets/shaders/webgl2/{Wireframe.fs → Line.fs} +0 -0
- package/dist/assets/shaders/webgl2/{Wireframe.vs → Line.vs} +1 -1
- package/dist/assets/shaders/webgl2/PBR.fs +913 -0
- package/dist/assets/shaders/webgl2/PBR.vs +37 -0
- package/dist/assets/shaders/webgl2/Phong.fs +196 -35
- package/dist/assets/shaders/webgl2/Phong.vs +2 -3
- package/dist/assets/shaders/webgl2/{PointSet.fs → Point.fs} +87 -86
- package/dist/assets/shaders/webgl2/{PointSet.vs → Point.vs} +2 -2
- package/dist/assets/shaders/webgl2/Unlit.fs +55 -22
- package/dist/assets/shaders/webgl2/Unlit.vs +2 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +316 -328
- package/dist/x_ite.js +55663 -52034
- package/dist/x_ite.min.js +79 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Custom-Shaders.md +4 -3
- package/docs/_config.yml +1 -1
- package/docs/index.md +60 -7
- package/package.json +20 -20
- package/src/assets/components/annotation.js +24 -24
- package/src/assets/components/cad-geometry.js +24 -25
- package/src/assets/components/cube-map-texturing.js +18 -19
- package/src/assets/components/dis.js +22 -23
- package/src/assets/components/event-utilities.js +28 -29
- package/src/assets/components/geometry2d.js +28 -29
- package/src/assets/components/geospatial.js +34 -35
- package/src/assets/components/h-anim.js +22 -22
- package/src/assets/components/key-device-sensor.js +18 -19
- package/src/assets/components/layout.js +24 -25
- package/src/assets/components/nurbs.js +44 -45
- package/src/assets/components/particle-systems.js +36 -37
- package/src/assets/components/picking.js +25 -25
- package/src/assets/components/projective-texture-mapping.js +16 -16
- package/src/assets/components/rigid-body-physics.js +48 -48
- package/src/assets/components/scripting.js +14 -15
- package/src/assets/components/texturing-3d.js +26 -27
- package/src/assets/components/volume-rendering.js +46 -46
- package/src/assets/components/x_ite.js +12 -12
- package/src/assets/shaders/Types.glsl +230 -51
- package/src/assets/shaders/webgl1/Background.fs +2 -2
- package/src/assets/shaders/webgl1/Background.vs +4 -4
- package/src/assets/shaders/webgl1/Depth.fs +2 -2
- package/src/assets/shaders/webgl1/Depth.vs +3 -3
- package/src/assets/shaders/webgl1/Fallback.fs +15 -15
- package/src/assets/shaders/webgl1/Fallback.vs +5 -5
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +4 -4
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +3 -3
- package/src/assets/shaders/webgl1/Gouraud.fs +14 -14
- package/src/assets/shaders/webgl1/Gouraud.vs +54 -69
- package/src/assets/shaders/webgl1/Line.fs +74 -0
- package/src/assets/shaders/webgl1/Line.vs +63 -0
- package/src/assets/shaders/webgl1/PBR.fs +364 -0
- package/src/assets/shaders/webgl1/PBR.vs +46 -0
- package/src/assets/shaders/webgl1/Phong.fs +207 -84
- package/src/assets/shaders/webgl1/Phong.vs +17 -18
- package/src/assets/shaders/webgl1/Point.fs +88 -0
- package/src/assets/shaders/webgl1/Point.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +53 -28
- package/src/assets/shaders/webgl1/Unlit.vs +17 -18
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +7 -7
- package/src/assets/shaders/webgl1/include/Colors.glsl +27 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +17 -17
- package/src/assets/shaders/webgl1/include/Hatch.glsl +8 -8
- package/src/assets/shaders/webgl1/include/Normal.glsl +44 -0
- package/src/assets/shaders/webgl1/include/Pack.glsl +11 -11
- package/src/assets/shaders/webgl1/include/Perlin.glsl +19 -19
- package/src/assets/shaders/webgl1/include/Shadow.glsl +212 -212
- package/src/assets/shaders/webgl1/include/SpotFactor.glsl +12 -0
- package/src/assets/shaders/webgl1/include/Texture.glsl +444 -393
- package/src/assets/shaders/webgl2/Background.fs +2 -2
- package/src/assets/shaders/webgl2/Background.vs +4 -4
- package/src/assets/shaders/webgl2/Depth.fs +2 -2
- package/src/assets/shaders/webgl2/Depth.vs +3 -3
- package/src/assets/shaders/webgl2/Gouraud.fs +14 -14
- package/src/assets/shaders/webgl2/Gouraud.vs +54 -69
- package/src/assets/shaders/webgl2/Line.fs +73 -0
- package/src/assets/shaders/webgl2/Line.vs +64 -0
- package/src/assets/shaders/webgl2/PBR.fs +370 -0
- package/src/assets/shaders/webgl2/PBR.vs +48 -0
- package/src/assets/shaders/webgl2/Phong.fs +219 -84
- package/src/assets/shaders/webgl2/Phong.vs +17 -18
- package/src/assets/shaders/webgl2/Point.fs +87 -0
- package/src/assets/shaders/webgl2/Point.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +56 -28
- package/src/assets/shaders/webgl2/Unlit.vs +17 -18
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +7 -7
- package/src/assets/shaders/webgl2/include/Colors.glsl +27 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +34 -34
- package/src/assets/shaders/webgl2/include/Hatch.glsl +8 -8
- package/src/assets/shaders/webgl2/include/Normal.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +11 -11
- package/src/assets/shaders/webgl2/include/Perlin.glsl +19 -20
- package/src/assets/shaders/webgl2/include/Shadow.glsl +226 -226
- package/src/assets/shaders/webgl2/include/SpotFactor.glsl +12 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +557 -537
- package/src/bookmarks.js +92 -92
- package/src/examples.js +147 -147
- package/src/lib/ammojs/AmmoJS.js +2 -2
- package/src/lib/ammojs/Makefile +14 -15
- package/src/lib/jquery.fullscreen-min.js +2 -2
- package/src/lib/nurbs/extras/sample.js +215 -215
- package/src/lib/nurbs/nurbs.js +326 -326
- package/src/lib/nurbs/src/evaluate.js +405 -405
- package/src/lib/nurbs/src/numerical-derivative.js +48 -48
- package/src/lib/nurbs/src/support.js +143 -143
- package/src/lib/nurbs/src/transform.js +70 -70
- package/src/lib/nurbs/src/utils/accessor-preamble.js +23 -23
- package/src/lib/nurbs/src/utils/bisection-search.js +18 -18
- package/src/lib/nurbs/src/utils/cache-key.js +49 -50
- package/src/lib/nurbs/src/utils/create-accessors.js +101 -101
- package/src/lib/nurbs/src/utils/infer-type.js +43 -43
- package/src/lib/nurbs/src/utils/is-array-like.js +5 -5
- package/src/lib/nurbs/src/utils/is-ndarray-like.js +11 -11
- package/src/lib/nurbs/src/utils/is-ndarray.js +13 -13
- package/src/lib/nurbs/src/utils/ndloop.js +18 -18
- package/src/lib/nurbs/src/utils/size-getter.js +15 -15
- package/src/lib/nurbs/src/utils/variable.js +25 -25
- package/src/lib/opentype.js/bin/ot +27 -27
- package/src/lib/opentype.js/dist/opentype.js +5 -5
- package/src/lib/opentype.js/font-inspector.html +1 -1
- package/src/lib/opentype.js/site.css +1 -3
- package/src/locale/gettext.js +73 -73
- package/src/spinner.css +40 -43
- package/src/standard/Geospatial/Geodetic.js +195 -195
- package/src/standard/Geospatial/ReferenceEllipsoids.js +43 -43
- package/src/standard/Geospatial/UniversalTransverseMercator.js +159 -159
- package/src/standard/Math/Algorithm.js +199 -187
- package/src/standard/Math/Algorithms/Bezier.js +80 -80
- package/src/standard/Math/Algorithms/MergeSort.js +49 -49
- package/src/standard/Math/Algorithms/PartialSort.js +36 -36
- package/src/standard/Math/Algorithms/QuickSort.js +51 -51
- package/src/standard/Math/Algorithms/SAT.js +62 -62
- package/src/standard/Math/Algorithms/eigendecomposition.js +141 -141
- package/src/standard/Math/Geometry/Box2.js +205 -205
- package/src/standard/Math/Geometry/Box3.js +624 -624
- package/src/standard/Math/Geometry/Camera.js +68 -68
- package/src/standard/Math/Geometry/Cylinder3.js +112 -112
- package/src/standard/Math/Geometry/Line3.js +188 -153
- package/src/standard/Math/Geometry/Plane3.js +120 -120
- package/src/standard/Math/Geometry/Sphere3.js +148 -148
- package/src/standard/Math/Geometry/Spheroid3.js +38 -38
- package/src/standard/Math/Geometry/Triangle2.js +19 -19
- package/src/standard/Math/Geometry/Triangle3.js +148 -148
- package/src/standard/Math/Geometry/ViewVolume.js +359 -359
- package/src/standard/Math/Numbers/Color3.js +219 -214
- package/src/standard/Math/Numbers/Color4.js +148 -142
- package/src/standard/Math/Numbers/Complex.js +139 -139
- package/src/standard/Math/Numbers/Matrix2.js +193 -193
- package/src/standard/Math/Numbers/Matrix3.js +679 -679
- package/src/standard/Math/Numbers/Matrix4.js +883 -883
- package/src/standard/Math/Numbers/Quaternion.js +496 -496
- package/src/standard/Math/Numbers/Rotation4.js +421 -415
- package/src/standard/Math/Numbers/Vector2.js +220 -220
- package/src/standard/Math/Numbers/Vector3.js +280 -280
- package/src/standard/Math/Numbers/Vector4.js +296 -296
- package/src/standard/Math/Utility/BVH.js +303 -303
- package/src/standard/Math/Utility/MatrixStack.js +64 -64
- package/src/standard/Networking/BinaryTransport.js +67 -67
- package/src/standard/Time/MicroTime.js +22 -22
- package/src/standard/Utility/DataStorage.js +85 -81
- package/src/standard/Utility/MapUtilities.js +14 -1
- package/src/standard/Utility/ObjectCache.js +24 -24
- package/src/standard/Utility/Shuffle.js +13 -13
- package/src/tests.js +355 -384
- package/src/x_ite/Base/Events.js +64 -55
- package/src/x_ite/{Basic/X3DArrayField.js → Base/FieldArray.js} +19 -12
- package/src/x_ite/Base/FieldDefinitionArray.js +75 -0
- package/src/x_ite/{Basic/FieldDefinitionArray.js → Base/X3DArrayField.js} +35 -59
- package/src/x_ite/Base/X3DBaseNode.js +588 -0
- package/src/x_ite/{Bits → Base}/X3DCast.js +23 -22
- package/src/x_ite/Base/X3DChildObject.js +68 -62
- package/src/x_ite/{Bits → Base}/X3DConstants.js +85 -85
- package/src/x_ite/Base/X3DEventObject.js +73 -68
- package/src/x_ite/Base/X3DField.js +450 -0
- package/src/x_ite/Base/X3DFieldDefinition.js +78 -0
- package/src/x_ite/Base/X3DInfoArray.js +291 -0
- package/src/x_ite/Base/X3DObject.js +152 -109
- package/src/x_ite/Base/X3DObjectArrayField.js +573 -0
- package/src/x_ite/Base/X3DTypedArrayField.js +866 -0
- package/src/x_ite/Browser/Core/BrowserOptions.js +376 -394
- package/src/x_ite/Browser/Core/BrowserProperties.js +38 -38
- package/src/x_ite/Browser/Core/BrowserTimings.js +173 -172
- package/src/x_ite/Browser/Core/ContextMenu.js +547 -551
- package/src/x_ite/Browser/Core/Notification.js +57 -56
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +8 -8
- package/src/x_ite/Browser/Core/RenderingProperties.js +55 -55
- package/src/x_ite/Browser/Core/Shading.js +10 -10
- package/src/x_ite/Browser/Core/TextureQuality.js +8 -8
- package/src/x_ite/Browser/Core/X3DCoreContext.js +746 -724
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +33 -25
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +23 -23
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +127 -127
- package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +25 -25
- package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +25 -25
- package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +56 -55
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +116 -116
- package/src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js +59 -59
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +80 -77
- package/src/x_ite/Browser/Geometry3D/BoxOptions.js +70 -70
- package/src/x_ite/Browser/Geometry3D/ConeOptions.js +26 -26
- package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +27 -27
- package/src/x_ite/Browser/Geometry3D/IcoSphere.js +357 -357
- package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +61 -61
- package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +243 -241
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +37 -34
- package/src/x_ite/Browser/Geospatial/Geocentric.js +27 -27
- package/src/x_ite/Browser/Geospatial/Geospatial.js +157 -156
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +38 -33
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator.js +128 -130
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1.js +39 -41
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2.js +3 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3.js +3 -3
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +54 -56
- package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +54 -56
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +44 -41
- package/src/x_ite/Browser/Layering/X3DLayeringContext.js +20 -18
- package/src/x_ite/Browser/Layout/ScreenText.js +406 -405
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +36 -30
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +54 -50
- package/src/x_ite/Browser/NURBS/NURBS.js +417 -417
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +753 -753
- package/src/x_ite/Browser/Navigation/FlyViewer.js +39 -39
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +461 -461
- package/src/x_ite/Browser/Navigation/NoneViewer.js +18 -18
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +193 -193
- package/src/x_ite/Browser/Navigation/WalkViewer.js +61 -61
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +709 -710
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +188 -182
- package/src/x_ite/Browser/Navigation/X3DViewer.js +160 -160
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +152 -143
- package/src/x_ite/Browser/Networking/urls.js +31 -31
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +17 -13
- package/src/x_ite/Browser/Picking/IntersectionType.js +7 -7
- package/src/x_ite/Browser/Picking/MatchCriterion.js +8 -8
- package/src/x_ite/Browser/Picking/SortOrder.js +9 -9
- package/src/x_ite/Browser/Picking/VolumePicker.js +138 -138
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +80 -69
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +208 -209
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer.js +34 -34
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +269 -263
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +132 -119
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +14 -14
- package/src/x_ite/Browser/Scripting/X3DScriptingContext.js +20 -19
- package/src/x_ite/Browser/Scripting/evaluate.js +7 -7
- package/src/x_ite/Browser/Shaders/Shader.js +152 -159
- package/src/x_ite/Browser/Shaders/ShaderSource.js +81 -63
- package/src/x_ite/Browser/Shaders/ShaderTest.js +97 -98
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +256 -249
- package/src/x_ite/Browser/Shape/AlphaMode.js +9 -9
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +111 -89
- package/src/x_ite/Browser/Sound/X3DSoundContext.js +11 -11
- package/src/x_ite/Browser/Text/PolygonText.js +319 -319
- package/src/x_ite/Browser/Text/TextAlignment.js +9 -9
- package/src/x_ite/Browser/Text/X3DTextContext.js +72 -65
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +506 -506
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +8 -8
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +25 -25
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +9 -9
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +17 -17
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +259 -224
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1066 -1066
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +641 -630
- package/src/x_ite/Browser/Time/X3DTimeContext.js +54 -37
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +55 -55
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +5 -5
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +52 -41
- package/src/x_ite/Browser/X3DBrowser.js +819 -755
- package/src/x_ite/Browser/X3DBrowserContext.js +253 -220
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +43 -43
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +38 -38
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +48 -48
- package/src/x_ite/Components/Annotation/IconAnnotation.js +46 -46
- package/src/x_ite/Components/Annotation/TextAnnotation.js +39 -39
- package/src/x_ite/Components/Annotation/URLAnnotation.js +38 -38
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +16 -16
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +41 -41
- package/src/x_ite/Components/CADGeometry/CADFace.js +189 -189
- package/src/x_ite/Components/CADGeometry/CADLayer.js +38 -38
- package/src/x_ite/Components/CADGeometry/CADPart.js +46 -46
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +67 -67
- package/src/x_ite/Components/CADGeometry/QuadSet.js +64 -63
- package/src/x_ite/Components/CADGeometry/X3DProductStructureChildNode.js +13 -15
- package/src/x_ite/Components/Core/MetadataBoolean.js +38 -40
- package/src/x_ite/Components/Core/MetadataDouble.js +38 -40
- package/src/x_ite/Components/Core/MetadataFloat.js +38 -40
- package/src/x_ite/Components/Core/MetadataInteger.js +38 -40
- package/src/x_ite/Components/Core/MetadataSet.js +38 -40
- package/src/x_ite/Components/Core/MetadataString.js +38 -40
- package/src/x_ite/Components/Core/WorldInfo.js +42 -42
- package/src/x_ite/Components/Core/X3DBindableNode.js +20 -20
- package/src/x_ite/Components/Core/X3DChildNode.js +38 -40
- package/src/x_ite/Components/Core/X3DInfoNode.js +13 -15
- package/src/x_ite/Components/Core/X3DMetadataObject.js +11 -13
- package/src/x_ite/Components/Core/X3DNode.js +795 -14
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +585 -479
- package/src/x_ite/Components/Core/X3DSensorNode.js +13 -15
- package/src/x_ite/Components/Core.js +39 -39
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +193 -200
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +209 -206
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +213 -219
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +69 -60
- package/src/x_ite/Components/DIS/DISEntityManager.js +38 -40
- package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +59 -41
- package/src/x_ite/Components/DIS/EspduTransform.js +128 -128
- package/src/x_ite/Components/DIS/ReceiverPdu.js +68 -68
- package/src/x_ite/Components/DIS/SignalPdu.js +68 -68
- package/src/x_ite/Components/DIS/TransmitterPdu.js +84 -84
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +87 -89
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +59 -59
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +78 -78
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +56 -56
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +86 -88
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +582 -589
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +105 -105
- package/src/x_ite/Components/EnvironmentalEffects.js +25 -25
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +229 -229
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +256 -256
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +114 -114
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +71 -71
- package/src/x_ite/Components/EnvironmentalSensor.js +19 -19
- package/src/x_ite/Components/EventUtilities/BooleanFilter.js +50 -52
- package/src/x_ite/Components/EventUtilities/BooleanSequencer.js +50 -52
- package/src/x_ite/Components/EventUtilities/BooleanToggle.js +43 -45
- package/src/x_ite/Components/EventUtilities/BooleanTrigger.js +42 -44
- package/src/x_ite/Components/EventUtilities/IntegerSequencer.js +50 -52
- package/src/x_ite/Components/EventUtilities/IntegerTrigger.js +43 -45
- package/src/x_ite/Components/EventUtilities/TimeTrigger.js +43 -45
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +92 -94
- package/src/x_ite/Components/EventUtilities/X3DTriggerNode.js +13 -15
- package/src/x_ite/Components/Followers/ColorChaser.js +78 -78
- package/src/x_ite/Components/Followers/ColorDamper.js +78 -78
- package/src/x_ite/Components/Followers/CoordinateChaser.js +46 -46
- package/src/x_ite/Components/Followers/CoordinateDamper.js +48 -48
- package/src/x_ite/Components/Followers/OrientationChaser.js +64 -64
- package/src/x_ite/Components/Followers/OrientationDamper.js +61 -61
- package/src/x_ite/Components/Followers/PositionChaser.js +42 -42
- package/src/x_ite/Components/Followers/PositionChaser2D.js +42 -42
- package/src/x_ite/Components/Followers/PositionDamper.js +44 -44
- package/src/x_ite/Components/Followers/PositionDamper2D.js +44 -44
- package/src/x_ite/Components/Followers/ScalarChaser.js +70 -70
- package/src/x_ite/Components/Followers/ScalarDamper.js +60 -60
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +46 -46
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +48 -48
- package/src/x_ite/Components/Followers/X3DChaserNode.js +194 -194
- package/src/x_ite/Components/Followers/X3DDamperNode.js +120 -120
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +83 -83
- package/src/x_ite/Components/Followers.js +45 -45
- package/src/x_ite/Components/Geometry2D/Arc2D.js +99 -113
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +164 -166
- package/src/x_ite/Components/Geometry2D/Circle2D.js +59 -67
- package/src/x_ite/Components/Geometry2D/Disk2D.js +207 -211
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +43 -52
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +43 -60
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +76 -73
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +69 -71
- package/src/x_ite/Components/Geometry3D/Box.js +90 -86
- package/src/x_ite/Components/Geometry3D/Cone.js +185 -187
- package/src/x_ite/Components/Geometry3D/Cylinder.js +246 -246
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +383 -384
- package/src/x_ite/Components/Geometry3D/Extrusion.js +653 -647
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +437 -445
- package/src/x_ite/Components/Geometry3D/Sphere.js +72 -74
- package/src/x_ite/Components/Geometry3D.js +25 -25
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +189 -191
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +381 -383
- package/src/x_ite/Components/Geospatial/GeoLOD.js +397 -397
- package/src/x_ite/Components/Geospatial/GeoLocation.js +56 -56
- package/src/x_ite/Components/Geospatial/GeoMetadata.js +54 -36
- package/src/x_ite/Components/Geospatial/GeoOrigin.js +50 -52
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +81 -83
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +95 -97
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +77 -79
- package/src/x_ite/Components/Geospatial/GeoTransform.js +79 -79
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +278 -278
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +216 -218
- package/src/x_ite/Components/Grouping/Group.js +37 -37
- package/src/x_ite/Components/Grouping/StaticGroup.js +245 -245
- package/src/x_ite/Components/Grouping/Switch.js +234 -234
- package/src/x_ite/Components/Grouping/Transform.js +42 -42
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +93 -93
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +654 -649
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +99 -99
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +31 -31
- package/src/x_ite/Components/Grouping.js +27 -27
- package/src/x_ite/Components/HAnim/HAnimDisplacer.js +35 -35
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +293 -293
- package/src/x_ite/Components/HAnim/HAnimJoint.js +137 -137
- package/src/x_ite/Components/HAnim/HAnimMotion.js +50 -50
- package/src/x_ite/Components/HAnim/HAnimSegment.js +44 -44
- package/src/x_ite/Components/HAnim/HAnimSite.js +43 -43
- package/src/x_ite/Components/Interpolation/ColorInterpolator.js +61 -63
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator.js +60 -62
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator2D.js +57 -59
- package/src/x_ite/Components/Interpolation/EaseInEaseOut.js +79 -80
- package/src/x_ite/Components/Interpolation/NormalInterpolator.js +96 -93
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +70 -70
- package/src/x_ite/Components/Interpolation/PositionInterpolator.js +57 -59
- package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +57 -59
- package/src/x_ite/Components/Interpolation/ScalarInterpolator.js +53 -55
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator.js +78 -80
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator2D.js +77 -79
- package/src/x_ite/Components/Interpolation/SplineScalarInterpolator.js +78 -80
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +66 -66
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +67 -69
- package/src/x_ite/Components/Interpolation.js +39 -39
- package/src/x_ite/Components/KeyDeviceSensor/KeySensor.js +304 -306
- package/src/x_ite/Components/KeyDeviceSensor/StringSensor.js +102 -104
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +51 -51
- package/src/x_ite/Components/Layering/Layer.js +50 -50
- package/src/x_ite/Components/Layering/LayerSet.js +160 -161
- package/src/x_ite/Components/Layering/Viewport.js +118 -118
- package/src/x_ite/Components/Layering/X3DLayerNode.js +322 -322
- package/src/x_ite/Components/Layering/X3DViewportNode.js +13 -13
- package/src/x_ite/Components/Layering.js +21 -21
- package/src/x_ite/Components/Layout/Layout.js +576 -578
- package/src/x_ite/Components/Layout/LayoutGroup.js +126 -126
- package/src/x_ite/Components/Layout/LayoutLayer.js +53 -53
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +48 -48
- package/src/x_ite/Components/Layout/ScreenGroup.js +136 -136
- package/src/x_ite/Components/Layout/X3DLayoutNode.js +12 -14
- package/src/x_ite/Components/Lighting/DirectionalLight.js +239 -246
- package/src/x_ite/Components/Lighting/PointLight.js +296 -303
- package/src/x_ite/Components/Lighting/SpotLight.js +321 -316
- package/src/x_ite/Components/Lighting/X3DLightNode.js +153 -153
- package/src/x_ite/Components/Lighting.js +19 -19
- package/src/x_ite/Components/NURBS/Contour2D.js +81 -83
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +100 -102
- package/src/x_ite/Components/NURBS/CoordinateDouble.js +32 -34
- package/src/x_ite/Components/NURBS/NurbsCurve.js +167 -169
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +149 -149
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +166 -166
- package/src/x_ite/Components/NURBS/NurbsPatchSurface.js +45 -47
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +154 -154
- package/src/x_ite/Components/NURBS/NurbsSet.js +125 -125
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +128 -130
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +93 -93
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +88 -90
- package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +13 -15
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +339 -339
- package/src/x_ite/Components/NURBS/X3DParametricGeometryNode.js +18 -20
- package/src/x_ite/Components/Navigation/Billboard.js +132 -132
- package/src/x_ite/Components/Navigation/Collision.js +116 -116
- package/src/x_ite/Components/Navigation/LOD.js +308 -308
- package/src/x_ite/Components/Navigation/NavigationInfo.js +279 -285
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +258 -258
- package/src/x_ite/Components/Navigation/Viewpoint.js +137 -137
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +169 -171
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +450 -453
- package/src/x_ite/Components/Navigation.js +27 -27
- package/src/x_ite/Components/Networking/Anchor.js +140 -128
- package/src/x_ite/Components/Networking/Inline.js +156 -197
- package/src/x_ite/Components/Networking/LoadSensor.js +193 -195
- package/src/x_ite/Components/Networking/X3DNetworkSensorNode.js +13 -15
- package/src/x_ite/Components/Networking/X3DUrlObject.js +170 -116
- package/src/x_ite/Components/Networking.js +21 -21
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +62 -64
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +81 -83
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +59 -61
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +42 -44
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +1433 -1433
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +77 -79
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +196 -196
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +195 -195
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +250 -250
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +69 -71
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +346 -346
- package/src/x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode.js +15 -17
- package/src/x_ite/Components/Picking/LinePickSensor.js +284 -286
- package/src/x_ite/Components/Picking/PickableGroup.js +155 -155
- package/src/x_ite/Components/Picking/PointPickSensor.js +272 -272
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +207 -209
- package/src/x_ite/Components/Picking/VolumePickSensor.js +182 -184
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +382 -382
- package/src/x_ite/Components/Picking/X3DPickableObject.js +28 -30
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +257 -259
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +245 -247
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +173 -175
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +61 -63
- package/src/x_ite/Components/PointingDeviceSensor/X3DDragSensorNode.js +14 -16
- package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +57 -59
- package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +19 -21
- package/src/x_ite/Components/PointingDeviceSensor.js +25 -25
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +191 -191
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +162 -162
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +156 -156
- package/src/x_ite/Components/Rendering/ClipPlane.js +120 -120
- package/src/x_ite/Components/Rendering/Color.js +112 -112
- package/src/x_ite/Components/Rendering/ColorRGBA.js +114 -114
- package/src/x_ite/Components/Rendering/Coordinate.js +33 -35
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +236 -243
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +102 -102
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +55 -55
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +110 -110
- package/src/x_ite/Components/Rendering/LineSet.js +172 -179
- package/src/x_ite/Components/Rendering/Normal.js +100 -100
- package/src/x_ite/Components/Rendering/PointSet.js +142 -154
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +73 -73
- package/src/x_ite/Components/Rendering/TriangleSet.js +51 -53
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +76 -76
- package/src/x_ite/Components/Rendering/X3DColorNode.js +25 -27
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +318 -321
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +132 -132
- package/src/x_ite/Components/Rendering/X3DGeometricPropertyNode.js +13 -15
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +1190 -1171
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +231 -189
- package/src/x_ite/Components/Rendering/X3DNormalNode.js +13 -15
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +267 -0
- package/src/x_ite/Components/Rendering.js +53 -53
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +149 -149
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +229 -229
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +465 -465
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +152 -154
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +223 -223
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +117 -117
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +54 -56
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +245 -245
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +68 -70
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +453 -453
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +326 -326
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +171 -171
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +169 -169
- package/src/x_ite/Components/RigidBodyPhysics/UniversalJoint.js +50 -52
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +101 -101
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +15 -15
- package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +161 -163
- package/src/x_ite/Components/Scripting/Script.js +506 -510
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +15 -15
- package/src/x_ite/Components/Shaders/ComposedShader.js +215 -178
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +84 -83
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +74 -74
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +73 -73
- package/src/x_ite/Components/Shaders/PackagedShader.js +52 -49
- package/src/x_ite/Components/Shaders/ProgramShader.js +36 -38
- package/src/x_ite/Components/Shaders/ShaderPart.js +135 -147
- package/src/x_ite/Components/Shaders/ShaderProgram.js +49 -46
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1259 -1255
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +83 -93
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +13 -15
- package/src/x_ite/Components/Shaders.js +33 -33
- package/src/x_ite/{Execution/ExportedNode.js → Components/Shape/AcousticProperties.js} +41 -71
- package/src/x_ite/Components/Shape/Appearance.js +331 -318
- package/src/x_ite/Components/Shape/FillProperties.js +101 -98
- package/src/x_ite/Components/Shape/LineProperties.js +71 -69
- package/src/x_ite/Components/Shape/Material.js +344 -116
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +310 -0
- package/src/x_ite/Components/Shape/PointProperties.js +79 -95
- package/src/x_ite/Components/Shape/Shape.js +178 -181
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +200 -200
- package/src/x_ite/Components/Shape/UnlitMaterial.js +93 -46
- package/src/x_ite/Components/Shape/X3DAppearanceChildNode.js +13 -15
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +24 -24
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +24 -24
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +158 -54
- package/src/x_ite/Components/Shape/X3DShapeNode.js +147 -147
- package/src/x_ite/Components/Shape.js +43 -37
- package/src/x_ite/Components/Sound/AudioClip.js +135 -140
- package/src/x_ite/Components/Sound/Sound.js +246 -246
- package/src/x_ite/Components/Sound/X3DSoundNode.js +13 -15
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +165 -179
- package/src/x_ite/Components/Sound.js +19 -19
- package/src/x_ite/Components/Text/FontStyle.js +49 -49
- package/src/x_ite/Components/Text/Text.js +135 -135
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +207 -205
- package/src/x_ite/Components/Text.js +17 -17
- package/src/x_ite/Components/Texturing/ImageTexture.js +181 -194
- package/src/x_ite/Components/Texturing/MovieTexture.js +180 -190
- package/src/x_ite/Components/Texturing/MultiTexture.js +255 -262
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +124 -118
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +82 -76
- package/src/x_ite/Components/Texturing/PixelTexture.js +222 -221
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +116 -116
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +90 -90
- package/src/x_ite/Components/Texturing/TextureProperties.js +158 -160
- package/src/x_ite/Components/Texturing/TextureTransform.js +99 -99
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +33 -28
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +54 -54
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +22 -17
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +135 -124
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +16 -16
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +24 -24
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +22 -22
- package/src/x_ite/Components/Texturing.js +45 -45
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +125 -123
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +115 -131
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +158 -160
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +116 -116
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +116 -116
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +88 -88
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +46 -46
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +135 -121
- package/src/x_ite/Components/Time/TimeSensor.js +155 -152
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +299 -302
- package/src/x_ite/Components/Time.js +15 -15
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +338 -338
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +80 -80
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +228 -228
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +163 -163
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +117 -117
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +334 -334
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +116 -116
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +167 -167
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +247 -247
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +198 -198
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +116 -116
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +126 -126
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +173 -173
- package/src/x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode.js +12 -12
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +167 -167
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +70 -70
- package/src/x_ite/Components/X_ITE/BlendMode.js +143 -145
- package/src/x_ite/Components.js +47 -47
- package/src/x_ite/Configuration/ComponentInfo.js +47 -42
- package/src/x_ite/Configuration/ComponentInfoArray.js +21 -19
- package/src/x_ite/Configuration/ProfileInfo.js +33 -23
- package/src/x_ite/Configuration/ProfileInfoArray.js +26 -16
- package/src/x_ite/Configuration/SupportedComponents.js +311 -311
- package/src/x_ite/Configuration/SupportedNodes.js +53 -38
- package/src/x_ite/Configuration/SupportedProfiles.js +190 -190
- package/src/x_ite/Configuration/UnitInfo.js +60 -51
- package/src/x_ite/Configuration/UnitInfoArray.js +17 -10
- package/src/x_ite/DEBUG.js +2 -2
- package/src/x_ite/Execution/BindableList.js +146 -149
- package/src/x_ite/Execution/BindableStack.js +130 -123
- package/src/x_ite/Execution/ExportedNodesArray.js +75 -0
- package/src/x_ite/Execution/ImportedNodesArray.js +75 -0
- package/src/x_ite/{Basic/X3DFieldDefinition.js → Execution/NamedNodesArray.js} +20 -10
- package/src/x_ite/Execution/Scene.js +93 -90
- package/src/x_ite/Execution/X3DExecutionContext.js +957 -781
- package/src/x_ite/Execution/X3DExportedNode.js +152 -0
- package/src/x_ite/Execution/X3DImportedNode.js +393 -0
- package/src/x_ite/Execution/X3DScene.js +546 -493
- package/src/x_ite/Execution/X3DWorld.js +171 -0
- package/src/x_ite/Fallback.js +31 -31
- package/src/x_ite/Fields/ArrayFields.js +463 -443
- package/src/x_ite/Fields/SFBool.js +50 -47
- package/src/x_ite/Fields/SFColor.js +163 -160
- package/src/x_ite/Fields/SFColorRGBA.js +155 -152
- package/src/x_ite/Fields/SFDouble.js +51 -48
- package/src/x_ite/Fields/SFFloat.js +51 -48
- package/src/x_ite/Fields/SFImage.js +216 -213
- package/src/x_ite/Fields/SFInt32.js +47 -44
- package/src/x_ite/Fields/SFMatrix3.js +74 -71
- package/src/x_ite/Fields/SFMatrix4.js +68 -65
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +98 -98
- package/src/x_ite/Fields/SFNode.js +392 -299
- package/src/x_ite/Fields/SFNodeCache.js +22 -33
- package/src/x_ite/Fields/SFRotation.js +178 -175
- package/src/x_ite/Fields/SFString.js +71 -68
- package/src/x_ite/Fields/SFTime.js +47 -44
- package/src/x_ite/Fields/SFVec2.js +73 -70
- package/src/x_ite/Fields/SFVec3.js +105 -102
- package/src/x_ite/Fields/SFVec4.js +118 -115
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +94 -94
- package/src/x_ite/Fields.js +44 -44
- package/src/x_ite/InputOutput/FileLoader.js +426 -531
- package/src/x_ite/InputOutput/Generator.js +379 -376
- package/src/x_ite/{Configuration/X3DInfoArray.js → Parser/GoldenGate.js} +54 -86
- package/src/x_ite/Parser/HTMLSupport.js +28 -6
- package/src/x_ite/Parser/JSONParser.js +414 -388
- package/src/x_ite/Parser/VRMLParser.js +2964 -0
- package/src/x_ite/Parser/X3DParser.js +128 -128
- package/src/x_ite/Parser/XMLParser.js +1231 -1178
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -27
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -27
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +279 -297
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +264 -263
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +58 -35
- package/src/x_ite/Rendering/DependentRenderer.js +83 -80
- package/src/x_ite/Rendering/TextureBuffer.js +171 -168
- package/src/x_ite/{Bits → Rendering}/TraverseType.js +11 -11
- package/src/x_ite/Rendering/X3DRenderObject.js +895 -906
- package/src/x_ite/Routing/RouteArray.js +19 -71
- package/src/x_ite/Routing/X3DRoute.js +185 -179
- package/src/x_ite/Routing/X3DRoutingContext.js +60 -54
- package/src/x_ite/X3D.js +191 -175
- package/src/x_ite.config.js +83 -83
- package/src/x_ite.css +279 -288
- package/src/x_ite.html +226 -193
- package/src/x_ite.js +100 -127
- package/x_ite.min.html +220 -187
- package/src/assets/shaders/webgl1/PointSet.fs +0 -100
- package/src/assets/shaders/webgl1/PointSet.vs +0 -70
- package/src/assets/shaders/webgl1/Wireframe.fs +0 -74
- package/src/assets/shaders/webgl1/Wireframe.vs +0 -63
- package/src/assets/shaders/webgl2/PointSet.fs +0 -99
- package/src/assets/shaders/webgl2/PointSet.vs +0 -71
- package/src/assets/shaders/webgl2/Wireframe.fs +0 -73
- package/src/assets/shaders/webgl2/Wireframe.vs +0 -64
- package/src/x_ite/Basic/X3DBaseNode.js +0 -1253
- package/src/x_ite/Basic/X3DField.js +0 -370
- package/src/x_ite/Basic/X3DObjectArrayField.js +0 -545
- package/src/x_ite/Basic/X3DTypedArrayField.js +0 -839
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +0 -714
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +0 -209
- package/src/x_ite/Execution/ImportedNode.js +0 -375
- package/src/x_ite/Execution/World.js +0 -162
- package/src/x_ite/Parser/Parser.js +0 -2944
|
@@ -48,23 +48,21 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
define ([
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"standard/Math/Utility/MatrixStack",
|
|
51
|
+
"x_ite/Rendering/TextureBuffer",
|
|
52
|
+
"x_ite/Rendering/TraverseType",
|
|
53
|
+
"standard/Math/Algorithm",
|
|
54
|
+
"standard/Math/Algorithms/MergeSort",
|
|
55
|
+
"standard/Math/Geometry/Camera",
|
|
56
|
+
"standard/Math/Geometry/Box3",
|
|
57
|
+
"standard/Math/Geometry/ViewVolume",
|
|
58
|
+
"standard/Math/Numbers/Vector3",
|
|
59
|
+
"standard/Math/Numbers/Vector4",
|
|
60
|
+
"standard/Math/Numbers/Rotation4",
|
|
61
|
+
"standard/Math/Numbers/Matrix4",
|
|
62
|
+
"standard/Math/Utility/MatrixStack",
|
|
64
63
|
],
|
|
65
|
-
function (
|
|
66
|
-
|
|
67
|
-
TraverseType,
|
|
64
|
+
function (TextureBuffer,
|
|
65
|
+
TraverseType,
|
|
68
66
|
Algorithm,
|
|
69
67
|
MergeSort,
|
|
70
68
|
Camera,
|
|
@@ -78,967 +76,958 @@ function ($,
|
|
|
78
76
|
{
|
|
79
77
|
"use strict";
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
79
|
+
const
|
|
80
|
+
DEPTH_BUFFER_WIDTH = 16,
|
|
81
|
+
DEPTH_BUFFER_HEIGHT = DEPTH_BUFFER_WIDTH;
|
|
82
|
+
|
|
83
|
+
function compareDistance (lhs, rhs) { return lhs .distance < rhs .distance; }
|
|
84
|
+
|
|
85
|
+
function X3DRenderObject (executionContext)
|
|
86
|
+
{
|
|
87
|
+
this .cameraSpaceMatrix = new MatrixStack (Matrix4);
|
|
88
|
+
this .viewMatrix = new MatrixStack (Matrix4);
|
|
89
|
+
this .projectionMatrix = new MatrixStack (Matrix4);
|
|
90
|
+
this .modelViewMatrix = new MatrixStack (Matrix4);
|
|
91
|
+
this .viewVolumes = [ ];
|
|
92
|
+
this .globalObjects = [ ];
|
|
93
|
+
this .localObjects = [ ];
|
|
94
|
+
this .lights = [ ];
|
|
95
|
+
this .shadow = [ false ];
|
|
96
|
+
this .localFogs = [ ];
|
|
97
|
+
this .layouts = [ ];
|
|
98
|
+
this .textureProjectors = [ ];
|
|
99
|
+
this .generatedCubeMapTextures = [ ];
|
|
100
|
+
this .shaders = new Set ();
|
|
101
|
+
this .collisions = [ ];
|
|
102
|
+
this .numOpaqueShapes = 0;
|
|
103
|
+
this .numTransparentShapes = 0;
|
|
104
|
+
this .numCollisionShapes = 0;
|
|
105
|
+
this .numDepthShapes = 0;
|
|
106
|
+
this .opaqueShapes = [ ];
|
|
107
|
+
this .transparentShapes = [ ];
|
|
108
|
+
this .transparencySorter = new MergeSort (this .transparentShapes, compareDistance);
|
|
109
|
+
this .collisionShapes = [ ];
|
|
110
|
+
this .activeCollisions = new Set ();
|
|
111
|
+
this .depthShapes = [ ];
|
|
112
|
+
this .speed = 0;
|
|
113
|
+
|
|
114
|
+
try
|
|
115
|
+
{
|
|
116
|
+
this .depthBuffer = new TextureBuffer (executionContext .getBrowser (), DEPTH_BUFFER_WIDTH, DEPTH_BUFFER_HEIGHT);
|
|
117
|
+
}
|
|
118
|
+
catch (error)
|
|
119
|
+
{
|
|
120
|
+
console .error (error);
|
|
121
|
+
|
|
122
|
+
this .getDepth = function () { return 0; };
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
X3DRenderObject .prototype =
|
|
127
|
+
{
|
|
128
|
+
constructor: X3DRenderObject,
|
|
129
|
+
initialize: function ()
|
|
130
|
+
{ },
|
|
131
|
+
isIndependent: function ()
|
|
132
|
+
{
|
|
133
|
+
return true;
|
|
134
|
+
},
|
|
135
|
+
getCameraSpaceMatrix: function ()
|
|
136
|
+
{
|
|
137
|
+
return this .cameraSpaceMatrix;
|
|
138
|
+
},
|
|
139
|
+
getViewMatrix: function ()
|
|
140
|
+
{
|
|
141
|
+
return this .viewMatrix;
|
|
142
|
+
},
|
|
143
|
+
getProjectionMatrix: function ()
|
|
144
|
+
{
|
|
145
|
+
return this .projectionMatrix;
|
|
146
|
+
},
|
|
147
|
+
getModelViewMatrix: function ()
|
|
148
|
+
{
|
|
149
|
+
return this .modelViewMatrix;
|
|
150
|
+
},
|
|
151
|
+
getViewVolumes: function ()
|
|
152
|
+
{
|
|
153
|
+
return this .viewVolumes;
|
|
154
|
+
},
|
|
155
|
+
getViewVolume: function ()
|
|
156
|
+
{
|
|
157
|
+
return this .viewVolumes .at (-1);
|
|
158
|
+
},
|
|
159
|
+
getGlobalObjects: function ()
|
|
160
|
+
{
|
|
161
|
+
return this .globalObjects;
|
|
162
|
+
},
|
|
163
|
+
getLocalObjects: function ()
|
|
164
|
+
{
|
|
165
|
+
return this .localObjects;
|
|
166
|
+
},
|
|
167
|
+
getLights: function ()
|
|
168
|
+
{
|
|
169
|
+
return this .lights;
|
|
170
|
+
},
|
|
171
|
+
pushShadow: function (value)
|
|
172
|
+
{
|
|
173
|
+
this .shadow .push (value || this .shadow .at (-1));
|
|
174
|
+
},
|
|
175
|
+
popShadow: function ()
|
|
176
|
+
{
|
|
177
|
+
this .shadow .pop ();
|
|
178
|
+
},
|
|
179
|
+
setGlobalFog: (function ()
|
|
180
|
+
{
|
|
181
|
+
const modelViewMatrix = new Matrix4 ();
|
|
182
|
+
|
|
183
|
+
return function (fog)
|
|
184
|
+
{
|
|
185
|
+
const fogContainer = this .localFogs [0] || fog .getFogs () .pop ();
|
|
186
|
+
|
|
187
|
+
modelViewMatrix .assign (fog .getModelMatrix ()) .multRight (this .getViewMatrix () .get ());
|
|
188
|
+
fogContainer .set (fog, modelViewMatrix);
|
|
189
|
+
|
|
190
|
+
this .localFog = this .localFogs [0] = fogContainer;
|
|
191
|
+
};
|
|
192
|
+
})(),
|
|
193
|
+
pushLocalFog: function (localFog)
|
|
194
|
+
{
|
|
195
|
+
this .localFogs .push (localFog);
|
|
196
|
+
|
|
197
|
+
this .localFog = localFog;
|
|
198
|
+
},
|
|
199
|
+
popLocalFog: function ()
|
|
200
|
+
{
|
|
201
|
+
const localFog = this .localFogs .pop ();
|
|
202
|
+
|
|
203
|
+
this .localFog = this .localFogs .at (-1);
|
|
204
|
+
|
|
205
|
+
return localFog;
|
|
206
|
+
},
|
|
207
|
+
getLayouts: function ()
|
|
208
|
+
{
|
|
209
|
+
return this .layouts;
|
|
210
|
+
},
|
|
211
|
+
getParentLayout: function ()
|
|
212
|
+
{
|
|
213
|
+
return this .layouts .at (-1);
|
|
214
|
+
},
|
|
215
|
+
getTextureProjectors: function ()
|
|
216
|
+
{
|
|
217
|
+
return this .textureProjectors;
|
|
218
|
+
},
|
|
219
|
+
getGeneratedCubeMapTextures: function ()
|
|
220
|
+
{
|
|
221
|
+
return this .generatedCubeMapTextures;
|
|
222
|
+
},
|
|
223
|
+
getShaders: function ()
|
|
224
|
+
{
|
|
225
|
+
return this .shaders;
|
|
226
|
+
},
|
|
227
|
+
getCollisions: function ()
|
|
228
|
+
{
|
|
229
|
+
return this .collisions;
|
|
230
|
+
},
|
|
231
|
+
setNumCollisionShapes: function (value)
|
|
232
|
+
{
|
|
233
|
+
this .numCollisionShapes = value;
|
|
234
|
+
},
|
|
235
|
+
getNumCollisionShapes: function ()
|
|
236
|
+
{
|
|
237
|
+
return this .numCollisionShapes;
|
|
238
|
+
},
|
|
239
|
+
getCollisionShapes: function ()
|
|
240
|
+
{
|
|
241
|
+
return this .collisionShapes;
|
|
242
|
+
},
|
|
243
|
+
setNumDepthShapes: function (value)
|
|
244
|
+
{
|
|
245
|
+
this .numDepthShapes = value;
|
|
246
|
+
},
|
|
247
|
+
getNumDepthShapes: function ()
|
|
248
|
+
{
|
|
249
|
+
return this .numDepthShapes;
|
|
250
|
+
},
|
|
251
|
+
getDepthShapes: function ()
|
|
252
|
+
{
|
|
253
|
+
return this .depthShapes;
|
|
254
|
+
},
|
|
255
|
+
setNumOpaqueShapes: function (value)
|
|
256
|
+
{
|
|
257
|
+
this .numOpaqueShapes = value;
|
|
258
|
+
},
|
|
259
|
+
getNumOpaqueShapes: function ()
|
|
260
|
+
{
|
|
261
|
+
return this .numOpaqueShapes;
|
|
262
|
+
},
|
|
263
|
+
getOpaqueShapes: function ()
|
|
264
|
+
{
|
|
265
|
+
return this .opaqueShapes;
|
|
266
|
+
},
|
|
267
|
+
setNumTransparentShapes: function (value)
|
|
268
|
+
{
|
|
269
|
+
this .numTransparentShapes = value;
|
|
270
|
+
},
|
|
271
|
+
getNumTransparentShapes: function ()
|
|
272
|
+
{
|
|
273
|
+
return this .numTransparentShapes;
|
|
274
|
+
},
|
|
275
|
+
getTransparentShapes: function ()
|
|
276
|
+
{
|
|
277
|
+
return this .transparentShapes;
|
|
278
|
+
},
|
|
279
|
+
constrainTranslation: function (translation, stepBack)
|
|
280
|
+
{
|
|
281
|
+
/// Contrains @a translation to a possible value the avatar can move. If the avatar reaches and intersects with an
|
|
282
|
+
/// and obstacle and @a stepBack is true a translation in the opposite directiion is returned. Future implementation will
|
|
283
|
+
/// will then return a value where the avatar slides along the wall. Modifies translation in place.
|
|
284
|
+
|
|
285
|
+
// Constrain translation when the viewer collides with an obstacle.
|
|
286
|
+
|
|
287
|
+
const distance = this .getDistance (translation) - this .getNavigationInfo () .getCollisionRadius ();
|
|
288
|
+
|
|
289
|
+
if (distance > 0)
|
|
290
|
+
{
|
|
291
|
+
// Move.
|
|
292
|
+
|
|
293
|
+
const length = translation .abs ();
|
|
294
|
+
|
|
295
|
+
if (length > distance)
|
|
296
|
+
{
|
|
297
|
+
// Collision, the avatar would intersect with the obstacle.
|
|
298
|
+
|
|
299
|
+
return translation .normalize () .multiply (distance);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Everything is fine.
|
|
303
|
+
|
|
304
|
+
return translation;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Collision, the avatar is already within an obstacle.
|
|
308
|
+
|
|
309
|
+
if (stepBack)
|
|
310
|
+
return this .constrainTranslation (translation .normalize () .multiply (distance), false);
|
|
311
|
+
|
|
312
|
+
return translation .assign (Vector3 .Zero);
|
|
313
|
+
},
|
|
314
|
+
getDistance: (function ()
|
|
315
|
+
{
|
|
316
|
+
const
|
|
317
|
+
projectionMatrix = new Matrix4 (),
|
|
318
|
+
cameraSpaceProjectionMatrix = new Matrix4 (),
|
|
319
|
+
localOrientation = new Rotation4 (0, 0, 1, 0),
|
|
320
|
+
vector = new Vector3 (0, 0, 0),
|
|
321
|
+
rotation = new Rotation4 (0, 0, 1, 0);
|
|
322
|
+
|
|
323
|
+
return function (direction)
|
|
324
|
+
{
|
|
325
|
+
/// Returns the distance to the closest object in @a direction. The maximum determinable value is avatarHeight * 2.
|
|
326
|
+
|
|
327
|
+
try
|
|
328
|
+
{
|
|
329
|
+
const t0 = performance .now ();
|
|
330
|
+
|
|
331
|
+
const
|
|
332
|
+
viewpoint = this .getViewpoint (),
|
|
333
|
+
navigationInfo = this .getNavigationInfo (),
|
|
334
|
+
collisionRadius = navigationInfo .getCollisionRadius (),
|
|
335
|
+
bottom = navigationInfo .getStepHeight () - navigationInfo .getAvatarHeight (),
|
|
336
|
+
nearValue = navigationInfo .getNearValue (),
|
|
337
|
+
avatarHeight = navigationInfo .getAvatarHeight ();
|
|
338
|
+
|
|
339
|
+
// Determine width and height of camera
|
|
340
|
+
|
|
341
|
+
// Reshape camera
|
|
342
|
+
|
|
343
|
+
Camera .ortho (-collisionRadius,
|
|
344
|
+
collisionRadius,
|
|
345
|
+
Math .min (bottom, -collisionRadius), /// TODO: bottom could be a positive value if stepHeight > avatarHeight.
|
|
346
|
+
collisionRadius,
|
|
347
|
+
nearValue,
|
|
348
|
+
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
349
|
+
projectionMatrix);
|
|
350
|
+
|
|
351
|
+
// Translate camera to user position and to look in the direction of the direction.
|
|
352
|
+
|
|
353
|
+
localOrientation .assign (viewpoint ._orientation .getValue ()) .inverse () .multRight (viewpoint .getOrientation ());
|
|
354
|
+
rotation .setFromToVec (Vector3 .zAxis, vector .assign (direction) .negate ()) .multRight (localOrientation);
|
|
355
|
+
viewpoint .straightenHorizon (rotation);
|
|
356
|
+
|
|
357
|
+
cameraSpaceProjectionMatrix .assign (viewpoint .getModelMatrix ());
|
|
358
|
+
cameraSpaceProjectionMatrix .translate (viewpoint .getUserPosition ());
|
|
359
|
+
cameraSpaceProjectionMatrix .rotate (rotation);
|
|
360
|
+
cameraSpaceProjectionMatrix .inverse ();
|
|
361
|
+
|
|
362
|
+
cameraSpaceProjectionMatrix .multRight (projectionMatrix);
|
|
363
|
+
cameraSpaceProjectionMatrix .multLeft (viewpoint .getCameraSpaceMatrix ());
|
|
364
|
+
|
|
365
|
+
this .getProjectionMatrix () .pushMatrix (cameraSpaceProjectionMatrix);
|
|
366
|
+
|
|
367
|
+
const depth = this .getDepth (projectionMatrix);
|
|
368
|
+
|
|
369
|
+
this .getProjectionMatrix () .pop ();
|
|
370
|
+
|
|
371
|
+
this .collisionTime += performance .now () - t0;
|
|
372
|
+
return -depth;
|
|
373
|
+
}
|
|
374
|
+
catch (error)
|
|
375
|
+
{
|
|
376
|
+
console .error (error);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
})(),
|
|
380
|
+
getDepth: (function ()
|
|
381
|
+
{
|
|
382
|
+
const
|
|
383
|
+
depthBufferViewport = new Vector4 (0, 0, DEPTH_BUFFER_WIDTH, DEPTH_BUFFER_HEIGHT),
|
|
384
|
+
depthBufferViewVolume = new ViewVolume ();
|
|
385
|
+
|
|
386
|
+
depthBufferViewVolume .set (Matrix4 .Identity, depthBufferViewport, depthBufferViewport);
|
|
387
|
+
|
|
388
|
+
return function (projectionMatrix)
|
|
389
|
+
{
|
|
390
|
+
/// Returns the depth value to the closest object. The maximum determinable value is avatarHeight * 2.
|
|
391
|
+
|
|
392
|
+
this .depthBuffer .bind ();
|
|
393
|
+
|
|
394
|
+
this .viewVolumes .push (depthBufferViewVolume);
|
|
395
|
+
this .depth (this .collisionShapes, this .numCollisionShapes);
|
|
396
|
+
this .viewVolumes .pop ();
|
|
397
|
+
|
|
398
|
+
const depth = this .depthBuffer .getDepth (projectionMatrix, depthBufferViewport);
|
|
399
|
+
|
|
400
|
+
this .depthBuffer .unbind ();
|
|
401
|
+
|
|
402
|
+
return depth;
|
|
403
|
+
};
|
|
404
|
+
})(),
|
|
405
|
+
render: function (type, callback, group)
|
|
406
|
+
{
|
|
407
|
+
switch (type)
|
|
408
|
+
{
|
|
409
|
+
case TraverseType .COLLISION:
|
|
410
|
+
{
|
|
411
|
+
// Collect for collide and gravite
|
|
412
|
+
this .numCollisionShapes = 0;
|
|
413
|
+
|
|
414
|
+
callback .call (group, type, this);
|
|
415
|
+
this .collide ();
|
|
416
|
+
this .gravite ();
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
case TraverseType .SHADOW:
|
|
420
|
+
{
|
|
421
|
+
this .numDepthShapes = 0;
|
|
422
|
+
|
|
423
|
+
callback .call (group, type, this);
|
|
424
|
+
this .depth (this .depthShapes, this .numDepthShapes);
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
case TraverseType .DISPLAY:
|
|
428
|
+
{
|
|
429
|
+
this .lightIndex = 0;
|
|
430
|
+
this .numOpaqueShapes = 0;
|
|
431
|
+
this .numTransparentShapes = 0;
|
|
432
|
+
|
|
433
|
+
this .setGlobalFog (this .getFog ());
|
|
434
|
+
|
|
435
|
+
callback .call (group, type, this);
|
|
436
|
+
this .draw ();
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
addCollisionShape: (function ()
|
|
442
|
+
{
|
|
443
|
+
const
|
|
444
|
+
bboxSize = new Vector3 (0, 0, 0),
|
|
445
|
+
bboxCenter = new Vector3 (0, 0, 0);
|
|
446
|
+
|
|
447
|
+
return function (shapeNode)
|
|
448
|
+
{
|
|
449
|
+
const modelViewMatrix = this .getModelViewMatrix () .get ();
|
|
450
|
+
|
|
451
|
+
modelViewMatrix .multDirMatrix (bboxSize .assign (shapeNode .getBBoxSize ()));
|
|
452
|
+
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
453
|
+
|
|
454
|
+
const
|
|
455
|
+
radius = bboxSize .abs () / 2,
|
|
456
|
+
viewVolume = this .viewVolumes .at (-1);
|
|
457
|
+
|
|
458
|
+
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
459
|
+
{
|
|
460
|
+
const num = this .numCollisionShapes ++;
|
|
461
|
+
|
|
462
|
+
if (num === this .collisionShapes .length)
|
|
463
|
+
{
|
|
464
|
+
this .collisionShapes .push ({ renderer: this, browser: this .getBrowser (), modelViewMatrix: new Float32Array (16), collisions: [ ], clipPlanes: [ ] });
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const context = this .collisionShapes [num];
|
|
468
|
+
|
|
469
|
+
context .modelViewMatrix .set (modelViewMatrix);
|
|
470
|
+
context .shapeNode = shapeNode;
|
|
471
|
+
context .scissor = viewVolume .getScissor ();
|
|
472
|
+
|
|
473
|
+
// Collisions
|
|
474
|
+
|
|
475
|
+
assign (context .collisions, this .collisions);
|
|
476
|
+
|
|
477
|
+
// Clip planes
|
|
478
|
+
|
|
479
|
+
assign (context .clipPlanes, this .localObjects);
|
|
480
|
+
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return false;
|
|
485
|
+
};
|
|
486
|
+
})(),
|
|
487
|
+
addDepthShape: (function ()
|
|
488
|
+
{
|
|
489
|
+
const
|
|
490
|
+
bboxSize = new Vector3 (0, 0, 0),
|
|
491
|
+
bboxCenter = new Vector3 (0, 0, 0);
|
|
492
|
+
|
|
493
|
+
return function (shapeNode)
|
|
494
|
+
{
|
|
495
|
+
const modelViewMatrix = this .getModelViewMatrix () .get ();
|
|
496
|
+
|
|
497
|
+
modelViewMatrix .multDirMatrix (bboxSize .assign (shapeNode .getBBoxSize ()));
|
|
498
|
+
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
499
|
+
|
|
500
|
+
const
|
|
501
|
+
radius = bboxSize .abs () / 2,
|
|
502
|
+
viewVolume = this .viewVolumes .at (-1);
|
|
503
|
+
|
|
504
|
+
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
505
|
+
{
|
|
506
|
+
const num = this .numDepthShapes ++;
|
|
507
|
+
|
|
508
|
+
if (num === this .depthShapes .length)
|
|
509
|
+
{
|
|
510
|
+
this .depthShapes .push ({ renderer: this, browser: this .getBrowser (), modelViewMatrix: new Float32Array (16), clipPlanes: [ ] });
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const context = this .depthShapes [num];
|
|
514
|
+
|
|
515
|
+
context .modelViewMatrix .set (modelViewMatrix);
|
|
516
|
+
context .shapeNode = shapeNode;
|
|
517
|
+
context .scissor = viewVolume .getScissor ();
|
|
518
|
+
|
|
519
|
+
// Clip planes
|
|
520
|
+
|
|
521
|
+
assign (context .clipPlanes, this .localObjects);
|
|
522
|
+
|
|
523
|
+
return true;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
return false;
|
|
527
|
+
};
|
|
528
|
+
})(),
|
|
529
|
+
addDisplayShape: (function ()
|
|
530
|
+
{
|
|
531
|
+
const
|
|
532
|
+
bboxSize = new Vector3 (0, 0, 0),
|
|
533
|
+
bboxCenter = new Vector3 (0, 0, 0);
|
|
534
|
+
|
|
535
|
+
return function (shapeNode)
|
|
536
|
+
{
|
|
537
|
+
const modelViewMatrix = this .getModelViewMatrix () .get ();
|
|
538
|
+
|
|
539
|
+
modelViewMatrix .multDirMatrix (bboxSize .assign (shapeNode .getBBoxSize ()));
|
|
540
|
+
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
541
|
+
|
|
542
|
+
const
|
|
543
|
+
radius = bboxSize .abs () / 2,
|
|
544
|
+
viewVolume = this .viewVolumes .at (-1);
|
|
545
|
+
|
|
546
|
+
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
547
|
+
{
|
|
548
|
+
if (shapeNode .getTransparent ())
|
|
549
|
+
{
|
|
550
|
+
const num = this .numTransparentShapes ++;
|
|
551
|
+
|
|
552
|
+
if (num === this .transparentShapes .length)
|
|
553
|
+
this .transparentShapes .push (this .createShapeContext (true));
|
|
554
|
+
|
|
555
|
+
var context = this .transparentShapes [num];
|
|
556
|
+
}
|
|
557
|
+
else
|
|
558
|
+
{
|
|
559
|
+
const num = this .numOpaqueShapes ++;
|
|
560
|
+
|
|
561
|
+
if (num === this .opaqueShapes .length)
|
|
562
|
+
this .opaqueShapes .push (this .createShapeContext (false));
|
|
563
|
+
|
|
564
|
+
var context = this .opaqueShapes [num];
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
context .modelViewMatrix .set (modelViewMatrix);
|
|
568
|
+
context .scissor .assign (viewVolume .getScissor ());
|
|
569
|
+
context .shapeNode = shapeNode;
|
|
570
|
+
context .textureNode = null;
|
|
571
|
+
context .distance = bboxCenter .z;
|
|
572
|
+
context .fogNode = this .localFog;
|
|
573
|
+
context .shadow = this .shadow .at (-1);
|
|
574
|
+
|
|
575
|
+
// Clip planes and local lights
|
|
576
|
+
|
|
577
|
+
assign (context .localObjects, this .localObjects);
|
|
578
|
+
|
|
579
|
+
return true;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
return false;
|
|
583
|
+
};
|
|
584
|
+
})(),
|
|
585
|
+
createShapeContext: function (transparent)
|
|
586
|
+
{
|
|
587
|
+
return {
|
|
588
|
+
renderer: this,
|
|
589
|
+
browser: this .getBrowser (),
|
|
590
|
+
transparent: transparent,
|
|
591
|
+
modelViewMatrix: new Float32Array (16),
|
|
592
|
+
scissor: new Vector4 (0, 0, 0, 0),
|
|
593
|
+
localObjects: [ ],
|
|
594
|
+
};
|
|
595
|
+
},
|
|
596
|
+
collide: (function ()
|
|
597
|
+
{
|
|
598
|
+
const
|
|
599
|
+
invModelViewMatrix = new Matrix4 (),
|
|
600
|
+
modelViewMatrix = new Matrix4 (),
|
|
601
|
+
collisionBox = new Box3 (Vector3 .Zero, Vector3 .Zero),
|
|
602
|
+
collisionSize = new Vector3 (0, 0, 0);
|
|
603
|
+
|
|
604
|
+
return function ()
|
|
605
|
+
{
|
|
606
|
+
// Collision nodes are handled here.
|
|
607
|
+
|
|
608
|
+
const
|
|
609
|
+
activeCollisions = new Set (), // current active Collision nodes
|
|
610
|
+
collisionRadius2 = 2.2 * this .getNavigationInfo () .getCollisionRadius (); // Make the radius a little bit larger.
|
|
611
|
+
|
|
612
|
+
collisionSize .set (collisionRadius2, collisionRadius2, collisionRadius2);
|
|
613
|
+
|
|
614
|
+
for (let i = 0, length = this .numCollisionShapes; i < length; ++ i)
|
|
615
|
+
{
|
|
616
|
+
try
|
|
617
|
+
{
|
|
618
|
+
const
|
|
619
|
+
context = this .collisionShapes [i],
|
|
620
|
+
collisions = context .collisions;
|
|
621
|
+
|
|
622
|
+
if (collisions .length)
|
|
623
|
+
{
|
|
624
|
+
collisionBox .set (collisionSize, Vector3 .Zero);
|
|
625
|
+
collisionBox .multRight (invModelViewMatrix .assign (context .modelViewMatrix) .inverse ());
|
|
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
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
catch (error)
|
|
635
|
+
{
|
|
636
|
+
console .error (error);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// Set isActive to FALSE for affected nodes.
|
|
641
|
+
|
|
642
|
+
if (this .activeCollisions .size)
|
|
643
|
+
{
|
|
644
|
+
const inActiveCollisions = activeCollisions .size
|
|
645
|
+
? Algorithm .set_difference (this .activeCollisions, activeCollisions, new Set ())
|
|
646
|
+
: this .activeCollisions;
|
|
647
|
+
|
|
648
|
+
for (const collision of inActiveCollisions)
|
|
649
|
+
collision .set_active (false);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// Set isActive to TRUE for affected nodes.
|
|
653
|
+
|
|
654
|
+
this .activeCollisions = activeCollisions;
|
|
655
|
+
|
|
656
|
+
for (const collision of activeCollisions)
|
|
657
|
+
collision .set_active (true);
|
|
658
|
+
};
|
|
659
|
+
})(),
|
|
660
|
+
gravite: (function ()
|
|
661
|
+
{
|
|
662
|
+
const
|
|
663
|
+
projectionMatrix = new Matrix4 (),
|
|
664
|
+
cameraSpaceProjectionMatrix = new Matrix4 (),
|
|
665
|
+
translation = new Vector3 (0, 0, 0),
|
|
666
|
+
rotation = new Rotation4 (0, 0, 1, 0);
|
|
667
|
+
|
|
668
|
+
return function ()
|
|
669
|
+
{
|
|
670
|
+
try
|
|
671
|
+
{
|
|
672
|
+
const
|
|
673
|
+
browser = this .getBrowser (),
|
|
674
|
+
shaderNode = browser .getDepthShader ();
|
|
675
|
+
|
|
676
|
+
if (shaderNode .getValid ())
|
|
677
|
+
{
|
|
678
|
+
// Terrain following and gravitation
|
|
679
|
+
|
|
680
|
+
if (browser .getActiveLayer () === this)
|
|
681
|
+
{
|
|
682
|
+
if (browser .getCurrentViewer () !== "WALK")
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
else if (this .getNavigationInfo () .getViewer () !== "WALK")
|
|
686
|
+
return;
|
|
687
|
+
|
|
688
|
+
// Get NavigationInfo values
|
|
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 ();
|
|
697
|
+
|
|
698
|
+
// Reshape viewpoint for gravite.
|
|
699
|
+
|
|
700
|
+
Camera .ortho (-collisionRadius,
|
|
701
|
+
collisionRadius,
|
|
702
|
+
-collisionRadius,
|
|
703
|
+
collisionRadius,
|
|
704
|
+
nearValue,
|
|
705
|
+
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
706
|
+
projectionMatrix);
|
|
707
|
+
|
|
708
|
+
// Transform viewpoint to look down the up vector
|
|
709
|
+
|
|
710
|
+
const
|
|
711
|
+
upVector = viewpoint .getUpVector (),
|
|
712
|
+
down = rotation .setFromToVec (Vector3 .zAxis, upVector);
|
|
713
|
+
|
|
714
|
+
cameraSpaceProjectionMatrix .assign (viewpoint .getModelMatrix ());
|
|
715
|
+
cameraSpaceProjectionMatrix .translate (viewpoint .getUserPosition ());
|
|
716
|
+
cameraSpaceProjectionMatrix .rotate (down);
|
|
717
|
+
cameraSpaceProjectionMatrix .inverse ();
|
|
718
|
+
|
|
719
|
+
cameraSpaceProjectionMatrix .multRight (projectionMatrix);
|
|
720
|
+
cameraSpaceProjectionMatrix .multLeft (viewpoint .getCameraSpaceMatrix ());
|
|
721
|
+
|
|
722
|
+
this .getProjectionMatrix () .pushMatrix (cameraSpaceProjectionMatrix);
|
|
723
|
+
|
|
724
|
+
let distance = -this .getDepth (projectionMatrix);
|
|
725
|
+
|
|
726
|
+
this .getProjectionMatrix () .pop ();
|
|
727
|
+
|
|
728
|
+
// Gravite or step up
|
|
729
|
+
|
|
730
|
+
distance -= avatarHeight;
|
|
731
|
+
|
|
732
|
+
const up = rotation .setFromToVec (Vector3 .yAxis, upVector);
|
|
733
|
+
|
|
734
|
+
if (distance > 0)
|
|
735
|
+
{
|
|
736
|
+
// Gravite and fall down the to the floor
|
|
737
|
+
|
|
738
|
+
const currentFrameRate = this .speed ? browser .getCurrentFrameRate () : 1000000;
|
|
739
|
+
|
|
740
|
+
this .speed -= browser .getBrowserOptions () ._Gravity .getValue () / currentFrameRate;
|
|
741
|
+
|
|
742
|
+
let y = this .speed / currentFrameRate;
|
|
743
|
+
|
|
744
|
+
if (y < -distance)
|
|
745
|
+
{
|
|
746
|
+
// The ground is reached.
|
|
747
|
+
y = -distance;
|
|
748
|
+
this .speed = 0;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
viewpoint ._positionOffset = viewpoint ._positionOffset .getValue () .add (up .multVecRot (translation .set (0, y, 0)));
|
|
752
|
+
}
|
|
753
|
+
else
|
|
754
|
+
{
|
|
755
|
+
this .speed = 0;
|
|
756
|
+
|
|
757
|
+
distance = -distance;
|
|
758
|
+
|
|
759
|
+
if (distance > 0.01 && distance < stepHeight)
|
|
760
|
+
{
|
|
761
|
+
// Step up
|
|
762
|
+
this .constrainTranslation (up .multVecRot (translation .set (0, distance, 0)), false);
|
|
763
|
+
|
|
764
|
+
//if (getBrowser () -> getBrowserOptions () -> animateStairWalks ())
|
|
765
|
+
//{
|
|
766
|
+
// float step = getBrowser () -> getCurrentSpeed () / getBrowser () -> getCurrentFrameRate ();
|
|
767
|
+
// step = abs (getViewMatrix () .mult_matrix_dir (Vector3f (0, step, 0) * up));
|
|
768
|
+
//
|
|
769
|
+
// Vector3f offset = Vector3f (0, step, 0) * up;
|
|
770
|
+
//
|
|
771
|
+
// if (math::abs (offset) > math::abs (translation) or getBrowser () -> getCurrentSpeed () == 0)
|
|
772
|
+
// offset = translation;
|
|
773
|
+
//
|
|
774
|
+
// getViewpoint () -> positionOffset () += offset;
|
|
775
|
+
//}
|
|
776
|
+
//else
|
|
777
|
+
viewpoint ._positionOffset = translation .add (viewpoint ._positionOffset .getValue ());
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
catch (error)
|
|
783
|
+
{
|
|
784
|
+
console .error (error);
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
})(),
|
|
788
|
+
depth: (function ()
|
|
789
|
+
{
|
|
790
|
+
const projectionMatrixArray = new Float32Array (16);
|
|
791
|
+
|
|
792
|
+
return function (shapes, numShapes)
|
|
793
|
+
{
|
|
794
|
+
const
|
|
795
|
+
browser = this .getBrowser (),
|
|
796
|
+
gl = browser .getContext (),
|
|
797
|
+
viewport = this .getViewVolume () .getViewport (),
|
|
798
|
+
shaderNode = browser .getDepthShader ();
|
|
801
799
|
|
|
802
|
-
|
|
800
|
+
// Configure depth shader.
|
|
803
801
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
802
|
+
if (shaderNode .getValid ())
|
|
803
|
+
{
|
|
804
|
+
shaderNode .enable (gl);
|
|
807
805
|
|
|
808
|
-
|
|
806
|
+
projectionMatrixArray .set (this .getProjectionMatrix () .get ());
|
|
809
807
|
|
|
810
|
-
|
|
808
|
+
gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, projectionMatrixArray);
|
|
811
809
|
|
|
812
|
-
|
|
810
|
+
// Configure viewport and background
|
|
813
811
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
812
|
+
gl .viewport (viewport [0],
|
|
813
|
+
viewport [1],
|
|
814
|
+
viewport [2],
|
|
815
|
+
viewport [3]);
|
|
818
816
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
817
|
+
gl .scissor (viewport [0],
|
|
818
|
+
viewport [1],
|
|
819
|
+
viewport [2],
|
|
820
|
+
viewport [3]);
|
|
823
821
|
|
|
824
|
-
|
|
825
|
-
|
|
822
|
+
gl .clearColor (1, 0, 0, 0); // Must be '1, 0, 0, 0'.
|
|
823
|
+
gl .clear (gl .COLOR_BUFFER_BIT | gl .DEPTH_BUFFER_BIT);
|
|
826
824
|
|
|
827
|
-
|
|
825
|
+
// Render all objects
|
|
828
826
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
827
|
+
gl .enable (gl .DEPTH_TEST);
|
|
828
|
+
gl .depthMask (true);
|
|
829
|
+
gl .disable (gl .BLEND);
|
|
830
|
+
gl .disable (gl .CULL_FACE);
|
|
833
831
|
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
832
|
+
for (let s = 0; s < numShapes; ++ s)
|
|
833
|
+
{
|
|
834
|
+
const
|
|
835
|
+
context = shapes [s],
|
|
836
|
+
scissor = context .scissor;
|
|
839
837
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
838
|
+
// TODO: viewport must not be the browser or layer viewport.
|
|
839
|
+
gl .scissor (scissor .x,
|
|
840
|
+
scissor .y,
|
|
841
|
+
scissor .z,
|
|
842
|
+
scissor .w);
|
|
845
843
|
|
|
846
|
-
|
|
844
|
+
// Clip planes
|
|
847
845
|
|
|
848
|
-
|
|
846
|
+
shaderNode .setLocalObjects (gl, context .clipPlanes);
|
|
849
847
|
|
|
850
|
-
|
|
848
|
+
// modelViewMatrix
|
|
851
849
|
|
|
852
|
-
|
|
850
|
+
gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, context .modelViewMatrix);
|
|
853
851
|
|
|
854
|
-
|
|
852
|
+
// Draw
|
|
855
853
|
|
|
856
|
-
|
|
857
|
-
|
|
854
|
+
context .shapeNode .depth (gl, context, shaderNode);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
})(),
|
|
859
|
+
draw: (function ()
|
|
860
|
+
{
|
|
861
|
+
const
|
|
862
|
+
viewportArray = new Int32Array (4),
|
|
863
|
+
projectionMatrixArray = new Float32Array (16),
|
|
864
|
+
cameraSpaceMatrixArray = new Float32Array (16);
|
|
858
865
|
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
866
|
+
return function ()
|
|
867
|
+
{
|
|
868
|
+
const
|
|
869
|
+
browser = this .getBrowser (),
|
|
870
|
+
gl = browser .getContext (),
|
|
871
|
+
viewport = this .getViewVolume () .getViewport (),
|
|
872
|
+
shaders = this .shaders,
|
|
873
|
+
lights = this .lights,
|
|
874
|
+
textureProjectors = this .textureProjectors,
|
|
875
|
+
generatedCubeMapTextures = this .generatedCubeMapTextures;
|
|
869
876
|
|
|
870
|
-
return function ()
|
|
871
|
-
{
|
|
872
|
-
const
|
|
873
|
-
browser = this .getBrowser (),
|
|
874
|
-
gl = browser .getContext (),
|
|
875
|
-
viewport = this .getViewVolume () .getViewport (),
|
|
876
|
-
shaders = this .shaders,
|
|
877
|
-
lights = this .lights,
|
|
878
|
-
textureProjectors = this .textureProjectors,
|
|
879
|
-
generatedCubeMapTextures = this .generatedCubeMapTextures;
|
|
880
877
|
|
|
878
|
+
// PREPARATIONS
|
|
881
879
|
|
|
882
|
-
// PREPARATIONS
|
|
883
880
|
|
|
881
|
+
if (this .isIndependent ())
|
|
882
|
+
{
|
|
883
|
+
// Render shadow maps.
|
|
884
884
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
// Render shadow maps.
|
|
885
|
+
for (const light of lights)
|
|
886
|
+
light .renderShadowMap (this);
|
|
888
887
|
|
|
889
|
-
|
|
890
|
-
light .renderShadowMap (this);
|
|
888
|
+
// Render GeneratedCubeMapTextures.
|
|
891
889
|
|
|
892
|
-
|
|
890
|
+
for (const generatedCubeMapTexture of generatedCubeMapTextures)
|
|
891
|
+
generatedCubeMapTexture .renderTexture (this);
|
|
892
|
+
}
|
|
893
893
|
|
|
894
|
-
for (const generatedCubeMapTexture of generatedCubeMapTextures)
|
|
895
|
-
generatedCubeMapTexture .renderTexture (this);
|
|
896
|
-
}
|
|
897
894
|
|
|
895
|
+
// DRAW
|
|
898
896
|
|
|
899
|
-
// DRAW
|
|
900
897
|
|
|
898
|
+
// Set up shadow matrix for all lights, and matrix for all projective textures.
|
|
901
899
|
|
|
902
|
-
|
|
900
|
+
browser .getHeadlight () .setGlobalVariables (this);
|
|
903
901
|
|
|
904
|
-
|
|
902
|
+
for (const light of lights)
|
|
903
|
+
light .setGlobalVariables (this);
|
|
905
904
|
|
|
906
|
-
|
|
907
|
-
|
|
905
|
+
for (const textureProjector of textureProjectors)
|
|
906
|
+
textureProjector .setGlobalVariables (this);
|
|
908
907
|
|
|
909
|
-
|
|
910
|
-
textureProjector .setGlobalVariables (this);
|
|
908
|
+
// Configure viewport and background
|
|
911
909
|
|
|
912
|
-
|
|
910
|
+
gl .viewport (viewport [0],
|
|
911
|
+
viewport [1],
|
|
912
|
+
viewport [2],
|
|
913
|
+
viewport [3]);
|
|
913
914
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
915
|
+
gl .scissor (viewport [0],
|
|
916
|
+
viewport [1],
|
|
917
|
+
viewport [2],
|
|
918
|
+
viewport [3]);
|
|
918
919
|
|
|
919
|
-
|
|
920
|
-
viewport [1],
|
|
921
|
-
viewport [2],
|
|
922
|
-
viewport [3]);
|
|
920
|
+
// Draw background.
|
|
923
921
|
|
|
924
|
-
|
|
922
|
+
gl .clear (gl .DEPTH_BUFFER_BIT);
|
|
925
923
|
|
|
926
|
-
|
|
924
|
+
this .getBackground () .display (gl, this, viewport);
|
|
927
925
|
|
|
928
|
-
|
|
926
|
+
// Set global uniforms.
|
|
929
927
|
|
|
930
|
-
|
|
928
|
+
viewportArray .set (viewport);
|
|
929
|
+
cameraSpaceMatrixArray .set (this .getCameraSpaceMatrix () .get ());
|
|
930
|
+
projectionMatrixArray .set (this .getProjectionMatrix () .get ());
|
|
931
931
|
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
projectionMatrixArray .set (this .getProjectionMatrix () .get ());
|
|
932
|
+
for (const shader of browser .getStandardShaders ())
|
|
933
|
+
shaders .add (shader);
|
|
935
934
|
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
if (browser .hasUnlitShader ()) shaders .add (browser .getUnlitShader ());
|
|
939
|
-
if (browser .hasShadowShader ()) shaders .add (browser .getShadowShader ());
|
|
940
|
-
shaders .add (browser .getDefaultShader ());
|
|
935
|
+
for (const shader of shaders)
|
|
936
|
+
shader .setGlobalUniforms (gl, this, cameraSpaceMatrixArray, projectionMatrixArray, viewportArray);
|
|
941
937
|
|
|
942
|
-
|
|
943
|
-
{
|
|
944
|
-
shader .setGlobalUniforms (gl, this, cameraSpaceMatrixArray, projectionMatrixArray, viewportArray);
|
|
945
|
-
},
|
|
946
|
-
this);
|
|
938
|
+
// Sorted blend
|
|
947
939
|
|
|
948
|
-
|
|
940
|
+
// Render opaque objects first
|
|
949
941
|
|
|
950
|
-
|
|
942
|
+
gl .enable (gl .DEPTH_TEST);
|
|
943
|
+
gl .depthMask (true);
|
|
944
|
+
gl .disable (gl .BLEND);
|
|
951
945
|
|
|
952
|
-
|
|
953
|
-
gl .depthMask (true);
|
|
954
|
-
gl .disable (gl .BLEND);
|
|
946
|
+
const opaqueShapes = this .opaqueShapes;
|
|
955
947
|
|
|
956
|
-
|
|
948
|
+
for (let i = 0, length = this .numOpaqueShapes; i < length; ++ i)
|
|
949
|
+
{
|
|
950
|
+
const
|
|
951
|
+
context = opaqueShapes [i],
|
|
952
|
+
scissor = context .scissor;
|
|
957
953
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
scissor = context .scissor;
|
|
954
|
+
gl .scissor (scissor .x,
|
|
955
|
+
scissor .y,
|
|
956
|
+
scissor .z,
|
|
957
|
+
scissor .w);
|
|
963
958
|
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
scissor .w);
|
|
959
|
+
context .shapeNode .display (gl, context);
|
|
960
|
+
browser .resetTextureUnits ();
|
|
961
|
+
}
|
|
968
962
|
|
|
969
|
-
|
|
970
|
-
}
|
|
963
|
+
// Render transparent objects
|
|
971
964
|
|
|
972
|
-
|
|
965
|
+
gl .depthMask (false);
|
|
966
|
+
gl .enable (gl .BLEND);
|
|
973
967
|
|
|
974
|
-
|
|
975
|
-
gl .enable (gl .BLEND);
|
|
968
|
+
const transparentShapes = this .transparentShapes;
|
|
976
969
|
|
|
977
|
-
|
|
970
|
+
this .transparencySorter .sort (0, this .numTransparentShapes);
|
|
978
971
|
|
|
979
|
-
|
|
972
|
+
for (let i = 0, length = this .numTransparentShapes; i < length; ++ i)
|
|
973
|
+
{
|
|
974
|
+
const
|
|
975
|
+
context = transparentShapes [i],
|
|
976
|
+
scissor = context .scissor;
|
|
980
977
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
scissor = context .scissor;
|
|
978
|
+
gl .scissor (scissor .x,
|
|
979
|
+
scissor .y,
|
|
980
|
+
scissor .z,
|
|
981
|
+
scissor .w);
|
|
986
982
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
scissor .w);
|
|
983
|
+
context .shapeNode .display (gl, context);
|
|
984
|
+
browser .resetTextureUnits ();
|
|
985
|
+
}
|
|
991
986
|
|
|
992
|
-
|
|
993
|
-
|
|
987
|
+
gl .depthMask (true);
|
|
988
|
+
gl .disable (gl .BLEND);
|
|
994
989
|
|
|
995
|
-
gl .depthMask (true);
|
|
996
|
-
gl .disable (gl .BLEND);
|
|
997
990
|
|
|
991
|
+
// POST DRAW
|
|
998
992
|
|
|
999
|
-
|
|
993
|
+
const globalObjects = this .globalObjects;
|
|
1000
994
|
|
|
995
|
+
if (this .isIndependent ())
|
|
996
|
+
{
|
|
997
|
+
// Recycle clip planes, local fogs, local lights, and local projective textures.
|
|
1001
998
|
|
|
1002
|
-
|
|
999
|
+
const localObjects = browser .getLocalObjects ();
|
|
1003
1000
|
|
|
1004
|
-
|
|
1001
|
+
for (const localObject of localObjects)
|
|
1002
|
+
localObject .dispose ();
|
|
1005
1003
|
|
|
1006
|
-
|
|
1007
|
-
{
|
|
1008
|
-
// Recycle clip planes, local fogs, local lights, and local projective textures.
|
|
1004
|
+
localObjects .length = 0;
|
|
1009
1005
|
|
|
1010
|
-
|
|
1006
|
+
// Recycle global lights and global projective textures.
|
|
1011
1007
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1008
|
+
for (const globalObject of globalObjects)
|
|
1009
|
+
globalObject .dispose ();
|
|
1010
|
+
}
|
|
1014
1011
|
|
|
1015
|
-
|
|
1012
|
+
// Reset containers.
|
|
1016
1013
|
|
|
1017
|
-
|
|
1014
|
+
shaders .clear ();
|
|
1018
1015
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1016
|
+
globalObjects .length = 0;
|
|
1017
|
+
lights .length = 0;
|
|
1018
|
+
textureProjectors .length = 0;
|
|
1019
|
+
generatedCubeMapTextures .length = 0;
|
|
1020
|
+
};
|
|
1021
|
+
})(),
|
|
1022
|
+
};
|
|
1022
1023
|
|
|
1023
|
-
|
|
1024
|
+
function assign (lhs, rhs)
|
|
1025
|
+
{
|
|
1026
|
+
for (var i = 0, length = rhs .length; i < length; ++ i)
|
|
1027
|
+
lhs [i] = rhs [i];
|
|
1024
1028
|
|
|
1025
|
-
|
|
1029
|
+
lhs .length = length;
|
|
1030
|
+
}
|
|
1026
1031
|
|
|
1027
|
-
|
|
1028
|
-
lights .length = 0;
|
|
1029
|
-
textureProjectors .length = 0;
|
|
1030
|
-
generatedCubeMapTextures .length = 0;
|
|
1031
|
-
};
|
|
1032
|
-
})(),
|
|
1033
|
-
};
|
|
1034
|
-
|
|
1035
|
-
function assign (lhs, rhs)
|
|
1036
|
-
{
|
|
1037
|
-
for (var i = 0, length = rhs .length; i < length; ++ i)
|
|
1038
|
-
lhs [i] = rhs [i];
|
|
1039
|
-
|
|
1040
|
-
lhs .length = length;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
return X3DRenderObject;
|
|
1032
|
+
return X3DRenderObject;
|
|
1044
1033
|
});
|