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,17 +48,17 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
define ([
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
"x_ite/Fields",
|
|
52
|
+
"x_ite/Components/Core/X3DNode",
|
|
53
|
+
"x_ite/Base/X3DConstants",
|
|
54
|
+
"x_ite/Browser/Core/Shading",
|
|
55
|
+
"standard/Math/Numbers/Vector2",
|
|
56
|
+
"standard/Math/Numbers/Vector3",
|
|
57
|
+
"standard/Math/Numbers/Matrix4",
|
|
58
|
+
"standard/Math/Geometry/Box3",
|
|
59
|
+
"standard/Math/Geometry/Plane3",
|
|
60
|
+
"standard/Math/Geometry/Triangle3",
|
|
61
|
+
"standard/Math/Algorithm",
|
|
62
62
|
],
|
|
63
63
|
function (Fields,
|
|
64
64
|
X3DNode,
|
|
@@ -74,1176 +74,1195 @@ function (Fields,
|
|
|
74
74
|
{
|
|
75
75
|
"use strict";
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
77
|
+
const ARRAY_TYPE = "Array"; // For color, texCoord, normal, and vertex array, can be MFFloat or Array;
|
|
78
|
+
|
|
79
|
+
// Box normals for bbox / line intersection.
|
|
80
|
+
const boxNormals = [
|
|
81
|
+
new Vector3 (0, 0, 1), // front
|
|
82
|
+
new Vector3 (0, 0, -1), // back
|
|
83
|
+
new Vector3 (0, 1, 0), // top
|
|
84
|
+
new Vector3 (0, -1, 0), // bottom
|
|
85
|
+
new Vector3 (1, 0, 0) // right
|
|
86
|
+
// left: We do not have to test for left.
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
function X3DGeometryNode (executionContext)
|
|
90
|
+
{
|
|
91
|
+
X3DNode .call (this, executionContext);
|
|
92
|
+
|
|
93
|
+
this .addType (X3DConstants .X3DGeometryNode);
|
|
94
|
+
|
|
95
|
+
this .addChildObjects ("transparent", new Fields .SFBool (),
|
|
96
|
+
"bbox_changed", new Fields .SFTime (),
|
|
97
|
+
"rebuild", new Fields .SFTime ());
|
|
98
|
+
|
|
99
|
+
this ._transparent .setAccessType (X3DConstants .outputOnly);
|
|
100
|
+
this ._bbox_changed .setAccessType (X3DConstants .outputOnly);
|
|
101
|
+
this ._rebuild .setAccessType (X3DConstants .outputOnly);
|
|
102
|
+
|
|
103
|
+
// Members
|
|
104
|
+
|
|
105
|
+
const browser = this .getBrowser ();
|
|
106
|
+
|
|
107
|
+
this .min = new Vector3 (0, 0, 0);
|
|
108
|
+
this .max = new Vector3 (0, 0, 0);
|
|
109
|
+
this .bbox = new Box3 (this .min, this .max, true);
|
|
110
|
+
this .solid = true;
|
|
111
|
+
this .geometryType = 3;
|
|
112
|
+
this .primitiveMode = browser .getContext () .TRIANGLES;
|
|
113
|
+
this .flatShading = undefined;
|
|
114
|
+
this .colorMaterial = false;
|
|
115
|
+
this .attribNodes = [ ];
|
|
116
|
+
this .attribs = [ ];
|
|
117
|
+
this .textureCoordinateNode = browser .getDefaultTextureCoordinate ();
|
|
118
|
+
this .textureCoordinateMapping = new Map ();
|
|
119
|
+
this .multiTexCoords = [ ];
|
|
120
|
+
this .texCoords = X3DGeometryNode .createArray ();
|
|
121
|
+
this .fogDepths = X3DGeometryNode .createArray ();
|
|
122
|
+
this .colors = X3DGeometryNode .createArray ();
|
|
123
|
+
this .normals = X3DGeometryNode .createArray ();
|
|
124
|
+
this .flatNormals = X3DGeometryNode .createArray ();
|
|
125
|
+
this .vertices = X3DGeometryNode .createArray ();
|
|
126
|
+
this .vertexCount = 0;
|
|
127
|
+
|
|
128
|
+
// This methods are configured in transfer.
|
|
129
|
+
this .depth = Function .prototype;
|
|
130
|
+
this .display = Function .prototype;
|
|
131
|
+
this .displayParticles = Function .prototype;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Function to select ether Array or MFFloat for color/normal/vertex arrays.
|
|
135
|
+
X3DGeometryNode .createArray = function ()
|
|
136
|
+
{
|
|
137
|
+
if (ARRAY_TYPE == "MFFloat")
|
|
138
|
+
return new Fields .MFFloat ();
|
|
139
|
+
|
|
140
|
+
const array = [ ];
|
|
141
|
+
|
|
142
|
+
array .typedArray = new Float32Array ();
|
|
143
|
+
|
|
144
|
+
array .assign = function (value)
|
|
145
|
+
{
|
|
146
|
+
const length = value .length;
|
|
147
|
+
|
|
148
|
+
for (let i = 0; i < length; ++ i)
|
|
149
|
+
this [i] = value [i];
|
|
150
|
+
|
|
151
|
+
this .length = length;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
array .getValue = function ()
|
|
155
|
+
{
|
|
156
|
+
return this .typedArray;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
array .shrinkToFit = function ()
|
|
160
|
+
{
|
|
161
|
+
if (this .length !== this .typedArray .length)
|
|
162
|
+
this .typedArray = new Float32Array (this);
|
|
163
|
+
else
|
|
164
|
+
this .typedArray .set (this);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
return array;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype),
|
|
171
|
+
{
|
|
172
|
+
constructor: X3DGeometryNode,
|
|
173
|
+
setup: function ()
|
|
174
|
+
{
|
|
175
|
+
X3DNode .prototype .setup .call (this);
|
|
176
|
+
|
|
177
|
+
this .rebuild ();
|
|
178
|
+
},
|
|
179
|
+
initialize: function ()
|
|
180
|
+
{
|
|
181
|
+
X3DNode .prototype .initialize .call (this);
|
|
182
|
+
|
|
183
|
+
this .isLive () .addInterest ("set_live__", this);
|
|
184
|
+
|
|
185
|
+
this .addInterest ("requestRebuild", this);
|
|
186
|
+
this ._rebuild .addInterest ("rebuild", this);
|
|
187
|
+
|
|
188
|
+
const gl = this .getBrowser () .getContext ();
|
|
189
|
+
|
|
190
|
+
this .frontFace = gl .CCW;
|
|
191
|
+
this .attribBuffers = [ ];
|
|
192
|
+
this .texCoordBuffers = [ ];
|
|
193
|
+
this .fogDepthBuffer = gl .createBuffer ();
|
|
194
|
+
this .colorBuffer = gl .createBuffer ();
|
|
195
|
+
this .normalBuffer = gl .createBuffer ();
|
|
196
|
+
this .vertexBuffer = gl .createBuffer ();
|
|
197
|
+
this .planes = [ ];
|
|
198
|
+
|
|
199
|
+
for (let i = 0; i < 5; ++ i)
|
|
200
|
+
this .planes [i] = new Plane3 (Vector3 .Zero, Vector3 .zAxis);
|
|
201
|
+
|
|
202
|
+
this .set_live__ ();
|
|
203
|
+
},
|
|
204
|
+
setGeometryType: function (value)
|
|
205
|
+
{
|
|
206
|
+
this .geometryType = value;
|
|
207
|
+
},
|
|
208
|
+
getGeometryType: function ()
|
|
209
|
+
{
|
|
210
|
+
return this .geometryType;
|
|
211
|
+
},
|
|
212
|
+
setTransparent: function (value)
|
|
213
|
+
{
|
|
214
|
+
if (value !== this ._transparent .getValue ())
|
|
215
|
+
this ._transparent = value;
|
|
216
|
+
},
|
|
217
|
+
getTransparent: function ()
|
|
218
|
+
{
|
|
219
|
+
return this ._transparent .getValue ();
|
|
220
|
+
},
|
|
221
|
+
getBBox: function ()
|
|
222
|
+
{
|
|
223
|
+
// With screen matrix applied.
|
|
224
|
+
return this .bbox;
|
|
225
|
+
},
|
|
226
|
+
setBBox: function (bbox)
|
|
227
|
+
{
|
|
228
|
+
if (bbox .equals (this .bbox))
|
|
229
|
+
return;
|
|
230
|
+
|
|
231
|
+
bbox .getExtents (this .min, this .max);
|
|
232
|
+
|
|
233
|
+
this .bbox .assign (bbox);
|
|
234
|
+
|
|
235
|
+
for (let i = 0; i < 5; ++ i)
|
|
236
|
+
this .planes [i] .set (i % 2 ? this .min : this .max, boxNormals [i]);
|
|
237
|
+
|
|
238
|
+
this ._bbox_changed .addEvent ();
|
|
239
|
+
},
|
|
240
|
+
getMin: function ()
|
|
241
|
+
{
|
|
242
|
+
// With screen matrix applied.
|
|
243
|
+
return this .min;
|
|
244
|
+
},
|
|
245
|
+
getMax: function ()
|
|
246
|
+
{
|
|
247
|
+
// With screen matrix applied.
|
|
248
|
+
return this .max;
|
|
249
|
+
},
|
|
250
|
+
getMatrix: function ()
|
|
251
|
+
{
|
|
252
|
+
return Matrix4 .Identity;
|
|
253
|
+
},
|
|
254
|
+
setPrimitiveMode: function (value)
|
|
255
|
+
{
|
|
256
|
+
this .primitiveMode = value;
|
|
257
|
+
},
|
|
258
|
+
getPrimitiveMode: function ()
|
|
259
|
+
{
|
|
260
|
+
return this .primitiveMode;
|
|
261
|
+
},
|
|
262
|
+
setSolid: function (value)
|
|
263
|
+
{
|
|
264
|
+
this .solid = value;
|
|
265
|
+
},
|
|
266
|
+
setCCW: function (value)
|
|
267
|
+
{
|
|
268
|
+
this .frontFace = value ? this .getBrowser () .getContext () .CCW : this .getBrowser () .getContext () .CW;
|
|
269
|
+
},
|
|
270
|
+
getAttrib: function ()
|
|
271
|
+
{
|
|
272
|
+
return this .attribNodes;
|
|
273
|
+
},
|
|
274
|
+
getAttribs: function ()
|
|
275
|
+
{
|
|
276
|
+
return this .attribs;
|
|
277
|
+
},
|
|
278
|
+
setFogDepths: function (value)
|
|
279
|
+
{
|
|
280
|
+
this .fogDepths .assign (value);
|
|
281
|
+
},
|
|
282
|
+
getFogDepths: function ()
|
|
283
|
+
{
|
|
284
|
+
return this .fogDepths;
|
|
285
|
+
},
|
|
286
|
+
setColors: function (value)
|
|
287
|
+
{
|
|
288
|
+
this .colors .assign (value);
|
|
289
|
+
},
|
|
290
|
+
getColors: function ()
|
|
291
|
+
{
|
|
292
|
+
return this .colors;
|
|
293
|
+
},
|
|
294
|
+
setMultiTexCoords: function (value)
|
|
295
|
+
{
|
|
296
|
+
const
|
|
297
|
+
multiTexCoords = this .multiTexCoords,
|
|
298
|
+
length = value .length;
|
|
299
|
+
|
|
300
|
+
for (let i = 0; i < length; ++ i)
|
|
301
|
+
multiTexCoords [i] = value [i];
|
|
302
|
+
|
|
303
|
+
multiTexCoords .length = length;
|
|
304
|
+
},
|
|
305
|
+
getMultiTexCoords: function ()
|
|
306
|
+
{
|
|
307
|
+
return this .multiTexCoords;
|
|
308
|
+
},
|
|
309
|
+
getTexCoords: function ()
|
|
310
|
+
{
|
|
311
|
+
return this .texCoords;
|
|
312
|
+
},
|
|
313
|
+
setTextureCoordinate: function (value)
|
|
314
|
+
{
|
|
315
|
+
this .textureCoordinateNode .removeInterest ("updateTextureCoordinateMapping", this);
|
|
316
|
+
|
|
317
|
+
if (value)
|
|
318
|
+
this .textureCoordinateNode = value;
|
|
319
|
+
else
|
|
320
|
+
this .textureCoordinateNode = this .getBrowser () .getDefaultTextureCoordinate ();
|
|
321
|
+
|
|
322
|
+
this .textureCoordinateNode .addInterest ("updateTextureCoordinateMapping", this);
|
|
323
|
+
|
|
324
|
+
this .updateTextureCoordinateMapping ();
|
|
325
|
+
},
|
|
326
|
+
updateTextureCoordinateMapping: function ()
|
|
327
|
+
{
|
|
328
|
+
this .textureCoordinateMapping .clear ();
|
|
329
|
+
|
|
330
|
+
this .textureCoordinateNode .getTextureMapping (this .textureCoordinateMapping);
|
|
331
|
+
},
|
|
332
|
+
setNormals: function (value)
|
|
333
|
+
{
|
|
334
|
+
this .normals .assign (value);
|
|
335
|
+
},
|
|
336
|
+
getNormals: function ()
|
|
337
|
+
{
|
|
338
|
+
return this .normals;
|
|
339
|
+
},
|
|
340
|
+
setVertices: function (value)
|
|
341
|
+
{
|
|
342
|
+
this .vertices .assign (value);
|
|
343
|
+
},
|
|
344
|
+
getVertices: function ()
|
|
345
|
+
{
|
|
346
|
+
return this .vertices;
|
|
347
|
+
},
|
|
348
|
+
buildTexCoords: function ()
|
|
349
|
+
{
|
|
350
|
+
const texCoords = this .texCoords;
|
|
351
|
+
|
|
352
|
+
if (texCoords .length === 0)
|
|
353
|
+
{
|
|
354
|
+
const
|
|
355
|
+
p = this .getTexCoordParams (),
|
|
356
|
+
min = p .min,
|
|
357
|
+
Sindex = p .Sindex,
|
|
358
|
+
Tindex = p .Tindex,
|
|
359
|
+
Ssize = p .Ssize,
|
|
360
|
+
S = min [Sindex],
|
|
361
|
+
T = min [Tindex],
|
|
362
|
+
vertices = this .vertices .getValue ();
|
|
363
|
+
|
|
364
|
+
for (let i = 0, length = vertices .length; i < length; i += 4)
|
|
365
|
+
{
|
|
366
|
+
texCoords .push ((vertices [i + Sindex] - S) / Ssize,
|
|
367
|
+
(vertices [i + Tindex] - T) / Ssize,
|
|
368
|
+
0,
|
|
369
|
+
1);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
texCoords .shrinkToFit ();
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return texCoords;
|
|
376
|
+
},
|
|
377
|
+
getTexCoordParams: (function ()
|
|
378
|
+
{
|
|
379
|
+
const texCoordParams = { min: new Vector3 (0, 0, 0), Ssize: 0, Sindex: 0, Tindex: 0 };
|
|
380
|
+
|
|
381
|
+
return function ()
|
|
382
|
+
{
|
|
383
|
+
const
|
|
384
|
+
bbox = this .getBBox (),
|
|
385
|
+
size = bbox .size,
|
|
386
|
+
Xsize = size .x,
|
|
387
|
+
Ysize = size .y,
|
|
388
|
+
Zsize = size .z;
|
|
389
|
+
|
|
390
|
+
texCoordParams .min .assign (bbox .center) .subtract (size .divide (2));
|
|
391
|
+
|
|
392
|
+
if ((Xsize >= Ysize) && (Xsize >= Zsize))
|
|
393
|
+
{
|
|
394
|
+
// X size largest
|
|
395
|
+
texCoordParams .Ssize = Xsize; texCoordParams .Sindex = 0;
|
|
396
|
+
|
|
397
|
+
if (Ysize >= Zsize)
|
|
398
|
+
texCoordParams .Tindex = 1;
|
|
399
|
+
else
|
|
400
|
+
texCoordParams .Tindex = 2;
|
|
401
|
+
}
|
|
402
|
+
else if ((Ysize >= Xsize) && (Ysize >= Zsize))
|
|
403
|
+
{
|
|
404
|
+
// Y size largest
|
|
405
|
+
texCoordParams .Ssize = Ysize; texCoordParams .Sindex = 1;
|
|
406
|
+
|
|
407
|
+
if (Xsize >= Zsize)
|
|
408
|
+
texCoordParams .Tindex = 0;
|
|
409
|
+
else
|
|
410
|
+
texCoordParams .Tindex = 2;
|
|
411
|
+
}
|
|
412
|
+
else
|
|
413
|
+
{
|
|
414
|
+
// Z is the largest
|
|
415
|
+
texCoordParams .Ssize = Zsize; texCoordParams .Sindex = 2;
|
|
416
|
+
|
|
417
|
+
if (Xsize >= Ysize)
|
|
418
|
+
texCoordParams .Tindex = 0;
|
|
419
|
+
else
|
|
420
|
+
texCoordParams .Tindex = 1;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return texCoordParams;
|
|
424
|
+
};
|
|
425
|
+
})(),
|
|
426
|
+
refineNormals: function (normalIndex, normals, creaseAngle)
|
|
427
|
+
{
|
|
428
|
+
if (creaseAngle === 0)
|
|
429
|
+
return normals;
|
|
430
|
+
|
|
431
|
+
const
|
|
432
|
+
cosCreaseAngle = Math .cos (Algorithm .clamp (creaseAngle, 0, Math .PI)),
|
|
433
|
+
normals_ = [ ];
|
|
434
|
+
|
|
435
|
+
for (const i in normalIndex) // Don't use forEach
|
|
436
|
+
{
|
|
437
|
+
const vertex = normalIndex [i];
|
|
438
|
+
|
|
439
|
+
for (const p of vertex)
|
|
440
|
+
{
|
|
441
|
+
const
|
|
442
|
+
P = normals [p],
|
|
443
|
+
N = new Vector3 (0, 0, 0);
|
|
444
|
+
|
|
445
|
+
for (const q of vertex)
|
|
446
|
+
{
|
|
447
|
+
const Q = normals [q];
|
|
448
|
+
|
|
449
|
+
if (Q .dot (P) >= cosCreaseAngle)
|
|
450
|
+
N .add (Q);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
normals_ [p] = N .normalize ();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
return normals_;
|
|
458
|
+
},
|
|
459
|
+
isClipped: function (point, clipPlanes)
|
|
460
|
+
{
|
|
461
|
+
return clipPlanes .some (function (clipPlane)
|
|
462
|
+
{
|
|
463
|
+
return clipPlane .isClipped (point);
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
transformLine: function (hitRay)
|
|
467
|
+
{
|
|
468
|
+
// Apply sceen nodes transformation in place here.
|
|
469
|
+
},
|
|
470
|
+
transformMatrix: function (hitRay)
|
|
471
|
+
{
|
|
472
|
+
// Apply sceen nodes transformation in place here.
|
|
473
|
+
},
|
|
474
|
+
intersectsLine: (function ()
|
|
475
|
+
{
|
|
476
|
+
const
|
|
477
|
+
modelViewMatrix = new Matrix4 (),
|
|
478
|
+
uvt = { u: 0, v: 0, t: 0 },
|
|
479
|
+
v0 = new Vector3 (0, 0, 0),
|
|
480
|
+
v1 = new Vector3 (0, 0, 0),
|
|
481
|
+
v2 = new Vector3 (0, 0, 0),
|
|
482
|
+
clipPoint = new Vector3 (0, 0, 0);
|
|
483
|
+
|
|
484
|
+
return function (hitRay, clipPlanes, modelViewMatrix_, intersections)
|
|
485
|
+
{
|
|
486
|
+
try
|
|
487
|
+
{
|
|
488
|
+
if (this .intersectsBBox (hitRay))
|
|
489
|
+
{
|
|
490
|
+
this .transformLine (hitRay); // Apply screen transformations from screen nodes.
|
|
491
|
+
this .transformMatrix (modelViewMatrix .assign (modelViewMatrix_)); // Apply screen transformations from screen nodes.
|
|
492
|
+
|
|
493
|
+
const
|
|
494
|
+
texCoords = this .multiTexCoords [0] .getValue (),
|
|
495
|
+
normals = this .normals .getValue (),
|
|
496
|
+
vertices = this .vertices .getValue ();
|
|
497
|
+
|
|
498
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
499
|
+
{
|
|
500
|
+
const i4 = i * 4;
|
|
501
|
+
|
|
502
|
+
v0 .x = vertices [i4]; v0 .y = vertices [i4 + 1]; v0 .z = vertices [i4 + 2];
|
|
503
|
+
v1 .x = vertices [i4 + 4]; v1 .y = vertices [i4 + 5]; v1 .z = vertices [i4 + 6];
|
|
504
|
+
v2 .x = vertices [i4 + 8]; v2 .y = vertices [i4 + 9]; v2 .z = vertices [i4 + 10];
|
|
505
|
+
|
|
506
|
+
if (hitRay .intersectsTriangle (v0, v1, v2, uvt))
|
|
507
|
+
{
|
|
508
|
+
// Get barycentric coordinates.
|
|
509
|
+
|
|
510
|
+
const
|
|
511
|
+
u = uvt .u,
|
|
512
|
+
v = uvt .v,
|
|
513
|
+
t = uvt .t;
|
|
514
|
+
|
|
515
|
+
// Determine vectors for X3DPointingDeviceSensors.
|
|
516
|
+
|
|
517
|
+
const point = new Vector3 (t * vertices [i4] + u * vertices [i4 + 4] + v * vertices [i4 + 8],
|
|
518
|
+
t * vertices [i4 + 1] + u * vertices [i4 + 5] + v * vertices [i4 + 9],
|
|
519
|
+
t * vertices [i4 + 2] + u * vertices [i4 + 6] + v * vertices [i4 + 10]);
|
|
520
|
+
|
|
521
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (point)), clipPlanes))
|
|
522
|
+
continue;
|
|
523
|
+
|
|
524
|
+
const texCoord = new Vector2 (t * texCoords [i4] + u * texCoords [i4 + 4] + v * texCoords [i4 + 8],
|
|
525
|
+
t * texCoords [i4 + 1] + u * texCoords [i4 + 5] + v * texCoords [i4 + 9]);
|
|
526
|
+
|
|
527
|
+
const i3 = i * 3;
|
|
528
|
+
|
|
529
|
+
const normal = new Vector3 (t * normals [i3] + u * normals [i3 + 3] + v * normals [i3 + 6],
|
|
530
|
+
t * normals [i3 + 1] + u * normals [i3 + 4] + v * normals [i3 + 7],
|
|
531
|
+
t * normals [i3 + 2] + u * normals [i3 + 5] + v * normals [i3 + 8]);
|
|
532
|
+
|
|
533
|
+
intersections .push ({ texCoord: texCoord, normal: normal, point: this .getMatrix () .multVecMatrix (point) });
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return intersections .length;
|
|
539
|
+
}
|
|
540
|
+
catch (error)
|
|
541
|
+
{
|
|
542
|
+
console .log (error);
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
})(),
|
|
547
|
+
intersectsBBox: (function ()
|
|
548
|
+
{
|
|
549
|
+
const intersection = new Vector3 (0, 0, 0);
|
|
550
|
+
|
|
551
|
+
return function (hitRay, offset = 0)
|
|
552
|
+
{
|
|
553
|
+
const
|
|
554
|
+
planes = this .planes,
|
|
555
|
+
min = this .min,
|
|
556
|
+
max = this .max,
|
|
557
|
+
minX = min .x - offset,
|
|
558
|
+
maxX = max .x + offset,
|
|
559
|
+
minY = min .y - offset,
|
|
560
|
+
maxY = max .y + offset,
|
|
561
|
+
minZ = min .z - offset,
|
|
562
|
+
maxZ = max .z + offset;
|
|
563
|
+
|
|
564
|
+
// front
|
|
565
|
+
if (planes [0] .intersectsLine (hitRay, intersection))
|
|
566
|
+
{
|
|
567
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
568
|
+
intersection .y >= minY && intersection .y <= maxY)
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// back
|
|
573
|
+
if (planes [1] .intersectsLine (hitRay, intersection))
|
|
574
|
+
{
|
|
575
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
576
|
+
intersection .y >= minY && intersection .y <= maxY)
|
|
577
|
+
return true;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// top
|
|
581
|
+
if (planes [2] .intersectsLine (hitRay, intersection))
|
|
582
|
+
{
|
|
583
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
584
|
+
intersection .z >= minZ && intersection .z <= maxZ)
|
|
585
|
+
return true;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// bottom
|
|
589
|
+
if (planes [3] .intersectsLine (hitRay, intersection))
|
|
590
|
+
{
|
|
591
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
592
|
+
intersection .z >= minZ && intersection .z <= maxZ)
|
|
593
|
+
return true;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// right
|
|
597
|
+
if (planes [4] .intersectsLine (hitRay, intersection))
|
|
598
|
+
{
|
|
599
|
+
if (intersection .y >= minY && intersection .y <= maxY &&
|
|
600
|
+
intersection .z >= minZ && intersection .z <= maxZ)
|
|
601
|
+
return true;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
return false;
|
|
605
|
+
};
|
|
606
|
+
})(),
|
|
607
|
+
intersectsBox: (function ()
|
|
608
|
+
{
|
|
609
|
+
const
|
|
610
|
+
v0 = new Vector3 (0, 0, 0),
|
|
611
|
+
v1 = new Vector3 (0, 0, 0),
|
|
612
|
+
v2 = new Vector3 (0, 0, 0),
|
|
613
|
+
invMatrix = new Matrix4 (),
|
|
614
|
+
clipPoint = new Vector3 (0, 0, 0);
|
|
615
|
+
|
|
616
|
+
return function (box, clipPlanes, modelViewMatrix)
|
|
617
|
+
{
|
|
618
|
+
try
|
|
619
|
+
{
|
|
620
|
+
if (box .intersectsBox (this .bbox))
|
|
621
|
+
{
|
|
622
|
+
box .multRight (invMatrix .assign (this .getMatrix ()) .inverse ());
|
|
623
|
+
|
|
624
|
+
this .transformMatrix (modelViewMatrix); // Apply screen transformations from screen nodes.
|
|
625
|
+
|
|
626
|
+
const vertices = this .vertices .getValue ();
|
|
627
|
+
|
|
628
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
629
|
+
{
|
|
630
|
+
const i4 = i * 4;
|
|
631
|
+
|
|
632
|
+
v0 .x = vertices [i4]; v0 .y = vertices [i4 + 1]; v0 .z = vertices [i4 + 2];
|
|
633
|
+
v1 .x = vertices [i4 + 4]; v1 .y = vertices [i4 + 5]; v1 .z = vertices [i4 + 6];
|
|
634
|
+
v2 .x = vertices [i4 + 8]; v2 .y = vertices [i4 + 9]; v2 .z = vertices [i4 + 10];
|
|
635
|
+
|
|
636
|
+
if (box .intersectsTriangle (v0, v1, v2))
|
|
637
|
+
{
|
|
638
|
+
if (clipPlanes .length)
|
|
639
|
+
{
|
|
640
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (v0)), clipPlanes))
|
|
641
|
+
continue;
|
|
642
|
+
|
|
643
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (v1)), clipPlanes))
|
|
644
|
+
continue;
|
|
645
|
+
|
|
646
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (v2)), clipPlanes))
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
return true;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
catch (error)
|
|
658
|
+
{
|
|
659
|
+
console .log (error);
|
|
660
|
+
return false;
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
})(),
|
|
664
|
+
set_live__: function ()
|
|
665
|
+
{
|
|
666
|
+
if (this .isLive () .getValue ())
|
|
667
|
+
this .getBrowser () .getBrowserOptions () ._Shading .addInterest ("set_shading__", this);
|
|
668
|
+
else
|
|
669
|
+
this .getBrowser () .getBrowserOptions () ._Shading .removeInterest ("set_shading__", this);
|
|
670
|
+
},
|
|
671
|
+
set_shading__: (function ()
|
|
672
|
+
{
|
|
673
|
+
const
|
|
674
|
+
v0 = new Vector3 (0, 0, 0),
|
|
675
|
+
v1 = new Vector3 (0, 0, 0),
|
|
676
|
+
v2 = new Vector3 (0, 0, 0),
|
|
677
|
+
normal = new Vector3 (0, 0, 0);
|
|
678
|
+
|
|
679
|
+
return function (shading)
|
|
680
|
+
{
|
|
681
|
+
if (this .geometryType < 2)
|
|
682
|
+
return;
|
|
683
|
+
|
|
684
|
+
const flatShading = this .getBrowser () .getBrowserOptions () .getShading () === Shading .FLAT;
|
|
685
|
+
|
|
686
|
+
if (flatShading === this .flatShading)
|
|
687
|
+
return;
|
|
688
|
+
|
|
689
|
+
this .flatShading = flatShading;
|
|
690
|
+
|
|
691
|
+
// Generate flat normals if needed.
|
|
692
|
+
|
|
693
|
+
const gl = this .getBrowser () .getContext ();
|
|
694
|
+
|
|
695
|
+
if (flatShading)
|
|
696
|
+
{
|
|
697
|
+
if (! this .flatNormals .length)
|
|
698
|
+
{
|
|
699
|
+
const
|
|
700
|
+
cw = this .frontFace === gl .CW,
|
|
701
|
+
flatNormals = this .flatNormals,
|
|
702
|
+
vertices = this .vertices .getValue ();
|
|
703
|
+
|
|
704
|
+
for (let i = 0, length = vertices .length; i < length; i += 12)
|
|
705
|
+
{
|
|
706
|
+
Triangle3 .normal (v0 .set (vertices [i], vertices [i + 1], vertices [i + 2]),
|
|
707
|
+
v1 .set (vertices [i + 4], vertices [i + 5], vertices [i + 6]),
|
|
708
|
+
v2 .set (vertices [i + 8], vertices [i + 9], vertices [i + 10]),
|
|
709
|
+
normal);
|
|
710
|
+
|
|
711
|
+
if (cw)
|
|
712
|
+
normal .negate ();
|
|
713
|
+
|
|
714
|
+
flatNormals .push (normal .x, normal .y, normal .z,
|
|
715
|
+
normal .x, normal .y, normal .z,
|
|
716
|
+
normal .x, normal .y, normal .z);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
flatNormals .shrinkToFit ();
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Transfer normals.
|
|
724
|
+
|
|
725
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .normalBuffer);
|
|
726
|
+
gl .bufferData (gl .ARRAY_BUFFER, flatShading ? this .flatNormals .getValue () : this .normals .getValue (), gl .STATIC_DRAW);
|
|
727
|
+
};
|
|
728
|
+
})(),
|
|
729
|
+
requestRebuild: function ()
|
|
730
|
+
{
|
|
731
|
+
this ._rebuild .addEvent ();
|
|
732
|
+
},
|
|
733
|
+
rebuild: (function ()
|
|
734
|
+
{
|
|
735
|
+
const point = new Vector3 (0, 0, 0);
|
|
736
|
+
|
|
737
|
+
return function ()
|
|
738
|
+
{
|
|
739
|
+
this .clear ();
|
|
740
|
+
this .build ();
|
|
741
|
+
|
|
742
|
+
// Shrink arrays before transfer to graphics card.
|
|
743
|
+
|
|
744
|
+
for (const attrib of this .attribs)
|
|
745
|
+
attrib .shrinkToFit ();
|
|
746
|
+
|
|
747
|
+
for (const multiTexCoord of this .multiTexCoords)
|
|
748
|
+
multiTexCoord .shrinkToFit ();
|
|
749
|
+
|
|
750
|
+
this .fogDepths .shrinkToFit ();
|
|
751
|
+
this .colors .shrinkToFit ();
|
|
752
|
+
this .normals .shrinkToFit ();
|
|
753
|
+
this .vertices .shrinkToFit ();
|
|
754
|
+
|
|
755
|
+
// Determine bbox.
|
|
756
|
+
|
|
757
|
+
const
|
|
758
|
+
min = this .min,
|
|
759
|
+
max = this .max,
|
|
760
|
+
vertices = this .vertices .getValue ();
|
|
761
|
+
|
|
762
|
+
if (vertices .length)
|
|
763
|
+
{
|
|
764
|
+
if (min .x === Number .POSITIVE_INFINITY)
|
|
765
|
+
{
|
|
766
|
+
for (let i = 0, length = vertices .length; i < length; i += 4)
|
|
767
|
+
{
|
|
768
|
+
point .set (vertices [i], vertices [i + 1], vertices [i + 2]);
|
|
769
|
+
|
|
770
|
+
min .min (point);
|
|
771
|
+
max .max (point);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
753
774
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
775
|
+
this .bbox .setExtents (min, max);
|
|
776
|
+
}
|
|
777
|
+
else
|
|
778
|
+
{
|
|
779
|
+
this .bbox .setExtents (min .set (0, 0, 0), max .set (0, 0, 0));
|
|
780
|
+
}
|
|
758
781
|
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
else
|
|
762
|
-
{
|
|
763
|
-
this .bbox .setExtents (min .set (0, 0, 0), max .set (0, 0, 0));
|
|
764
|
-
}
|
|
782
|
+
this ._bbox_changed .addEvent ();
|
|
765
783
|
|
|
766
|
-
|
|
784
|
+
for (let i = 0; i < 5; ++ i)
|
|
785
|
+
this .planes [i] .set (i % 2 ? min : max, boxNormals [i]);
|
|
767
786
|
|
|
768
|
-
|
|
787
|
+
// Generate texCoord if needed.
|
|
769
788
|
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
789
|
+
if (this .geometryType > 1)
|
|
790
|
+
{
|
|
791
|
+
if (this .multiTexCoords .length === 0)
|
|
792
|
+
this .multiTexCoords .push (this .buildTexCoords ());
|
|
774
793
|
|
|
775
|
-
|
|
776
|
-
|
|
794
|
+
const
|
|
795
|
+
last = this .multiTexCoords .length - 1,
|
|
796
|
+
length = this .getBrowser () .getMaxTextures ();
|
|
797
|
+
|
|
798
|
+
for (let i = this .multiTexCoords .length; i < length; ++ i)
|
|
799
|
+
this .multiTexCoords [i] = this .multiTexCoords [last];
|
|
800
|
+
|
|
801
|
+
this .multiTexCoords .length = length;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// Upload normals or flat normals.
|
|
805
|
+
|
|
806
|
+
this .set_shading__ (this .getBrowser () .getBrowserOptions () ._Shading);
|
|
807
|
+
|
|
808
|
+
// Upload arrays.
|
|
809
|
+
|
|
810
|
+
this .transfer ();
|
|
811
|
+
};
|
|
812
|
+
})(),
|
|
813
|
+
clear: function ()
|
|
814
|
+
{
|
|
815
|
+
// BBox
|
|
816
|
+
|
|
817
|
+
this .min .set (Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY);
|
|
818
|
+
this .max .set (Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY);
|
|
819
|
+
|
|
820
|
+
// Create attrib arrays.
|
|
821
|
+
{
|
|
822
|
+
const attribs = this .attribs;
|
|
823
|
+
|
|
824
|
+
for (const attrib of attribs)
|
|
825
|
+
attrib .length = 0;
|
|
826
|
+
|
|
827
|
+
const length = this .attribNodes .length;
|
|
828
|
+
|
|
829
|
+
for (let a = attribs .length; a < length; ++ a)
|
|
830
|
+
attribs [a] = X3DGeometryNode .createArray ();
|
|
831
|
+
|
|
832
|
+
attribs .length = length;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// Buffer
|
|
836
|
+
|
|
837
|
+
this .flatShading = undefined;
|
|
838
|
+
|
|
839
|
+
this .fogDepths .length = 0;
|
|
840
|
+
this .colors .length = 0;
|
|
841
|
+
this .multiTexCoords .length = 0;
|
|
842
|
+
this .texCoords .length = 0;
|
|
843
|
+
this .normals .length = 0;
|
|
844
|
+
this .flatNormals .length = 0;
|
|
845
|
+
this .vertices .length = 0;
|
|
846
|
+
},
|
|
847
|
+
transfer: function ()
|
|
848
|
+
{
|
|
849
|
+
const
|
|
850
|
+
gl = this .getBrowser () .getContext (),
|
|
851
|
+
count = this .vertices .length / 4;
|
|
852
|
+
|
|
853
|
+
// Transfer attribs.
|
|
854
|
+
|
|
855
|
+
for (let i = this .attribBuffers .length, length = this .attribs .length; i < length; ++ i)
|
|
856
|
+
this .attribBuffers .push (gl .createBuffer ());
|
|
857
|
+
|
|
858
|
+
for (let i = 0, length = this .attribs .length; i < length; ++ i)
|
|
859
|
+
{
|
|
860
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .attribBuffers [i]);
|
|
861
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .attribs [i] .getValue (), gl .STATIC_DRAW);
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// Transfer fog depths.
|
|
865
|
+
|
|
866
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .fogDepthBuffer);
|
|
867
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .fogDepths .getValue (), gl .STATIC_DRAW);
|
|
868
|
+
this .fogCoords = !! (this .fogDepths .length);
|
|
869
|
+
// Transfer colors.
|
|
870
|
+
|
|
871
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
872
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .colors .getValue (), gl .STATIC_DRAW);
|
|
873
|
+
this .colorMaterial = !! (this .colors .length);
|
|
874
|
+
|
|
875
|
+
// Transfer multiTexCoords.
|
|
876
|
+
|
|
877
|
+
for (let i = this .texCoordBuffers .length, length = this .multiTexCoords .length; i < length; ++ i)
|
|
878
|
+
this .texCoordBuffers .push (gl .createBuffer ());
|
|
879
|
+
|
|
880
|
+
for (let i = 0, length = this .multiTexCoords .length; i < length; ++ i)
|
|
881
|
+
{
|
|
882
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .texCoordBuffers [i]);
|
|
883
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .multiTexCoords [i] .getValue (), gl .STATIC_DRAW);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Transfer vertices.
|
|
887
|
+
|
|
888
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .vertexBuffer);
|
|
889
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .vertices .getValue (), gl .STATIC_DRAW);
|
|
890
|
+
this .vertexCount = count;
|
|
891
|
+
|
|
892
|
+
// Setup render functions.
|
|
893
|
+
|
|
894
|
+
if (this .vertexCount)
|
|
895
|
+
{
|
|
896
|
+
// Use default render functions.
|
|
897
|
+
delete this .depth;
|
|
898
|
+
delete this .display;
|
|
899
|
+
delete this .displayParticles;
|
|
900
|
+
}
|
|
901
|
+
else
|
|
902
|
+
{
|
|
903
|
+
// Use no render function.
|
|
904
|
+
this .depth = Function .prototype;
|
|
905
|
+
this .display = Function .prototype;
|
|
906
|
+
this .displayParticles = Function .prototype;
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
traverse: function (type, renderObject)
|
|
910
|
+
{ },
|
|
911
|
+
depth: function (gl, context, shaderNode)
|
|
912
|
+
{
|
|
913
|
+
// Setup vertex attributes.
|
|
914
|
+
|
|
915
|
+
// Attribs in depth rendering are not supported.
|
|
916
|
+
//for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
917
|
+
// attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
918
|
+
|
|
919
|
+
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
920
|
+
|
|
921
|
+
//for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
922
|
+
// attribNodes [i] .disable (gl, shaderNode);
|
|
923
|
+
|
|
924
|
+
gl .drawArrays (this .primitiveMode, 0, this .vertexCount);
|
|
925
|
+
},
|
|
926
|
+
display: function (gl, context)
|
|
927
|
+
{
|
|
928
|
+
try
|
|
929
|
+
{
|
|
930
|
+
const
|
|
931
|
+
appearanceNode = context .shapeNode .getAppearance (),
|
|
932
|
+
materialNode = appearanceNode .materialNode,
|
|
933
|
+
backMaterialNode = appearanceNode .backMaterialNode,
|
|
934
|
+
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
935
|
+
|
|
936
|
+
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
937
|
+
{
|
|
938
|
+
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, true, true);
|
|
939
|
+
}
|
|
940
|
+
else
|
|
941
|
+
{
|
|
942
|
+
const backShaderNode = appearanceNode .shaderNode || backMaterialNode .getShader (context .browser, context .shadow)
|
|
943
|
+
|
|
944
|
+
this .displayGeometry (gl, context, appearanceNode, backShaderNode, true, false);
|
|
945
|
+
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, false, true);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
catch (error)
|
|
949
|
+
{
|
|
950
|
+
// Catch error from setLocalUniforms.
|
|
951
|
+
console .log (error);
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
displayGeometry: function (gl, context, appearanceNode, shaderNode, back, front)
|
|
955
|
+
{
|
|
956
|
+
if (shaderNode .getValid ())
|
|
957
|
+
{
|
|
958
|
+
const
|
|
959
|
+
blendModeNode = appearanceNode .blendModeNode,
|
|
960
|
+
attribNodes = this .attribNodes,
|
|
961
|
+
attribBuffers = this .attribBuffers;
|
|
962
|
+
|
|
963
|
+
if (blendModeNode)
|
|
964
|
+
blendModeNode .enable (gl);
|
|
965
|
+
|
|
966
|
+
shaderNode .enable (gl);
|
|
967
|
+
shaderNode .setLocalUniforms (gl, context, front);
|
|
968
|
+
|
|
969
|
+
// Setup vertex attributes.
|
|
970
|
+
|
|
971
|
+
for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
972
|
+
attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
973
|
+
|
|
974
|
+
if (this .fogCoords)
|
|
975
|
+
shaderNode .enableFogDepthAttribute (gl, this .fogDepthBuffer);
|
|
976
|
+
|
|
977
|
+
if (this .colorMaterial)
|
|
978
|
+
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
979
|
+
|
|
980
|
+
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
981
|
+
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
982
|
+
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
983
|
+
|
|
984
|
+
// Draw depending on wireframe, solid and transparent.
|
|
985
|
+
|
|
986
|
+
if (shaderNode .wireframe)
|
|
987
|
+
{
|
|
988
|
+
// Points and Wireframes.
|
|
989
|
+
|
|
990
|
+
if (shaderNode .primitiveMode === gl .POINTS)
|
|
991
|
+
{
|
|
992
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
993
|
+
}
|
|
994
|
+
else
|
|
995
|
+
{
|
|
996
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
997
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
else
|
|
1001
|
+
{
|
|
1002
|
+
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
1003
|
+
|
|
1004
|
+
gl .frontFace (positiveScale ? this .frontFace : (this .frontFace === gl .CCW ? gl .CW : gl .CCW));
|
|
1005
|
+
|
|
1006
|
+
if (context .transparent || back !== front)
|
|
1007
|
+
{
|
|
1008
|
+
// Render transparent or back or front.
|
|
1009
|
+
|
|
1010
|
+
gl .enable (gl .CULL_FACE);
|
|
1011
|
+
|
|
1012
|
+
// Render back.
|
|
1013
|
+
|
|
1014
|
+
if (back && !this .solid)
|
|
1015
|
+
{
|
|
1016
|
+
gl .cullFace (gl .FRONT);
|
|
1017
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
// Render front.
|
|
1021
|
+
|
|
1022
|
+
if (front)
|
|
1023
|
+
{
|
|
1024
|
+
gl .cullFace (gl .BACK);
|
|
1025
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
else
|
|
1029
|
+
{
|
|
1030
|
+
// Render solid or both sides.
|
|
1031
|
+
|
|
1032
|
+
if (this .solid)
|
|
1033
|
+
gl .enable (gl .CULL_FACE);
|
|
1034
|
+
else
|
|
1035
|
+
gl .disable (gl .CULL_FACE);
|
|
1036
|
+
|
|
1037
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
for (const attribNode of attribNodes)
|
|
1042
|
+
attribNode .disable (gl, shaderNode);
|
|
1043
|
+
|
|
1044
|
+
if (this .fogCoords)
|
|
1045
|
+
shaderNode .disableFogDepthAttribute (gl);
|
|
1046
|
+
|
|
1047
|
+
if (this .colorMaterial)
|
|
1048
|
+
shaderNode .disableColorAttribute (gl);
|
|
1049
|
+
|
|
1050
|
+
shaderNode .disableTexCoordAttribute (gl);
|
|
1051
|
+
shaderNode .disableNormalAttribute (gl);
|
|
1052
|
+
|
|
1053
|
+
if (blendModeNode)
|
|
1054
|
+
blendModeNode .disable (gl);
|
|
1055
|
+
}
|
|
1056
|
+
},
|
|
1057
|
+
displayParticlesDepth: function (gl, context, shaderNode, particles, numParticles)
|
|
1058
|
+
{
|
|
1059
|
+
// Attribs in depth rendering are not supported:
|
|
1060
|
+
//for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
1061
|
+
// attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
1062
|
+
|
|
1063
|
+
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
1064
|
+
|
|
1065
|
+
// Draw depending on wireframe, solid and transparent.
|
|
1066
|
+
|
|
1067
|
+
const
|
|
1068
|
+
modelViewMatrix = context .modelViewMatrix,
|
|
1069
|
+
x = modelViewMatrix [12],
|
|
1070
|
+
y = modelViewMatrix [13],
|
|
1071
|
+
z = modelViewMatrix [14];
|
|
1072
|
+
|
|
1073
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1074
|
+
{
|
|
1075
|
+
const particle = particles [p];
|
|
1076
|
+
|
|
1077
|
+
modelViewMatrix [12] = x;
|
|
1078
|
+
modelViewMatrix [13] = y;
|
|
1079
|
+
modelViewMatrix [14] = z;
|
|
1080
|
+
|
|
1081
|
+
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1082
|
+
|
|
1083
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1084
|
+
|
|
1085
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
//for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
1089
|
+
// attribNodes [i] .disable (gl, shaderNode);
|
|
1090
|
+
},
|
|
1091
|
+
displayParticles: function (gl, context, particles, numParticles)
|
|
1092
|
+
{
|
|
1093
|
+
try
|
|
1094
|
+
{
|
|
1095
|
+
const
|
|
1096
|
+
appearanceNode = context .shapeNode .getAppearance (),
|
|
1097
|
+
materialNode = appearanceNode .materialNode,
|
|
1098
|
+
backMaterialNode = appearanceNode .backMaterialNode,
|
|
1099
|
+
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
1100
|
+
|
|
1101
|
+
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
1102
|
+
{
|
|
1103
|
+
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, true, true, particles, numParticles);
|
|
1104
|
+
}
|
|
1105
|
+
else
|
|
1106
|
+
{
|
|
1107
|
+
const backShaderNode = appearanceNode .shaderNode || backMaterialNode .getShader (context .browser, context .shadow);
|
|
1108
|
+
|
|
1109
|
+
this .displayParticlesGeometry (gl, context, appearanceNode, backShaderNode, true, false, particles, numParticles);
|
|
1110
|
+
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, false, true, particles, numParticles);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
catch (error)
|
|
1114
|
+
{
|
|
1115
|
+
// Catch error from setLocalUniforms.
|
|
1116
|
+
console .log (error);
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
displayParticlesGeometry: function (gl, context, appearanceNode, shaderNode, back, front, particles, numParticles)
|
|
1120
|
+
{
|
|
1121
|
+
if (shaderNode .getValid ())
|
|
1122
|
+
{
|
|
1123
|
+
const
|
|
1124
|
+
blendModeNode = appearanceNode .blendModeNode,
|
|
1125
|
+
attribNodes = this .attribNodes,
|
|
1126
|
+
attribBuffers = this .attribBuffers;
|
|
1127
|
+
|
|
1128
|
+
if (blendModeNode)
|
|
1129
|
+
blendModeNode .enable (gl);
|
|
1130
|
+
|
|
1131
|
+
// Setup shader.
|
|
1132
|
+
|
|
1133
|
+
shaderNode .enable (gl);
|
|
1134
|
+
shaderNode .setLocalUniforms (gl, context, front);
|
|
1135
|
+
|
|
1136
|
+
// Setup vertex attributes.
|
|
1137
|
+
|
|
1138
|
+
for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
1139
|
+
attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
1140
|
+
|
|
1141
|
+
if (this .fogCoords)
|
|
1142
|
+
shaderNode .enableFogDepthAttribute (gl, this .fogDepthBuffer);
|
|
1143
|
+
|
|
1144
|
+
if (this .colorMaterial)
|
|
1145
|
+
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
1146
|
+
|
|
1147
|
+
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
1148
|
+
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
1149
|
+
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
1150
|
+
|
|
1151
|
+
// Draw depending on wireframe, solid and transparent.
|
|
1152
|
+
|
|
1153
|
+
const
|
|
1154
|
+
modelViewMatrix = context .modelViewMatrix,
|
|
1155
|
+
x = modelViewMatrix [12],
|
|
1156
|
+
y = modelViewMatrix [13],
|
|
1157
|
+
z = modelViewMatrix [14];
|
|
1158
|
+
|
|
1159
|
+
if (shaderNode .wireframe)
|
|
1160
|
+
{
|
|
1161
|
+
// Points and Wireframes.
|
|
1162
|
+
|
|
1163
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1164
|
+
{
|
|
1165
|
+
const particle = particles [p];
|
|
1166
|
+
|
|
1167
|
+
modelViewMatrix [12] = x;
|
|
1168
|
+
modelViewMatrix [13] = y;
|
|
1169
|
+
modelViewMatrix [14] = z;
|
|
1170
|
+
|
|
1171
|
+
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1172
|
+
|
|
1173
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1174
|
+
|
|
1175
|
+
if (shaderNode .primitiveMode === gl .POINTS)
|
|
1176
|
+
{
|
|
1177
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1178
|
+
}
|
|
1179
|
+
else
|
|
1180
|
+
{
|
|
1181
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
1182
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
else
|
|
1187
|
+
{
|
|
1188
|
+
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
1189
|
+
|
|
1190
|
+
gl .frontFace (positiveScale ? this .frontFace : (this .frontFace === gl .CCW ? gl .CW : gl .CCW));
|
|
1191
|
+
|
|
1192
|
+
if (context .transparent || back !== front)
|
|
1193
|
+
{
|
|
1194
|
+
// Render transparent or back or front.
|
|
1195
|
+
|
|
1196
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1197
|
+
{
|
|
1198
|
+
const particle = particles [p];
|
|
1199
|
+
|
|
1200
|
+
modelViewMatrix [12] = x;
|
|
1201
|
+
modelViewMatrix [13] = y;
|
|
1202
|
+
modelViewMatrix [14] = z;
|
|
1203
|
+
|
|
1204
|
+
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1205
|
+
|
|
1206
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1207
|
+
|
|
1208
|
+
gl .enable (gl .CULL_FACE);
|
|
1209
|
+
|
|
1210
|
+
if (back && !this .solid)
|
|
1211
|
+
{
|
|
1212
|
+
gl .cullFace (gl .FRONT);
|
|
1213
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
if (front)
|
|
1217
|
+
{
|
|
1218
|
+
gl .cullFace (gl .BACK);
|
|
1219
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
else
|
|
1224
|
+
{
|
|
1225
|
+
// Render solid or both sides.
|
|
777
1226
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
this .multiTexCoords .length = length;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
// Upload normals or flat normals.
|
|
787
|
-
|
|
788
|
-
this .set_shading__ (this .getBrowser () .getBrowserOptions () .Shading_);
|
|
789
|
-
|
|
790
|
-
// Upload arrays.
|
|
791
|
-
|
|
792
|
-
this .transfer ();
|
|
793
|
-
};
|
|
794
|
-
})(),
|
|
795
|
-
clear: function ()
|
|
796
|
-
{
|
|
797
|
-
// BBox
|
|
798
|
-
|
|
799
|
-
this .min .set (Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY);
|
|
800
|
-
this .max .set (Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY, Number .NEGATIVE_INFINITY);
|
|
801
|
-
|
|
802
|
-
// Create attrib arrays.
|
|
803
|
-
|
|
804
|
-
const attribs = this .attribs;
|
|
805
|
-
|
|
806
|
-
for (var a = 0, length = attribs .length; a < length; ++ a)
|
|
807
|
-
attribs [a] .length = 0;
|
|
808
|
-
|
|
809
|
-
for (var a = attribs .length, length = this .attribNodes .length; a < length; ++ a)
|
|
810
|
-
attribs [a] = X3DGeometryNode .createArray ();
|
|
811
|
-
|
|
812
|
-
attribs .length = length;
|
|
813
|
-
|
|
814
|
-
// Buffer
|
|
815
|
-
|
|
816
|
-
this .flatShading = undefined;
|
|
817
|
-
|
|
818
|
-
this .fogDepths .length = 0;
|
|
819
|
-
this .colors .length = 0;
|
|
820
|
-
this .multiTexCoords .length = 0;
|
|
821
|
-
this .texCoords .length = 0;
|
|
822
|
-
this .normals .length = 0;
|
|
823
|
-
this .flatNormals .length = 0;
|
|
824
|
-
this .vertices .length = 0;
|
|
825
|
-
},
|
|
826
|
-
transfer: function ()
|
|
827
|
-
{
|
|
828
|
-
const
|
|
829
|
-
gl = this .getBrowser () .getContext (),
|
|
830
|
-
count = this .vertices .length / 4;
|
|
831
|
-
|
|
832
|
-
// Transfer attribs.
|
|
833
|
-
|
|
834
|
-
for (let i = this .attribBuffers .length, length = this .attribs .length; i < length; ++ i)
|
|
835
|
-
this .attribBuffers .push (gl .createBuffer ());
|
|
836
|
-
|
|
837
|
-
for (let i = 0, length = this .attribs .length; i < length; ++ i)
|
|
838
|
-
{
|
|
839
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .attribBuffers [i]);
|
|
840
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .attribs [i] .getValue (), gl .STATIC_DRAW);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
// Transfer fog depths.
|
|
844
|
-
|
|
845
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .fogDepthBuffer);
|
|
846
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .fogDepths .getValue (), gl .STATIC_DRAW);
|
|
847
|
-
this .fogCoords = !! (this .fogDepths .length);
|
|
848
|
-
// Transfer colors.
|
|
849
|
-
|
|
850
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
851
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .colors .getValue (), gl .STATIC_DRAW);
|
|
852
|
-
this .colorMaterial = !! (this .colors .length);
|
|
853
|
-
|
|
854
|
-
// Transfer multiTexCoords.
|
|
855
|
-
|
|
856
|
-
for (let i = this .texCoordBuffers .length, length = this .multiTexCoords .length; i < length; ++ i)
|
|
857
|
-
this .texCoordBuffers .push (gl .createBuffer ());
|
|
858
|
-
|
|
859
|
-
for (let i = 0, length = this .multiTexCoords .length; i < length; ++ i)
|
|
860
|
-
{
|
|
861
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .texCoordBuffers [i]);
|
|
862
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .multiTexCoords [i] .getValue (), gl .STATIC_DRAW);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
// Transfer vertices.
|
|
866
|
-
|
|
867
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .vertexBuffer);
|
|
868
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .vertices .getValue (), gl .STATIC_DRAW);
|
|
869
|
-
this .vertexCount = count;
|
|
870
|
-
|
|
871
|
-
// Setup render functions.
|
|
872
|
-
|
|
873
|
-
if (this .vertexCount)
|
|
874
|
-
{
|
|
875
|
-
// Use default render functions.
|
|
876
|
-
delete this .depth;
|
|
877
|
-
delete this .display;
|
|
878
|
-
delete this .displayParticles;
|
|
879
|
-
}
|
|
880
|
-
else
|
|
881
|
-
{
|
|
882
|
-
// Use no render function.
|
|
883
|
-
this .depth = Function .prototype;
|
|
884
|
-
this .display = Function .prototype;
|
|
885
|
-
this .displayParticles = Function .prototype;
|
|
886
|
-
}
|
|
887
|
-
},
|
|
888
|
-
traverse: function (type, renderObject)
|
|
889
|
-
{ },
|
|
890
|
-
depth: function (gl, context, shaderNode)
|
|
891
|
-
{
|
|
892
|
-
// Setup vertex attributes.
|
|
893
|
-
|
|
894
|
-
// Attribs in depth rendering are not supported.
|
|
895
|
-
//for (var i = 0, length = attribNodes .length; i < length; ++ i)
|
|
896
|
-
// attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
897
|
-
|
|
898
|
-
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
899
|
-
|
|
900
|
-
//for (var i = 0, length = attribNodes .length; i < length; ++ i)
|
|
901
|
-
// attribNodes [i] .disable (gl, shaderNode);
|
|
902
|
-
|
|
903
|
-
gl .drawArrays (this .primitiveMode, 0, this .vertexCount);
|
|
904
|
-
},
|
|
905
|
-
display: function (gl, context)
|
|
906
|
-
{
|
|
907
|
-
try
|
|
908
|
-
{
|
|
909
|
-
const
|
|
910
|
-
appearanceNode = context .shapeNode .getAppearance (),
|
|
911
|
-
materialNode = appearanceNode .materialNode,
|
|
912
|
-
backMaterialNode = appearanceNode .backMaterialNode,
|
|
913
|
-
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
914
|
-
|
|
915
|
-
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
916
|
-
{
|
|
917
|
-
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, true, true);
|
|
918
|
-
}
|
|
919
|
-
else
|
|
920
|
-
{
|
|
921
|
-
const backShaderNode = appearanceNode .shaderNode || backMaterialNode .getShader (context .browser, context .shadow)
|
|
922
|
-
|
|
923
|
-
this .displayGeometry (gl, context, appearanceNode, backShaderNode, true, false);
|
|
924
|
-
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, false, true);
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
catch (error)
|
|
928
|
-
{
|
|
929
|
-
// Catch error from setLocalUniforms.
|
|
930
|
-
console .log (error);
|
|
931
|
-
}
|
|
932
|
-
},
|
|
933
|
-
displayGeometry: function (gl, context, appearanceNode, shaderNode, back, front)
|
|
934
|
-
{
|
|
935
|
-
if (shaderNode .getValid ())
|
|
936
|
-
{
|
|
937
|
-
const
|
|
938
|
-
blendModeNode = appearanceNode .blendModeNode,
|
|
939
|
-
attribNodes = this .attribNodes,
|
|
940
|
-
attribBuffers = this .attribBuffers;
|
|
941
|
-
|
|
942
|
-
if (blendModeNode)
|
|
943
|
-
blendModeNode .enable (gl);
|
|
944
|
-
|
|
945
|
-
shaderNode .enable (gl);
|
|
946
|
-
shaderNode .setLocalUniforms (gl, context, front);
|
|
947
|
-
|
|
948
|
-
// Setup vertex attributes.
|
|
949
|
-
|
|
950
|
-
for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
951
|
-
attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
952
|
-
|
|
953
|
-
if (this .fogCoords)
|
|
954
|
-
shaderNode .enableFogDepthAttribute (gl, this .fogDepthBuffer);
|
|
955
|
-
|
|
956
|
-
if (this .colorMaterial)
|
|
957
|
-
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
958
|
-
|
|
959
|
-
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
960
|
-
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
961
|
-
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
962
|
-
|
|
963
|
-
// Draw depending on wireframe, solid and transparent.
|
|
964
|
-
|
|
965
|
-
if (shaderNode .wireframe)
|
|
966
|
-
{
|
|
967
|
-
// Points and Wireframes.
|
|
968
|
-
|
|
969
|
-
if (shaderNode .primitiveMode === gl .POINTS)
|
|
970
|
-
{
|
|
971
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
972
|
-
}
|
|
973
|
-
else
|
|
974
|
-
{
|
|
975
|
-
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
976
|
-
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
else
|
|
980
|
-
{
|
|
981
|
-
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
982
|
-
|
|
983
|
-
gl .frontFace (positiveScale ? this .frontFace : (this .frontFace === gl .CCW ? gl .CW : gl .CCW));
|
|
984
|
-
|
|
985
|
-
if (context .transparent || back !== front)
|
|
986
|
-
{
|
|
987
|
-
// Render transparent or back or front.
|
|
988
|
-
|
|
989
|
-
gl .enable (gl .CULL_FACE);
|
|
990
|
-
|
|
991
|
-
// Render back.
|
|
992
|
-
|
|
993
|
-
if (back && !this .solid)
|
|
994
|
-
{
|
|
995
|
-
gl .cullFace (gl .FRONT);
|
|
996
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// Render front.
|
|
1000
|
-
|
|
1001
|
-
if (front)
|
|
1002
|
-
{
|
|
1003
|
-
gl .cullFace (gl .BACK);
|
|
1004
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
else
|
|
1008
|
-
{
|
|
1009
|
-
// Render solid or both sides.
|
|
1010
|
-
|
|
1011
|
-
if (this .solid)
|
|
1012
|
-
gl .enable (gl .CULL_FACE);
|
|
1013
|
-
else
|
|
1014
|
-
gl .disable (gl .CULL_FACE);
|
|
1015
|
-
|
|
1016
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
for (const attribNode of attribNodes)
|
|
1021
|
-
attribNode .disable (gl, shaderNode);
|
|
1022
|
-
|
|
1023
|
-
if (this .fogCoords)
|
|
1024
|
-
shaderNode .disableFogDepthAttribute (gl);
|
|
1025
|
-
|
|
1026
|
-
if (this .colorMaterial)
|
|
1027
|
-
shaderNode .disableColorAttribute (gl);
|
|
1028
|
-
|
|
1029
|
-
shaderNode .disableTexCoordAttribute (gl);
|
|
1030
|
-
shaderNode .disableNormalAttribute (gl);
|
|
1031
|
-
shaderNode .disable (gl);
|
|
1032
|
-
|
|
1033
|
-
if (blendModeNode)
|
|
1034
|
-
blendModeNode .disable (gl);
|
|
1035
|
-
}
|
|
1036
|
-
},
|
|
1037
|
-
displayParticlesDepth: function (gl, context, shaderNode, particles, numParticles)
|
|
1038
|
-
{
|
|
1039
|
-
// Attribs in depth rendering are not supported:
|
|
1040
|
-
//for (var i = 0, length = attribNodes .length; i < length; ++ i)
|
|
1041
|
-
// attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
1042
|
-
|
|
1043
|
-
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
1044
|
-
|
|
1045
|
-
// Draw depending on wireframe, solid and transparent.
|
|
1046
|
-
|
|
1047
|
-
const
|
|
1048
|
-
modelViewMatrix = context .modelViewMatrix,
|
|
1049
|
-
x = modelViewMatrix [12],
|
|
1050
|
-
y = modelViewMatrix [13],
|
|
1051
|
-
z = modelViewMatrix [14];
|
|
1052
|
-
|
|
1053
|
-
for (let p = 0; p < numParticles; ++ p)
|
|
1054
|
-
{
|
|
1055
|
-
const particle = particles [p];
|
|
1056
|
-
|
|
1057
|
-
modelViewMatrix [12] = x;
|
|
1058
|
-
modelViewMatrix [13] = y;
|
|
1059
|
-
modelViewMatrix [14] = z;
|
|
1060
|
-
|
|
1061
|
-
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1062
|
-
|
|
1063
|
-
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1064
|
-
|
|
1065
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
//for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
1069
|
-
// attribNodes [i] .disable (gl, shaderNode);
|
|
1070
|
-
},
|
|
1071
|
-
displayParticles: function (gl, context, particles, numParticles)
|
|
1072
|
-
{
|
|
1073
|
-
try
|
|
1074
|
-
{
|
|
1075
|
-
const
|
|
1076
|
-
appearanceNode = context .shapeNode .getAppearance (),
|
|
1077
|
-
materialNode = appearanceNode .materialNode,
|
|
1078
|
-
backMaterialNode = appearanceNode .backMaterialNode,
|
|
1079
|
-
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
1080
|
-
|
|
1081
|
-
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
1082
|
-
{
|
|
1083
|
-
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, true, true, particles, numParticles);
|
|
1084
|
-
}
|
|
1085
|
-
else
|
|
1086
|
-
{
|
|
1087
|
-
const backShaderNode = appearanceNode .shaderNode || backMaterialNode .getShader (context .browser, context .shadow);
|
|
1088
|
-
|
|
1089
|
-
this .displayParticlesGeometry (gl, context, appearanceNode, backShaderNode, true, false, particles, numParticles);
|
|
1090
|
-
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, false, true, particles, numParticles);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
catch (error)
|
|
1094
|
-
{
|
|
1095
|
-
// Catch error from setLocalUniforms.
|
|
1096
|
-
console .log (error);
|
|
1097
|
-
}
|
|
1098
|
-
},
|
|
1099
|
-
displayParticlesGeometry: function (gl, context, appearanceNode, shaderNode, back, front, particles, numParticles)
|
|
1100
|
-
{
|
|
1101
|
-
if (shaderNode .getValid ())
|
|
1102
|
-
{
|
|
1103
|
-
const
|
|
1104
|
-
blendModeNode = appearanceNode .blendModeNode,
|
|
1105
|
-
attribNodes = this .attribNodes,
|
|
1106
|
-
attribBuffers = this .attribBuffers;
|
|
1107
|
-
|
|
1108
|
-
if (blendModeNode)
|
|
1109
|
-
blendModeNode .enable (gl);
|
|
1110
|
-
|
|
1111
|
-
// Setup shader.
|
|
1112
|
-
|
|
1113
|
-
shaderNode .enable (gl);
|
|
1114
|
-
shaderNode .setLocalUniforms (gl, context, front);
|
|
1115
|
-
|
|
1116
|
-
// Setup vertex attributes.
|
|
1117
|
-
|
|
1118
|
-
for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
1119
|
-
attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
1120
|
-
|
|
1121
|
-
if (this .fogCoords)
|
|
1122
|
-
shaderNode .enableFogDepthAttribute (gl, this .fogDepthBuffer);
|
|
1123
|
-
|
|
1124
|
-
if (this .colorMaterial)
|
|
1125
|
-
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
1126
|
-
|
|
1127
|
-
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
1128
|
-
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
1129
|
-
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
1130
|
-
|
|
1131
|
-
// Draw depending on wireframe, solid and transparent.
|
|
1132
|
-
|
|
1133
|
-
const
|
|
1134
|
-
modelViewMatrix = context .modelViewMatrix,
|
|
1135
|
-
x = modelViewMatrix [12],
|
|
1136
|
-
y = modelViewMatrix [13],
|
|
1137
|
-
z = modelViewMatrix [14];
|
|
1138
|
-
|
|
1139
|
-
if (shaderNode .wireframe)
|
|
1140
|
-
{
|
|
1141
|
-
// Points and Wireframes.
|
|
1142
|
-
|
|
1143
|
-
for (let p = 0; p < numParticles; ++ p)
|
|
1144
|
-
{
|
|
1145
|
-
const particle = particles [p];
|
|
1146
|
-
|
|
1147
|
-
modelViewMatrix [12] = x;
|
|
1148
|
-
modelViewMatrix [13] = y;
|
|
1149
|
-
modelViewMatrix [14] = z;
|
|
1150
|
-
|
|
1151
|
-
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1152
|
-
|
|
1153
|
-
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1154
|
-
|
|
1155
|
-
if (shaderNode .primitiveMode === gl .POINTS)
|
|
1156
|
-
{
|
|
1157
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1158
|
-
}
|
|
1159
|
-
else
|
|
1160
|
-
{
|
|
1161
|
-
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
1162
|
-
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
else
|
|
1167
|
-
{
|
|
1168
|
-
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
1169
|
-
|
|
1170
|
-
gl .frontFace (positiveScale ? this .frontFace : (this .frontFace === gl .CCW ? gl .CW : gl .CCW));
|
|
1171
|
-
|
|
1172
|
-
if (context .transparent || back !== front)
|
|
1173
|
-
{
|
|
1174
|
-
// Render transparent or back or front.
|
|
1175
|
-
|
|
1176
|
-
for (let p = 0; p < numParticles; ++ p)
|
|
1177
|
-
{
|
|
1178
|
-
const particle = particles [p];
|
|
1179
|
-
|
|
1180
|
-
modelViewMatrix [12] = x;
|
|
1181
|
-
modelViewMatrix [13] = y;
|
|
1182
|
-
modelViewMatrix [14] = z;
|
|
1183
|
-
|
|
1184
|
-
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1185
|
-
|
|
1186
|
-
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1187
|
-
|
|
1188
|
-
gl .enable (gl .CULL_FACE);
|
|
1189
|
-
|
|
1190
|
-
if (back && !this .solid)
|
|
1191
|
-
{
|
|
1192
|
-
gl .cullFace (gl .FRONT);
|
|
1193
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
if (front)
|
|
1197
|
-
{
|
|
1198
|
-
gl .cullFace (gl .BACK);
|
|
1199
|
-
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
else
|
|
1204
|
-
{
|
|
1205
|
-
// Render solid or both sides.
|
|
1227
|
+
if (this .solid)
|
|
1228
|
+
gl .enable (gl .CULL_FACE);
|
|
1229
|
+
else
|
|
1230
|
+
gl .disable (gl .CULL_FACE);
|
|
1206
1231
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
gl .disable (gl .CULL_FACE);
|
|
1232
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1233
|
+
{
|
|
1234
|
+
const particle = particles [p];
|
|
1211
1235
|
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1236
|
+
modelViewMatrix [12] = x;
|
|
1237
|
+
modelViewMatrix [13] = y;
|
|
1238
|
+
modelViewMatrix [14] = z;
|
|
1215
1239
|
|
|
1216
|
-
|
|
1217
|
-
modelViewMatrix [13] = y;
|
|
1218
|
-
modelViewMatrix [14] = z;
|
|
1240
|
+
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1219
1241
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1242
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1223
1243
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
return X3DGeometryNode;
|
|
1244
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
for (const attribNode of attribNodes)
|
|
1250
|
+
attribNode .disable (gl, shaderNode);
|
|
1251
|
+
|
|
1252
|
+
if (this .fogCoords)
|
|
1253
|
+
shaderNode .disableFogDepthAttribute (gl);
|
|
1254
|
+
|
|
1255
|
+
if (this .colorMaterial)
|
|
1256
|
+
shaderNode .disableColorAttribute (gl);
|
|
1257
|
+
|
|
1258
|
+
shaderNode .disableTexCoordAttribute (gl);
|
|
1259
|
+
shaderNode .disableNormalAttribute (gl);
|
|
1260
|
+
|
|
1261
|
+
if (blendModeNode)
|
|
1262
|
+
blendModeNode .disable (gl);
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
return X3DGeometryNode;
|
|
1249
1268
|
});
|