x_ite 4.7.14 → 5.0.2
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 +55636 -52046
- 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 +594 -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 +655 -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 -160
- 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 +120 -83
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +103 -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 +129 -125
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +128 -130
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +121 -123
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +120 -122
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +94 -94
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +127 -90
- package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +13 -15
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +337 -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 +324 -116
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +298 -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 +150 -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 -301
- package/src/x_ite/Fields/SFNodeCache.js +22 -32
- 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 -372
- package/src/x_ite/Basic/X3DObjectArrayField.js +0 -551
- 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
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = X3D .define,
|
|
8
|
-
require = X3D .require;
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-5.0.2")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-5.0.2")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -59,16 +59,16 @@ define ('x_ite/Browser/Picking/MatchCriterion',[],function ()
|
|
|
59
59
|
{
|
|
60
60
|
"use strict";
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
let i = 0;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
const MatchCriterion =
|
|
65
|
+
{
|
|
66
|
+
MATCH_ANY: i ++,
|
|
67
|
+
MATCH_EVERY: i ++,
|
|
68
|
+
MATCH_ONLY_ONE: i ++,
|
|
69
|
+
};
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
return MatchCriterion;
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -124,15 +124,15 @@ define ('x_ite/Browser/Picking/IntersectionType',[],function ()
|
|
|
124
124
|
{
|
|
125
125
|
"use strict";
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
let i = 0;
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
const IntersectionType =
|
|
130
|
+
{
|
|
131
|
+
BOUNDS: i ++,
|
|
132
|
+
GEOMETRY: i ++,
|
|
133
|
+
};
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
return IntersectionType;
|
|
136
136
|
});
|
|
137
137
|
|
|
138
138
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -188,17 +188,17 @@ define ('x_ite/Browser/Picking/SortOrder',[],function ()
|
|
|
188
188
|
{
|
|
189
189
|
"use strict";
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
let i = 0;
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
193
|
+
const SortOrder =
|
|
194
|
+
{
|
|
195
|
+
ANY: i ++,
|
|
196
|
+
CLOSEST: i ++,
|
|
197
|
+
ALL: i ++,
|
|
198
|
+
ALL_SORTED: i ++,
|
|
199
|
+
};
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
return SortOrder;
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -251,16 +251,16 @@ define ('x_ite/Browser/Picking/SortOrder',[],function ()
|
|
|
251
251
|
|
|
252
252
|
|
|
253
253
|
define ('x_ite/Components/Picking/X3DPickSensorNode',[
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
254
|
+
"x_ite/Fields",
|
|
255
|
+
"x_ite/Components/Core/X3DSensorNode",
|
|
256
|
+
"x_ite/Rendering/TraverseType",
|
|
257
|
+
"x_ite/Base/X3DConstants",
|
|
258
|
+
"x_ite/Browser/Picking/MatchCriterion",
|
|
259
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
260
|
+
"x_ite/Browser/Picking/SortOrder",
|
|
261
|
+
"standard/Math/Numbers/Matrix4",
|
|
262
|
+
"standard/Math/Algorithms/QuickSort",
|
|
263
|
+
"standard/Utility/ObjectCache",
|
|
264
264
|
],
|
|
265
265
|
function (Fields,
|
|
266
266
|
X3DSensorNode,
|
|
@@ -275,378 +275,378 @@ function (Fields,
|
|
|
275
275
|
{
|
|
276
276
|
"use strict";
|
|
277
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
|
-
|
|
278
|
+
var ModelMatrixCache = ObjectCache (Matrix4);
|
|
279
|
+
|
|
280
|
+
function compareDistance (lhs, rhs) { return lhs .distance < rhs .distance; }
|
|
281
|
+
|
|
282
|
+
function X3DPickSensorNode (executionContext)
|
|
283
|
+
{
|
|
284
|
+
X3DSensorNode .call (this, executionContext);
|
|
285
|
+
|
|
286
|
+
this .addType (X3DConstants .X3DPickSensorNode);
|
|
287
|
+
|
|
288
|
+
this .objectType = new Set ();
|
|
289
|
+
this .intersectionType = IntersectionType .BOUNDS;
|
|
290
|
+
this .sortOrder = SortOrder .CLOSEST;
|
|
291
|
+
this .pickTargetNodes = new Set ();
|
|
292
|
+
this .modelMatrices = [ ];
|
|
293
|
+
this .targets = [ ];
|
|
294
|
+
this .targets .size = 0;
|
|
295
|
+
this .pickedTargets = [ ];
|
|
296
|
+
this .pickedTargetsSorter = new QuickSort (this .pickedTargets, compareDistance);
|
|
297
|
+
this .pickedGeometries = new Fields .MFNode (); // Must be unique for each X3DPickSensorNode.
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
X3DPickSensorNode .prototype = Object .assign (Object .create (X3DSensorNode .prototype),
|
|
301
|
+
{
|
|
302
|
+
constructor: X3DPickSensorNode,
|
|
303
|
+
initialize: function ()
|
|
304
|
+
{
|
|
305
|
+
this .isLive () .addInterest ("set_live__", this);
|
|
306
|
+
|
|
307
|
+
this ._enabled .addInterest ("set_live__", this);
|
|
308
|
+
this ._objectType .addInterest ("set_objectType__", this);
|
|
309
|
+
this ._matchCriterion .addInterest ("set_matchCriterion__", this);
|
|
310
|
+
this ._intersectionType .addInterest ("set_intersectionType__", this);
|
|
311
|
+
this ._sortOrder .addInterest ("set_sortOrder__", this);
|
|
312
|
+
this ._pickTarget .addInterest ("set_pickTarget__", this);
|
|
313
|
+
|
|
314
|
+
this .set_objectType__ ();
|
|
315
|
+
this .set_matchCriterion__ ();
|
|
316
|
+
this .set_intersectionType__ ();
|
|
317
|
+
this .set_sortOrder__ ();
|
|
318
|
+
this .set_pickTarget__ ();
|
|
319
|
+
},
|
|
320
|
+
getObjectType: function ()
|
|
321
|
+
{
|
|
322
|
+
return this .objectType;
|
|
323
|
+
},
|
|
324
|
+
getMatchCriterion: function ()
|
|
325
|
+
{
|
|
326
|
+
return this .matchCriterion;
|
|
327
|
+
},
|
|
328
|
+
getIntersectionType: function ()
|
|
329
|
+
{
|
|
330
|
+
return this .intersectionType;
|
|
331
|
+
},
|
|
332
|
+
getSortOrder: function ()
|
|
333
|
+
{
|
|
334
|
+
return this .sortOrder;
|
|
335
|
+
},
|
|
336
|
+
getModelMatrices: function ()
|
|
337
|
+
{
|
|
338
|
+
return this .modelMatrices;
|
|
339
|
+
},
|
|
340
|
+
getTargets: function ()
|
|
341
|
+
{
|
|
342
|
+
return this .targets;
|
|
343
|
+
},
|
|
344
|
+
getPickShape: (function ()
|
|
345
|
+
{
|
|
346
|
+
var pickShapes = new WeakMap ();
|
|
347
|
+
|
|
348
|
+
return function (geometryNode)
|
|
349
|
+
{
|
|
350
|
+
var pickShape = pickShapes .get (geometryNode);
|
|
351
|
+
|
|
352
|
+
if (pickShape !== undefined)
|
|
353
|
+
return pickShape;
|
|
354
|
+
|
|
355
|
+
var
|
|
356
|
+
shapeNode = this .getExecutionContext () .createNode ("Shape", false),
|
|
357
|
+
collidableShapeNode = this .getExecutionContext () .createNode ("CollidableShape", false);
|
|
358
|
+
|
|
359
|
+
shapeNode .setPrivate (true);
|
|
360
|
+
collidableShapeNode .setPrivate (true);
|
|
361
|
+
collidableShapeNode .setConvex (true);
|
|
362
|
+
|
|
363
|
+
shapeNode ._geometry = geometryNode;
|
|
364
|
+
collidableShapeNode ._shape = shapeNode;
|
|
365
|
+
|
|
366
|
+
shapeNode .setup ();
|
|
367
|
+
collidableShapeNode .setup ();
|
|
368
|
+
|
|
369
|
+
pickShapes .set (geometryNode, collidableShapeNode);
|
|
370
|
+
|
|
371
|
+
return collidableShapeNode;
|
|
372
|
+
};
|
|
373
|
+
})(),
|
|
374
|
+
getPickedGeometries: (function ()
|
|
375
|
+
{
|
|
376
|
+
return function ()
|
|
377
|
+
{
|
|
378
|
+
var
|
|
379
|
+
targets = this .targets,
|
|
380
|
+
numTargets = targets .size,
|
|
381
|
+
pickedTargets = this .pickedTargets,
|
|
382
|
+
pickedGeometries = this .pickedGeometries;
|
|
383
|
+
|
|
384
|
+
// Filter intersecting targets.
|
|
385
|
+
|
|
386
|
+
pickedTargets .length = 0;
|
|
387
|
+
|
|
388
|
+
for (var i = 0; i < numTargets; ++ i)
|
|
389
|
+
{
|
|
390
|
+
var target = targets [i];
|
|
391
|
+
|
|
392
|
+
if (target .intersected)
|
|
393
|
+
pickedTargets .push (target);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// No pickedTargets, return.
|
|
397
|
+
|
|
398
|
+
if (pickedTargets .length === 0)
|
|
399
|
+
{
|
|
400
|
+
pickedGeometries .length = 0;
|
|
401
|
+
|
|
402
|
+
return pickedGeometries;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Return sorted pickedTargets.
|
|
406
|
+
|
|
407
|
+
switch (this .sortOrder)
|
|
408
|
+
{
|
|
409
|
+
case SortOrder .ANY:
|
|
410
|
+
{
|
|
411
|
+
pickedTargets .length = 1;
|
|
412
|
+
pickedGeometries [0] = this .getPickedGeometry (pickedTargets [0]);
|
|
413
|
+
pickedGeometries .length = 1;
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
case SortOrder .CLOSEST:
|
|
417
|
+
{
|
|
418
|
+
this .pickedTargetsSorter .sort (0, pickedTargets .length);
|
|
419
|
+
|
|
420
|
+
pickedTargets .length = 1;
|
|
421
|
+
pickedGeometries [0] = this .getPickedGeometry (pickedTargets [0]);
|
|
422
|
+
pickedGeometries .length = 1;
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
case SortOrder .ALL:
|
|
426
|
+
{
|
|
427
|
+
for (var i = 0, length = pickedTargets .length; i < length; ++ i)
|
|
428
|
+
pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
|
|
429
|
+
|
|
430
|
+
pickedGeometries .length = length;
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
case SortOrder .ALL_SORTED:
|
|
434
|
+
{
|
|
435
|
+
this .pickedTargetsSorter .sort (0, pickedTargets .length);
|
|
436
|
+
|
|
437
|
+
for (var i = 0, length = pickedTargets .length; i < length; ++ i)
|
|
438
|
+
pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
|
|
439
|
+
|
|
440
|
+
pickedGeometries .length = length;
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
return pickedGeometries;
|
|
446
|
+
};
|
|
447
|
+
})(),
|
|
448
|
+
getPickedGeometry: function (target)
|
|
449
|
+
{
|
|
450
|
+
var
|
|
451
|
+
executionContext = this .getExecutionContext (),
|
|
452
|
+
geometryNode = target .geometryNode;
|
|
453
|
+
|
|
454
|
+
if (geometryNode .getExecutionContext () === executionContext)
|
|
455
|
+
return geometryNode;
|
|
456
|
+
|
|
457
|
+
var instance = geometryNode .getExecutionContext ();
|
|
458
|
+
|
|
459
|
+
if (instance .getType () .indexOf (X3DConstants .X3DPrototypeInstance) !== -1 && instance .getExecutionContext () === executionContext)
|
|
460
|
+
return instance;
|
|
461
|
+
|
|
462
|
+
var pickingHierarchy = target .pickingHierarchy;
|
|
463
|
+
|
|
464
|
+
for (var i = pickingHierarchy .length - 1; i >= 0; -- i)
|
|
465
|
+
{
|
|
466
|
+
var node = pickingHierarchy [i];
|
|
467
|
+
|
|
468
|
+
if (node .getExecutionContext () === executionContext)
|
|
469
|
+
return node;
|
|
470
|
+
|
|
471
|
+
var instance = node .getExecutionContext ();
|
|
472
|
+
|
|
473
|
+
if (instance .getType () .indexOf (X3DConstants .X3DPrototypeInstance) !== -1 && instance .getExecutionContext () === executionContext)
|
|
474
|
+
return instance;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
return null;
|
|
478
|
+
},
|
|
479
|
+
getPickedTargets: function ()
|
|
480
|
+
{
|
|
481
|
+
return this .pickedTargets;
|
|
482
|
+
},
|
|
483
|
+
set_live__: function ()
|
|
484
|
+
{
|
|
485
|
+
if (this .isLive () .getValue () && this ._enabled .getValue () && ! this .objectType .has ("NONE"))
|
|
486
|
+
{
|
|
487
|
+
this .getBrowser () .addPickSensor (this);
|
|
488
|
+
this .setPickableObject (true);
|
|
489
|
+
}
|
|
490
|
+
else
|
|
491
|
+
{
|
|
492
|
+
this .getBrowser () .removePickSensor (this);
|
|
493
|
+
this .setPickableObject (false);
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
set_objectType__: function ()
|
|
497
|
+
{
|
|
498
|
+
this .objectType .clear ();
|
|
499
|
+
|
|
500
|
+
for (var i = 0, length = this ._objectType .length; i < length; ++ i)
|
|
501
|
+
{
|
|
502
|
+
this .objectType .add (this ._objectType [i]);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
this .set_live__ ();
|
|
506
|
+
},
|
|
507
|
+
set_matchCriterion__: (function ()
|
|
508
|
+
{
|
|
509
|
+
var matchCriterions = new Map ([
|
|
510
|
+
["MATCH_ANY", MatchCriterion .MATCH_ANY],
|
|
511
|
+
["MATCH_EVERY", MatchCriterion .MATCH_EVERY],
|
|
512
|
+
["MATCH_ONLY_ONE", MatchCriterion .MATCH_ONLY_ONE],
|
|
513
|
+
]);
|
|
514
|
+
|
|
515
|
+
return function ()
|
|
516
|
+
{
|
|
517
|
+
this .matchCriterion = matchCriterions .get (this ._matchCriterion .getValue ());
|
|
518
|
+
|
|
519
|
+
if (this .matchCriterion === undefined)
|
|
520
|
+
this .matchCriterion = MatchCriterionType .MATCH_ANY;
|
|
521
|
+
};
|
|
522
|
+
})(),
|
|
523
|
+
set_intersectionType__: (function ()
|
|
524
|
+
{
|
|
525
|
+
var intersectionTypes = new Map ([
|
|
526
|
+
["BOUNDS", IntersectionType .BOUNDS],
|
|
527
|
+
["GEOMETRY", IntersectionType .GEOMETRY],
|
|
528
|
+
]);
|
|
529
|
+
|
|
530
|
+
return function ()
|
|
531
|
+
{
|
|
532
|
+
this .intersectionType = intersectionTypes .get (this ._intersectionType .getValue ());
|
|
533
|
+
|
|
534
|
+
if (this .intersectionType === undefined)
|
|
535
|
+
this .intersectionType = IntersectionType .BOUNDS;
|
|
536
|
+
};
|
|
537
|
+
})(),
|
|
538
|
+
set_sortOrder__: (function ()
|
|
539
|
+
{
|
|
540
|
+
var sortOrders = new Map ([
|
|
541
|
+
["ANY", SortOrder .ANY],
|
|
542
|
+
["CLOSEST", SortOrder .CLOSEST],
|
|
543
|
+
["ALL", SortOrder .ALL],
|
|
544
|
+
["ALL_SORTED", SortOrder .ALL_SORTED],
|
|
545
|
+
]);
|
|
546
|
+
|
|
547
|
+
return function ()
|
|
548
|
+
{
|
|
549
|
+
this .sortOrder = sortOrders .get (this ._sortOrder .getValue ());
|
|
550
|
+
|
|
551
|
+
if (this .sortOrder === undefined)
|
|
552
|
+
this .sortOrder = SortOrder .CLOSEST;
|
|
553
|
+
};
|
|
554
|
+
})(),
|
|
555
|
+
set_pickTarget__: function ()
|
|
556
|
+
{
|
|
557
|
+
this .pickTargetNodes .clear ();
|
|
558
|
+
|
|
559
|
+
for (var i = 0, length = this ._pickTarget .length; i < length; ++ i)
|
|
560
|
+
{
|
|
561
|
+
try
|
|
562
|
+
{
|
|
563
|
+
var
|
|
564
|
+
node = this ._pickTarget [i] .getValue () .getInnerNode (),
|
|
565
|
+
type = node .getType ();
|
|
566
|
+
|
|
567
|
+
for (var t = type .length - 1; t >= 0; -- t)
|
|
568
|
+
{
|
|
569
|
+
switch (type [t])
|
|
570
|
+
{
|
|
571
|
+
case X3DConstants .Inline:
|
|
572
|
+
case X3DConstants .Shape:
|
|
573
|
+
case X3DConstants .X3DGroupingNode:
|
|
574
|
+
{
|
|
575
|
+
this .pickTargetNodes .add (node);
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
default:
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
catch (error)
|
|
584
|
+
{ }
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
traverse: function (type, renderObject)
|
|
588
|
+
{
|
|
589
|
+
// X3DPickSensorNode nodes are sorted out and only traversed during PICKING, except if is child of a LOD or Switch node.
|
|
590
|
+
|
|
591
|
+
if (type !== TraverseType .PICKING)
|
|
592
|
+
return;
|
|
593
|
+
|
|
594
|
+
if (this .getPickableObject ())
|
|
595
|
+
this .modelMatrices .push (ModelMatrixCache .pop () .assign (renderObject .getModelViewMatrix () .get ()));
|
|
596
|
+
},
|
|
597
|
+
collect: function (geometryNode, modelMatrix, pickingHierarchy)
|
|
598
|
+
{
|
|
599
|
+
var pickTargetNodes = this .pickTargetNodes;
|
|
600
|
+
|
|
601
|
+
var haveTarget = pickingHierarchy .some (function (node)
|
|
602
|
+
{
|
|
603
|
+
return pickTargetNodes .has (node);
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
if (haveTarget)
|
|
607
|
+
{
|
|
608
|
+
var targets = this .targets;
|
|
609
|
+
|
|
610
|
+
if (targets .size < targets .length)
|
|
611
|
+
{
|
|
612
|
+
var target = targets [targets .size];
|
|
613
|
+
}
|
|
614
|
+
else
|
|
615
|
+
{
|
|
616
|
+
var target = { modelMatrix: new Matrix4 (), pickingHierarchy: [ ], pickedPoint: [ ], intersections: [ ] };
|
|
617
|
+
|
|
618
|
+
targets .push (target);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
++ targets .size;
|
|
622
|
+
|
|
623
|
+
target .intersected = false;
|
|
624
|
+
target .geometryNode = geometryNode;
|
|
625
|
+
target .pickedPoint .length = 0;
|
|
626
|
+
target .intersections .length = 0;
|
|
627
|
+
target .modelMatrix .assign (modelMatrix);
|
|
628
|
+
|
|
629
|
+
var destPickingHierarchy = target .pickingHierarchy;
|
|
630
|
+
|
|
631
|
+
for (var i = 0, length = pickingHierarchy .length; i < length; ++ i)
|
|
632
|
+
destPickingHierarchy [i] = pickingHierarchy [i];
|
|
633
|
+
|
|
634
|
+
destPickingHierarchy .length = length;
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
process: function ()
|
|
638
|
+
{
|
|
639
|
+
var modelMatrices = this .modelMatrices;
|
|
640
|
+
|
|
641
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
642
|
+
ModelMatrixCache .push (modelMatrices [m]);
|
|
643
|
+
|
|
644
|
+
this .modelMatrices .length = 0;
|
|
645
|
+
this .targets .size = 0;
|
|
646
|
+
},
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
return X3DPickSensorNode;
|
|
650
650
|
});
|
|
651
651
|
|
|
652
652
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -699,21 +699,21 @@ function (Fields,
|
|
|
699
699
|
|
|
700
700
|
|
|
701
701
|
define ('x_ite/Components/Picking/LinePickSensor',[
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
702
|
+
"x_ite/Fields",
|
|
703
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
704
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
705
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
706
|
+
"x_ite/Base/X3DConstants",
|
|
707
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
708
|
+
"standard/Math/Numbers/Vector3",
|
|
709
|
+
"standard/Math/Numbers/Matrix4",
|
|
710
|
+
"standard/Math/Geometry/Box3",
|
|
711
|
+
"standard/Math/Geometry/Line3",
|
|
712
712
|
],
|
|
713
713
|
function (Fields,
|
|
714
714
|
X3DFieldDefinition,
|
|
715
715
|
FieldDefinitionArray,
|
|
716
|
-
X3DPickSensorNode,
|
|
716
|
+
X3DPickSensorNode,
|
|
717
717
|
X3DConstants,
|
|
718
718
|
IntersectionType,
|
|
719
719
|
Vector3,
|
|
@@ -723,283 +723,281 @@ function (Fields,
|
|
|
723
723
|
{
|
|
724
724
|
"use strict";
|
|
725
725
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
|
|
963
|
-
{
|
|
964
|
-
var pickedIntersections = pickedTargets [t] .intersections;
|
|
965
|
-
|
|
966
|
-
for (var i = 0, iLength = pickedIntersections .length; i < iLength; ++ i)
|
|
967
|
-
{
|
|
968
|
-
var
|
|
969
|
-
intersection = pickedIntersections [i],
|
|
970
|
-
t = intersection .texCoord;
|
|
971
|
-
|
|
972
|
-
texCoord .set (t .x, t .y, t .z);
|
|
973
|
-
|
|
974
|
-
pickedTextureCoordinate .push (texCoord);
|
|
975
|
-
pickedNormal .push (intersection .normal);
|
|
976
|
-
pickedPoint .push (intersection .point);
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
if (! this .pickedTextureCoordinate_ .equals (pickedTextureCoordinate))
|
|
981
|
-
this .pickedTextureCoordinate_ = pickedTextureCoordinate;
|
|
982
|
-
|
|
983
|
-
if (! this .pickedNormal_ .equals (pickedNormal))
|
|
984
|
-
this .pickedNormal_ = pickedNormal;
|
|
985
|
-
|
|
986
|
-
if (! this .pickedPoint_ .equals (pickedPoint))
|
|
987
|
-
this .pickedPoint_ = pickedPoint;
|
|
988
|
-
|
|
989
|
-
break;
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
X3DPickSensorNode .prototype .process .call (this);
|
|
995
|
-
};
|
|
996
|
-
})(),
|
|
997
|
-
});
|
|
998
|
-
|
|
999
|
-
return LinePickSensor;
|
|
1000
|
-
});
|
|
726
|
+
function LinePickSensor (executionContext)
|
|
727
|
+
{
|
|
728
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
729
|
+
|
|
730
|
+
this .addType (X3DConstants .LinePickSensor);
|
|
731
|
+
|
|
732
|
+
this .pickingGeometryNode = null;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
LinePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
736
|
+
{
|
|
737
|
+
constructor: LinePickSensor,
|
|
738
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
739
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
740
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
741
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
742
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
743
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
744
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
745
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
746
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedTextureCoordinate", new Fields .MFVec3f ()),
|
|
747
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedNormal", new Fields .MFVec3f ()),
|
|
748
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedPoint", new Fields .MFVec3f ()),
|
|
749
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
750
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
751
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
752
|
+
]),
|
|
753
|
+
getTypeName: function ()
|
|
754
|
+
{
|
|
755
|
+
return "LinePickSensor";
|
|
756
|
+
},
|
|
757
|
+
getComponentName: function ()
|
|
758
|
+
{
|
|
759
|
+
return "Picking";
|
|
760
|
+
},
|
|
761
|
+
getContainerField: function ()
|
|
762
|
+
{
|
|
763
|
+
return "children";
|
|
764
|
+
},
|
|
765
|
+
initialize: function ()
|
|
766
|
+
{
|
|
767
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
768
|
+
|
|
769
|
+
this ._pickingGeometry .addInterest ("set_pickingGeometry__", this);
|
|
770
|
+
|
|
771
|
+
this .set_pickingGeometry__ ();
|
|
772
|
+
},
|
|
773
|
+
set_pickingGeometry__: function ()
|
|
774
|
+
{
|
|
775
|
+
this .pickingGeometryNode = null;
|
|
776
|
+
|
|
777
|
+
try
|
|
778
|
+
{
|
|
779
|
+
var
|
|
780
|
+
node = this ._pickingGeometry .getValue () .getInnerNode (),
|
|
781
|
+
type = node .getType ();
|
|
782
|
+
|
|
783
|
+
for (var t = type .length - 1; t >= 0; -- t)
|
|
784
|
+
{
|
|
785
|
+
switch (type [t])
|
|
786
|
+
{
|
|
787
|
+
case X3DConstants .IndexedLineSet:
|
|
788
|
+
case X3DConstants .LineSet:
|
|
789
|
+
{
|
|
790
|
+
this .pickingGeometryNode = node;
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
793
|
+
default:
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
catch (error)
|
|
799
|
+
{ }
|
|
800
|
+
},
|
|
801
|
+
process: (function ()
|
|
802
|
+
{
|
|
803
|
+
var
|
|
804
|
+
pickingBBox = new Box3 (),
|
|
805
|
+
targetBBox = new Box3 (),
|
|
806
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
807
|
+
targetCenter = new Vector3 (0, 0, 0),
|
|
808
|
+
matrix = new Matrix4 (),
|
|
809
|
+
point1 = new Vector3 (0, 0, 0),
|
|
810
|
+
point2 = new Vector3 (0, 0, 0),
|
|
811
|
+
line = new Line3 (Vector3 .Zero, Vector3 .zAxis),
|
|
812
|
+
a = new Vector3 (0, 0, 0),
|
|
813
|
+
b = new Vector3 (0, 0, 0),
|
|
814
|
+
clipPlanes = [ ],
|
|
815
|
+
intersections = [ ],
|
|
816
|
+
texCoord = new Vector3 (0, 0, 0),
|
|
817
|
+
pickedTextureCoordinate = new Fields .MFVec3f (),
|
|
818
|
+
pickedNormal = new Fields .MFVec3f (),
|
|
819
|
+
pickedPoint = new Fields .MFVec3f ();
|
|
820
|
+
|
|
821
|
+
return function ()
|
|
822
|
+
{
|
|
823
|
+
if (this .pickingGeometryNode)
|
|
824
|
+
{
|
|
825
|
+
var
|
|
826
|
+
modelMatrices = this .getModelMatrices (),
|
|
827
|
+
targets = this .getTargets ();
|
|
828
|
+
|
|
829
|
+
switch (this .getIntersectionType ())
|
|
830
|
+
{
|
|
831
|
+
case IntersectionType .BOUNDS:
|
|
832
|
+
{
|
|
833
|
+
// Intersect bboxes.
|
|
834
|
+
|
|
835
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
836
|
+
{
|
|
837
|
+
var modelMatrix = modelMatrices [m];
|
|
838
|
+
|
|
839
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
840
|
+
|
|
841
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
842
|
+
{
|
|
843
|
+
var target = targets [t];
|
|
844
|
+
|
|
845
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
846
|
+
|
|
847
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
848
|
+
{
|
|
849
|
+
pickingCenter .assign (pickingBBox .center);
|
|
850
|
+
targetCenter .assign (targetBBox .center);
|
|
851
|
+
|
|
852
|
+
target .intersected = true;
|
|
853
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
// Send events.
|
|
859
|
+
|
|
860
|
+
var
|
|
861
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
862
|
+
active = Boolean (pickedGeometries .length);
|
|
863
|
+
|
|
864
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
865
|
+
|
|
866
|
+
if (active !== this ._isActive .getValue ())
|
|
867
|
+
this ._isActive = active;
|
|
868
|
+
|
|
869
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
870
|
+
this ._pickedGeometry = pickedGeometries;
|
|
871
|
+
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
874
|
+
case IntersectionType .GEOMETRY:
|
|
875
|
+
{
|
|
876
|
+
// Intersect geometry.
|
|
877
|
+
|
|
878
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
879
|
+
{
|
|
880
|
+
var modelMatrix = modelMatrices [m];
|
|
881
|
+
|
|
882
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
883
|
+
|
|
884
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
885
|
+
{
|
|
886
|
+
try
|
|
887
|
+
{
|
|
888
|
+
var
|
|
889
|
+
target = targets [t],
|
|
890
|
+
geometryNode = target .geometryNode,
|
|
891
|
+
vertices = this .pickingGeometryNode .getVertices ();
|
|
892
|
+
|
|
893
|
+
targetBBox .assign (geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
894
|
+
matrix .assign (target .modelMatrix) .inverse () .multLeft (modelMatrix);
|
|
895
|
+
|
|
896
|
+
for (var v = 0, vLength = vertices .length; v < vLength; v += 8)
|
|
897
|
+
{
|
|
898
|
+
matrix .multVecMatrix (point1 .set (vertices [v + 0], vertices [v + 1], vertices [v + 2]));
|
|
899
|
+
matrix .multVecMatrix (point2 .set (vertices [v + 4], vertices [v + 5], vertices [v + 6]));
|
|
900
|
+
line .setPoints (point1, point2);
|
|
901
|
+
|
|
902
|
+
intersections .length = 0;
|
|
903
|
+
|
|
904
|
+
if (geometryNode .intersectsLine (line, clipPlanes, target .modelMatrix, intersections))
|
|
905
|
+
{
|
|
906
|
+
for (var i = 0, iLength = intersections .length; i < iLength; ++ i)
|
|
907
|
+
{
|
|
908
|
+
// Test if intersection.point is between point1 and point2.
|
|
909
|
+
|
|
910
|
+
var intersection = intersections [i];
|
|
911
|
+
|
|
912
|
+
a .assign (intersection .point) .subtract (point1);
|
|
913
|
+
b .assign (intersection .point) .subtract (point2);
|
|
914
|
+
|
|
915
|
+
var
|
|
916
|
+
c = a .add (b) .abs (),
|
|
917
|
+
s = point1 .distance (point2);
|
|
918
|
+
|
|
919
|
+
if (c <= s)
|
|
920
|
+
target .intersections .push (intersection);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
if (target .intersections .length)
|
|
926
|
+
{
|
|
927
|
+
pickingCenter .assign (pickingBBox .center);
|
|
928
|
+
targetCenter .assign (targetBBox .center);
|
|
929
|
+
|
|
930
|
+
target .intersected = true;
|
|
931
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
catch (error)
|
|
935
|
+
{
|
|
936
|
+
// Catch inverse.
|
|
937
|
+
console .error (error);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// Send events.
|
|
943
|
+
|
|
944
|
+
var
|
|
945
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
946
|
+
active = Boolean (pickedGeometries .length);
|
|
947
|
+
|
|
948
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
949
|
+
|
|
950
|
+
if (active !== this ._isActive .getValue ())
|
|
951
|
+
this ._isActive = active;
|
|
952
|
+
|
|
953
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
954
|
+
this ._pickedGeometry = pickedGeometries;
|
|
955
|
+
|
|
956
|
+
var pickedTargets = this .getPickedTargets ();
|
|
957
|
+
|
|
958
|
+
pickedTextureCoordinate .length = 0;
|
|
959
|
+
pickedNormal .length = 0;
|
|
960
|
+
pickedPoint .length = 0;
|
|
1001
961
|
|
|
962
|
+
for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
|
|
963
|
+
{
|
|
964
|
+
var pickedIntersections = pickedTargets [t] .intersections;
|
|
1002
965
|
|
|
966
|
+
for (var i = 0, iLength = pickedIntersections .length; i < iLength; ++ i)
|
|
967
|
+
{
|
|
968
|
+
var
|
|
969
|
+
intersection = pickedIntersections [i],
|
|
970
|
+
t = intersection .texCoord;
|
|
971
|
+
|
|
972
|
+
texCoord .set (t .x, t .y, t .z);
|
|
973
|
+
|
|
974
|
+
pickedTextureCoordinate .push (texCoord);
|
|
975
|
+
pickedNormal .push (intersection .normal);
|
|
976
|
+
pickedPoint .push (intersection .point);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
if (! this ._pickedTextureCoordinate .equals (pickedTextureCoordinate))
|
|
981
|
+
this ._pickedTextureCoordinate = pickedTextureCoordinate;
|
|
982
|
+
|
|
983
|
+
if (! this ._pickedNormal .equals (pickedNormal))
|
|
984
|
+
this ._pickedNormal = pickedNormal;
|
|
985
|
+
|
|
986
|
+
if (! this ._pickedPoint .equals (pickedPoint))
|
|
987
|
+
this ._pickedPoint = pickedPoint;
|
|
988
|
+
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
995
|
+
};
|
|
996
|
+
})(),
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
return LinePickSensor;
|
|
1000
|
+
});
|
|
1003
1001
|
|
|
1004
1002
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1005
1003
|
*******************************************************************************
|
|
@@ -1051,48 +1049,46 @@ function (Fields,
|
|
|
1051
1049
|
|
|
1052
1050
|
|
|
1053
1051
|
define ('x_ite/Components/Picking/X3DPickableObject',[
|
|
1054
|
-
|
|
1052
|
+
"x_ite/Base/X3DConstants",
|
|
1055
1053
|
],
|
|
1056
1054
|
function (X3DConstants)
|
|
1057
1055
|
{
|
|
1058
1056
|
"use strict";
|
|
1059
1057
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1058
|
+
function X3DPickableObject (executionContext)
|
|
1059
|
+
{
|
|
1060
|
+
this .addType (X3DConstants .X3DPickableObject);
|
|
1061
|
+
|
|
1062
|
+
this .objectType = new Set ();
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
X3DPickableObject .prototype =
|
|
1066
|
+
{
|
|
1067
|
+
constructor: X3DPickableObject,
|
|
1068
|
+
initialize: function ()
|
|
1069
|
+
{
|
|
1070
|
+
this ._objectType .addInterest ("set_objectType__", this);
|
|
1071
|
+
|
|
1072
|
+
this .set_objectType__ ();
|
|
1073
|
+
},
|
|
1074
|
+
getObjectType: function ()
|
|
1075
|
+
{
|
|
1076
|
+
return this .objectType;
|
|
1077
|
+
},
|
|
1078
|
+
set_objectType__: function ()
|
|
1079
|
+
{
|
|
1080
|
+
this .objectType .clear ();
|
|
1081
|
+
|
|
1082
|
+
for (var i = 0, length = this ._objectType .length; i < length; ++ i)
|
|
1083
|
+
{
|
|
1084
|
+
this .objectType .add (this ._objectType [i]);
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
return X3DPickableObject;
|
|
1092
1090
|
});
|
|
1093
1091
|
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
1092
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1097
1093
|
*******************************************************************************
|
|
1098
1094
|
*
|
|
@@ -1143,14 +1139,14 @@ function (X3DConstants)
|
|
|
1143
1139
|
|
|
1144
1140
|
|
|
1145
1141
|
define ('x_ite/Components/Picking/PickableGroup',[
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1142
|
+
"x_ite/Fields",
|
|
1143
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
1144
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
1145
|
+
"x_ite/Components/Grouping/X3DGroupingNode",
|
|
1146
|
+
"x_ite/Components/Picking/X3DPickableObject",
|
|
1147
|
+
"x_ite/Browser/Picking/MatchCriterion",
|
|
1148
|
+
"x_ite/Base/X3DConstants",
|
|
1149
|
+
"x_ite/Rendering/TraverseType",
|
|
1154
1150
|
],
|
|
1155
1151
|
function (Fields,
|
|
1156
1152
|
X3DFieldDefinition,
|
|
@@ -1163,153 +1159,153 @@ function (Fields,
|
|
|
1163
1159
|
{
|
|
1164
1160
|
"use strict";
|
|
1165
1161
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
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
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1162
|
+
function PickableGroup (executionContext)
|
|
1163
|
+
{
|
|
1164
|
+
X3DGroupingNode .call (this, executionContext);
|
|
1165
|
+
X3DPickableObject .call (this, executionContext);
|
|
1166
|
+
|
|
1167
|
+
this .addType (X3DConstants .PickableGroup);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
PickableGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
|
|
1171
|
+
X3DPickableObject .prototype,
|
|
1172
|
+
{
|
|
1173
|
+
constructor: PickableGroup,
|
|
1174
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
1175
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1176
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickable", new Fields .SFBool (true)),
|
|
1177
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
1178
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
1179
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
1180
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
1181
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
1182
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
1183
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
1184
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
1185
|
+
]),
|
|
1186
|
+
getTypeName: function ()
|
|
1187
|
+
{
|
|
1188
|
+
return "PickableGroup";
|
|
1189
|
+
},
|
|
1190
|
+
getComponentName: function ()
|
|
1191
|
+
{
|
|
1192
|
+
return "Picking";
|
|
1193
|
+
},
|
|
1194
|
+
getContainerField: function ()
|
|
1195
|
+
{
|
|
1196
|
+
return "children";
|
|
1197
|
+
},
|
|
1198
|
+
initialize: function ()
|
|
1199
|
+
{
|
|
1200
|
+
X3DGroupingNode .prototype .initialize .call (this);
|
|
1201
|
+
X3DPickableObject .prototype .initialize .call (this);
|
|
1202
|
+
|
|
1203
|
+
this ._pickable .addInterest ("set_pickable__", this);
|
|
1204
|
+
|
|
1205
|
+
this .set_pickable__ ();
|
|
1206
|
+
},
|
|
1207
|
+
set_pickableObjects__: function ()
|
|
1208
|
+
{
|
|
1209
|
+
this .set_pickable__ ();
|
|
1210
|
+
},
|
|
1211
|
+
set_pickable__: function ()
|
|
1212
|
+
{
|
|
1213
|
+
this .setPickableObject (Boolean (this ._pickable .getValue () || this .getTransformSensors () .size));
|
|
1214
|
+
},
|
|
1215
|
+
traverse: (function ()
|
|
1216
|
+
{
|
|
1217
|
+
const pickSensorNodes = new Set ();
|
|
1218
|
+
|
|
1219
|
+
return function (type, renderObject)
|
|
1220
|
+
{
|
|
1221
|
+
if (type === TraverseType .PICKING)
|
|
1222
|
+
{
|
|
1223
|
+
if (this ._pickable .getValue ())
|
|
1224
|
+
{
|
|
1225
|
+
if (this .getObjectType () .has ("NONE"))
|
|
1226
|
+
return;
|
|
1227
|
+
|
|
1228
|
+
const
|
|
1229
|
+
browser = renderObject .getBrowser (),
|
|
1230
|
+
pickableStack = browser .getPickable ();
|
|
1231
|
+
|
|
1232
|
+
if (this .getObjectType () .has ("ALL"))
|
|
1233
|
+
{
|
|
1234
|
+
pickableStack .push (true);
|
|
1235
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1236
|
+
pickableStack .pop ();
|
|
1237
|
+
}
|
|
1238
|
+
else
|
|
1239
|
+
{
|
|
1240
|
+
// Filter pick sensors.
|
|
1241
|
+
|
|
1242
|
+
const pickSensorStack = browser .getPickSensors ();
|
|
1243
|
+
|
|
1244
|
+
for (const pickSensorNode of pickSensorStack .at (-1))
|
|
1245
|
+
{
|
|
1246
|
+
if (! pickSensorNode .getObjectType () .has ("ALL"))
|
|
1247
|
+
{
|
|
1248
|
+
let intersection = 0;
|
|
1249
|
+
|
|
1250
|
+
for (const objectType of this .getObjectType ())
|
|
1251
|
+
{
|
|
1252
|
+
if (pickSensorNode .getObjectType () .has (objectType))
|
|
1253
|
+
{
|
|
1254
|
+
++ intersection;
|
|
1255
|
+
break;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
switch (pickSensorNode .getMatchCriterion ())
|
|
1260
|
+
{
|
|
1261
|
+
case MatchCriterion .MATCH_ANY:
|
|
1262
|
+
{
|
|
1263
|
+
if (intersection === 0)
|
|
1264
|
+
continue;
|
|
1265
|
+
|
|
1266
|
+
break;
|
|
1267
|
+
}
|
|
1268
|
+
case MatchCriterion .MATCH_EVERY:
|
|
1269
|
+
{
|
|
1270
|
+
if (intersection !== pickSensor .getObjectType () .size)
|
|
1271
|
+
continue;
|
|
1272
|
+
|
|
1273
|
+
break;
|
|
1274
|
+
}
|
|
1275
|
+
case MatchCriterion .MATCH_ONLY_ONE:
|
|
1276
|
+
{
|
|
1277
|
+
if (intersection !== 1)
|
|
1278
|
+
continue;
|
|
1279
|
+
|
|
1280
|
+
break;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
pickSensorNodes .add (pickSensorNode);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
pickableStack .push (true);
|
|
1289
|
+
pickSensorStack .push (pickSensorNodes);
|
|
1290
|
+
|
|
1291
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1292
|
+
|
|
1293
|
+
pickSensorStack .pop ();
|
|
1294
|
+
pickableStack .pop ();
|
|
1295
|
+
|
|
1296
|
+
pickSensorNodes .clear ();
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
else
|
|
1301
|
+
{
|
|
1302
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1305
|
+
})(),
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
return PickableGroup;
|
|
1313
1309
|
});
|
|
1314
1310
|
|
|
1315
1311
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1362,10 +1358,10 @@ function (Fields,
|
|
|
1362
1358
|
|
|
1363
1359
|
|
|
1364
1360
|
define ('x_ite/Browser/Picking/VolumePicker',[
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1361
|
+
"standard/Math/Numbers/Vector3",
|
|
1362
|
+
"standard/Math/Numbers/Rotation4",
|
|
1363
|
+
"standard/Math/Numbers/Matrix4",
|
|
1364
|
+
require .getComponentUrl ("rigid-body-physics"),
|
|
1369
1365
|
],
|
|
1370
1366
|
function (Vector3,
|
|
1371
1367
|
Rotation4,
|
|
@@ -1374,140 +1370,140 @@ function (Vector3,
|
|
|
1374
1370
|
{
|
|
1375
1371
|
"use strict";
|
|
1376
1372
|
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1373
|
+
const Ammo = RigidBodyPhysics .Ammo;
|
|
1374
|
+
|
|
1375
|
+
function VolumePicker ()
|
|
1376
|
+
{
|
|
1377
|
+
this .broadphase = new Ammo .btDbvtBroadphase ();
|
|
1378
|
+
this .collisionConfiguration = new Ammo .btDefaultCollisionConfiguration ();
|
|
1379
|
+
this .dispatcher = new Ammo .btCollisionDispatcher (this .collisionConfiguration);
|
|
1380
|
+
this .collisionWorld = new Ammo .btCollisionWorld (this .dispatcher, this .broadphase, this .collisionConfiguration);
|
|
1381
|
+
|
|
1382
|
+
this .compoundShape1 = new Ammo .btCompoundShape ();
|
|
1383
|
+
this .motionState1 = new Ammo .btDefaultMotionState ();
|
|
1384
|
+
this .constructionInfo1 = new Ammo .btRigidBodyConstructionInfo (0, this .motionState1, this .compoundShape1);
|
|
1385
|
+
this .rigidBody1 = new Ammo .btRigidBody (this .constructionInfo1);
|
|
1386
|
+
|
|
1387
|
+
this .compoundShape2 = new Ammo .btCompoundShape ();
|
|
1388
|
+
this .motionState2 = new Ammo .btDefaultMotionState ();
|
|
1389
|
+
this .constructionInfo2 = new Ammo .btRigidBodyConstructionInfo (0, this .motionState2, this .compoundShape2);
|
|
1390
|
+
this .rigidBody2 = new Ammo .btRigidBody (this .constructionInfo2);
|
|
1391
|
+
|
|
1392
|
+
this .collisionWorld .addCollisionObject (this .rigidBody1);
|
|
1393
|
+
this .collisionWorld .addCollisionObject (this .rigidBody2);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
VolumePicker .prototype =
|
|
1397
|
+
{
|
|
1398
|
+
constuctor: VolumePicker,
|
|
1399
|
+
setChildShape1: function (matrix, childShape)
|
|
1400
|
+
{
|
|
1401
|
+
this .setChildShape (this .compoundShape1, matrix, childShape);
|
|
1402
|
+
},
|
|
1403
|
+
setChildShape2: function (matrix, childShape)
|
|
1404
|
+
{
|
|
1405
|
+
this .setChildShape (this .compoundShape2, matrix, childShape);
|
|
1406
|
+
},
|
|
1407
|
+
setChildShape1Components: function (transform, localScaling, childShape)
|
|
1408
|
+
{
|
|
1409
|
+
this .setChildShapeComponents (this .compoundShape1, transform, localScaling, childShape);
|
|
1410
|
+
},
|
|
1411
|
+
setChildShape2Components: function (transform, localScaling, childShape)
|
|
1412
|
+
{
|
|
1413
|
+
this .setChildShapeComponents (this .compoundShape2, transform, localScaling, childShape);
|
|
1414
|
+
},
|
|
1415
|
+
setChildShape: (function ()
|
|
1416
|
+
{
|
|
1417
|
+
const
|
|
1418
|
+
translation = new Vector3 (0, 0, 0),
|
|
1419
|
+
rotation = new Rotation4 (0, 0, 1, 0),
|
|
1420
|
+
scale = new Vector3 (1, 1, 1),
|
|
1421
|
+
s = new Ammo .btVector3 (0, 0, 0);
|
|
1422
|
+
|
|
1423
|
+
return function (compoundShape, matrix, childShape)
|
|
1424
|
+
{
|
|
1425
|
+
try
|
|
1426
|
+
{
|
|
1427
|
+
if (compoundShape .getNumChildShapes ())
|
|
1428
|
+
compoundShape .removeChildShapeByIndex (0);
|
|
1429
|
+
|
|
1430
|
+
if (childShape .getNumChildShapes ())
|
|
1431
|
+
{
|
|
1432
|
+
matrix .get (translation, rotation, scale);
|
|
1433
|
+
|
|
1434
|
+
s .setValue (scale .x, scale .y, scale .z);
|
|
1435
|
+
|
|
1436
|
+
childShape .setLocalScaling (s);
|
|
1437
|
+
compoundShape .addChildShape (this .getTransform (translation, rotation), childShape);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
catch (error)
|
|
1441
|
+
{
|
|
1442
|
+
// matrix .get
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
})(),
|
|
1446
|
+
setChildShapeComponents: function (compoundShape, transform, localScaling, childShape)
|
|
1447
|
+
{
|
|
1448
|
+
if (compoundShape .getNumChildShapes ())
|
|
1449
|
+
compoundShape .removeChildShapeByIndex (0);
|
|
1450
|
+
|
|
1451
|
+
if (childShape .getNumChildShapes ())
|
|
1452
|
+
{
|
|
1453
|
+
childShape .setLocalScaling (localScaling);
|
|
1454
|
+
compoundShape .addChildShape (transform, childShape);
|
|
1455
|
+
}
|
|
1456
|
+
},
|
|
1457
|
+
contactTest: function ()
|
|
1458
|
+
{
|
|
1459
|
+
this .collisionWorld .performDiscreteCollisionDetection ();
|
|
1460
|
+
|
|
1461
|
+
const numManifolds = this .dispatcher .getNumManifolds ();
|
|
1462
|
+
|
|
1463
|
+
for (let i = 0; i < numManifolds; ++ i)
|
|
1464
|
+
{
|
|
1465
|
+
const
|
|
1466
|
+
contactManifold = this .dispatcher .getManifoldByIndexInternal (i),
|
|
1467
|
+
numContacts = contactManifold .getNumContacts ();
|
|
1468
|
+
|
|
1469
|
+
for (let j = 0; j < numContacts; ++ j)
|
|
1470
|
+
{
|
|
1471
|
+
const pt = contactManifold .getContactPoint (j);
|
|
1472
|
+
|
|
1473
|
+
if (pt .getDistance () <= 0)
|
|
1474
|
+
return true;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
return false;
|
|
1479
|
+
},
|
|
1480
|
+
getTransform: (function ()
|
|
1481
|
+
{
|
|
1482
|
+
const
|
|
1483
|
+
T = new Ammo .btTransform (),
|
|
1484
|
+
o = new Ammo .btVector3 (0, 0, 0),
|
|
1485
|
+
m = new Matrix4 ();
|
|
1486
|
+
|
|
1487
|
+
return function (translation, rotation, transform)
|
|
1488
|
+
{
|
|
1489
|
+
const t = transform || T;
|
|
1490
|
+
|
|
1491
|
+
m .set (translation, rotation);
|
|
1492
|
+
|
|
1493
|
+
o .setValue (m [12], m [13], m [14]);
|
|
1494
|
+
|
|
1495
|
+
t .getBasis () .setValue (m [0], m [4], m [8],
|
|
1496
|
+
m [1], m [5], m [9],
|
|
1497
|
+
m [2], m [6], m [10]);
|
|
1498
|
+
|
|
1499
|
+
t .setOrigin (o);
|
|
1500
|
+
|
|
1501
|
+
return t;
|
|
1502
|
+
};
|
|
1503
|
+
})(),
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
return VolumePicker;
|
|
1511
1507
|
});
|
|
1512
1508
|
|
|
1513
1509
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1560,18 +1556,18 @@ function (Vector3,
|
|
|
1560
1556
|
|
|
1561
1557
|
|
|
1562
1558
|
define ('x_ite/Components/Picking/PointPickSensor',[
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1559
|
+
"x_ite/Fields",
|
|
1560
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
1561
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
1562
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
1563
|
+
"x_ite/Base/X3DCast",
|
|
1564
|
+
"x_ite/Base/X3DConstants",
|
|
1565
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
1566
|
+
"x_ite/Browser/Picking/VolumePicker",
|
|
1567
|
+
"standard/Math/Numbers/Vector3",
|
|
1568
|
+
"standard/Math/Numbers/Rotation4",
|
|
1569
|
+
"standard/Math/Geometry/Box3",
|
|
1570
|
+
require .getComponentUrl ("rigid-body-physics"),
|
|
1575
1571
|
],
|
|
1576
1572
|
function (Fields,
|
|
1577
1573
|
X3DFieldDefinition,
|
|
@@ -1588,283 +1584,283 @@ function (Fields,
|
|
|
1588
1584
|
{
|
|
1589
1585
|
"use strict";
|
|
1590
1586
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1587
|
+
var Ammo = RigidBodyPhysics .Ammo;
|
|
1588
|
+
|
|
1589
|
+
function PointPickSensor (executionContext)
|
|
1590
|
+
{
|
|
1591
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
1592
|
+
|
|
1593
|
+
this .addType (X3DConstants .PointPickSensor);
|
|
1594
|
+
|
|
1595
|
+
this .pickingGeometryNode = null;
|
|
1596
|
+
this .picker = new VolumePicker ();
|
|
1597
|
+
this .compoundShapes = [ ];
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
PointPickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
1601
|
+
{
|
|
1602
|
+
constructor: PointPickSensor,
|
|
1603
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
1604
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1605
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
1606
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
1607
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
1608
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
1609
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
1610
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
1611
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedPoint", new Fields .MFVec3f ()),
|
|
1612
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
1613
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
1614
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
1615
|
+
]),
|
|
1616
|
+
getTypeName: function ()
|
|
1617
|
+
{
|
|
1618
|
+
return "PointPickSensor";
|
|
1619
|
+
},
|
|
1620
|
+
getComponentName: function ()
|
|
1621
|
+
{
|
|
1622
|
+
return "Picking";
|
|
1623
|
+
},
|
|
1624
|
+
getContainerField: function ()
|
|
1625
|
+
{
|
|
1626
|
+
return "children";
|
|
1627
|
+
},
|
|
1628
|
+
initialize: function ()
|
|
1629
|
+
{
|
|
1630
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
1631
|
+
|
|
1632
|
+
this ._pickingGeometry .addInterest ("set_pickingGeometry__", this);
|
|
1633
|
+
|
|
1634
|
+
this .set_pickingGeometry__ ();
|
|
1635
|
+
},
|
|
1636
|
+
set_pickingGeometry__: function ()
|
|
1637
|
+
{
|
|
1638
|
+
if (this .pickingGeometryNode)
|
|
1639
|
+
this .pickingGeometryNode ._rebuild .removeInterest ("set_geometry__", this);
|
|
1640
|
+
|
|
1641
|
+
this .pickingGeometryNode = X3DCast (X3DConstants .PointSet, this ._pickingGeometry);
|
|
1642
|
+
|
|
1643
|
+
if (this .pickingGeometryNode)
|
|
1644
|
+
this .pickingGeometryNode ._rebuild .addInterest ("set_geometry__", this);
|
|
1645
|
+
|
|
1646
|
+
this .set_geometry__ ();
|
|
1647
|
+
},
|
|
1648
|
+
set_geometry__: (function ()
|
|
1649
|
+
{
|
|
1650
|
+
var
|
|
1651
|
+
defaultScale = new Ammo .btVector3 (1, 1, 1),
|
|
1652
|
+
o = new Ammo .btVector3 (),
|
|
1653
|
+
t = new Ammo .btTransform ();
|
|
1654
|
+
|
|
1655
|
+
return function ()
|
|
1656
|
+
{
|
|
1657
|
+
var compoundShapes = this .compoundShapes;
|
|
1658
|
+
|
|
1659
|
+
if (this .pickingGeometryNode)
|
|
1660
|
+
{
|
|
1661
|
+
var coord = this .pickingGeometryNode .getCoord ();
|
|
1662
|
+
|
|
1663
|
+
if (coord)
|
|
1664
|
+
{
|
|
1665
|
+
for (var i = 0, length = coord .getSize (); i < length; ++ i)
|
|
1666
|
+
{
|
|
1667
|
+
if (i < compoundShapes .length)
|
|
1668
|
+
{
|
|
1669
|
+
var
|
|
1670
|
+
compoundShape = compoundShapes [i],
|
|
1671
|
+
point = coord .get1Point (i, compoundShape .point);
|
|
1672
|
+
|
|
1673
|
+
o .setValue (point .x, point .y, point .z);
|
|
1674
|
+
t .setOrigin (o);
|
|
1675
|
+
|
|
1676
|
+
compoundShape .setLocalScaling (defaultScale);
|
|
1677
|
+
compoundShape .updateChildTransform (0, t);
|
|
1678
|
+
}
|
|
1679
|
+
else
|
|
1680
|
+
{
|
|
1681
|
+
var
|
|
1682
|
+
compoundShape = new Ammo .btCompoundShape (),
|
|
1683
|
+
sphereShape = new Ammo .btSphereShape (0),
|
|
1684
|
+
point = coord .get1Point (i, new Vector3 (0, 0, 0));
|
|
1685
|
+
|
|
1686
|
+
compoundShape .point = point;
|
|
1687
|
+
|
|
1688
|
+
o .setValue (point .x, point .y, point .z);
|
|
1689
|
+
t .setOrigin (o);
|
|
1690
|
+
|
|
1691
|
+
compoundShape .addChildShape (t, sphereShape);
|
|
1692
|
+
compoundShapes .push (compoundShape);
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
compoundShapes .length = length;
|
|
1697
|
+
}
|
|
1698
|
+
else
|
|
1699
|
+
{
|
|
1700
|
+
compoundShapes .length = 0;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
else
|
|
1704
|
+
{
|
|
1705
|
+
compoundShapes .length = 0;
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
})(),
|
|
1709
|
+
process: (function ()
|
|
1710
|
+
{
|
|
1711
|
+
var
|
|
1712
|
+
pickingBBox = new Box3 (),
|
|
1713
|
+
targetBBox = new Box3 (),
|
|
1714
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
1715
|
+
targetCenter = new Vector3 (0, 0, 0),
|
|
1716
|
+
transform = new Ammo .btTransform (),
|
|
1717
|
+
localScaling = new Ammo .btVector3 (),
|
|
1718
|
+
translation = new Vector3 (0, 0, 0),
|
|
1719
|
+
rotation = new Rotation4 (0, 0, 1, 0),
|
|
1720
|
+
scale = new Vector3 (1, 1, 1),
|
|
1721
|
+
pickedPoint = new Fields .MFVec3f ();
|
|
1722
|
+
|
|
1723
|
+
return function ()
|
|
1724
|
+
{
|
|
1725
|
+
if (this .pickingGeometryNode)
|
|
1726
|
+
{
|
|
1727
|
+
var
|
|
1728
|
+
modelMatrices = this .getModelMatrices (),
|
|
1729
|
+
targets = this .getTargets ();
|
|
1730
|
+
|
|
1731
|
+
switch (this .getIntersectionType ())
|
|
1732
|
+
{
|
|
1733
|
+
case IntersectionType .BOUNDS:
|
|
1734
|
+
{
|
|
1735
|
+
// Intersect bboxes.
|
|
1736
|
+
|
|
1737
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
1738
|
+
{
|
|
1739
|
+
var modelMatrix = modelMatrices [m];
|
|
1740
|
+
|
|
1741
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
1742
|
+
|
|
1743
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
1744
|
+
{
|
|
1745
|
+
var target = targets [t];
|
|
1746
|
+
|
|
1747
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
1748
|
+
|
|
1749
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
1750
|
+
{
|
|
1751
|
+
pickingCenter .assign (pickingBBox .center);
|
|
1752
|
+
targetCenter .assign (targetBBox .center);
|
|
1753
|
+
|
|
1754
|
+
target .intersected = true;
|
|
1755
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
// Send events.
|
|
1761
|
+
|
|
1762
|
+
var
|
|
1763
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
1764
|
+
active = Boolean (pickedGeometries .length);
|
|
1765
|
+
|
|
1766
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
1767
|
+
|
|
1768
|
+
if (active !== this ._isActive .getValue ())
|
|
1769
|
+
this ._isActive = active;
|
|
1770
|
+
|
|
1771
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
1772
|
+
this ._pickedGeometry = pickedGeometries;
|
|
1773
|
+
|
|
1774
|
+
break;
|
|
1775
|
+
}
|
|
1776
|
+
case IntersectionType .GEOMETRY:
|
|
1777
|
+
{
|
|
1778
|
+
// Intersect geometry.
|
|
1779
|
+
|
|
1780
|
+
var
|
|
1781
|
+
picker = this .picker,
|
|
1782
|
+
compoundShapes = this .compoundShapes;
|
|
1783
|
+
|
|
1784
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
1785
|
+
{
|
|
1786
|
+
var modelMatrix = modelMatrices [m];
|
|
1787
|
+
|
|
1788
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
1789
|
+
|
|
1790
|
+
modelMatrix .get (translation, rotation, scale);
|
|
1791
|
+
|
|
1792
|
+
picker .getTransform (translation, rotation, transform);
|
|
1793
|
+
localScaling .setValue (scale .x, scale .y, scale .z);
|
|
1794
|
+
|
|
1795
|
+
for (var c = 0, cLength = compoundShapes .length; c < cLength; ++ c)
|
|
1796
|
+
{
|
|
1797
|
+
var compoundShape = compoundShapes [c];
|
|
1798
|
+
|
|
1799
|
+
picker .setChildShape1Components (transform, localScaling, compoundShape);
|
|
1800
|
+
|
|
1801
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
1802
|
+
{
|
|
1803
|
+
var
|
|
1804
|
+
target = targets [t],
|
|
1805
|
+
targetShape = this .getPickShape (target .geometryNode);
|
|
1810
1806
|
|
|
1811
|
-
|
|
1807
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
1812
1808
|
|
|
1813
|
-
|
|
1809
|
+
picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
|
|
1814
1810
|
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1811
|
+
if (picker .contactTest ())
|
|
1812
|
+
{
|
|
1813
|
+
pickingCenter .assign (pickingBBox .center);
|
|
1814
|
+
targetCenter .assign (targetBBox .center);
|
|
1819
1815
|
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1816
|
+
target .intersected = true;
|
|
1817
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
1818
|
+
target .pickedPoint .push (compoundShape .point);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1827
1823
|
|
|
1828
|
-
|
|
1824
|
+
// Send events.
|
|
1829
1825
|
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1826
|
+
var
|
|
1827
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
1828
|
+
active = Boolean (pickedGeometries .length);
|
|
1833
1829
|
|
|
1834
|
-
|
|
1830
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
1835
1831
|
|
|
1836
|
-
|
|
1837
|
-
|
|
1832
|
+
if (active !== this ._isActive .getValue ())
|
|
1833
|
+
this ._isActive = active;
|
|
1838
1834
|
|
|
1839
|
-
|
|
1840
|
-
|
|
1835
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
1836
|
+
this ._pickedGeometry = pickedGeometries;
|
|
1841
1837
|
|
|
1842
|
-
|
|
1838
|
+
var pickedTargets = this .getPickedTargets ();
|
|
1843
1839
|
|
|
1844
|
-
|
|
1840
|
+
pickedPoint .length = 0;
|
|
1845
1841
|
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1842
|
+
for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
|
|
1843
|
+
{
|
|
1844
|
+
var pp = pickedTargets [t] .pickedPoint;
|
|
1849
1845
|
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1846
|
+
for (var p = 0, pLength = pp .length; p < pLength; ++ p)
|
|
1847
|
+
pickedPoint .push (pp [p]);
|
|
1848
|
+
}
|
|
1853
1849
|
|
|
1854
|
-
|
|
1855
|
-
|
|
1850
|
+
if (! this ._pickedPoint .equals (pickedPoint))
|
|
1851
|
+
this ._pickedPoint = pickedPoint;
|
|
1856
1852
|
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1853
|
+
break;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1861
1857
|
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1858
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
1859
|
+
};
|
|
1860
|
+
})(),
|
|
1861
|
+
});
|
|
1866
1862
|
|
|
1867
|
-
|
|
1863
|
+
return PointPickSensor;
|
|
1868
1864
|
});
|
|
1869
1865
|
|
|
1870
1866
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
@@ -1917,20 +1913,20 @@ function (Fields,
|
|
|
1917
1913
|
|
|
1918
1914
|
|
|
1919
1915
|
define ('x_ite/Components/Picking/PrimitivePickSensor',[
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1916
|
+
"x_ite/Fields",
|
|
1917
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
1918
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
1919
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
1920
|
+
"x_ite/Base/X3DConstants",
|
|
1921
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
1922
|
+
"x_ite/Browser/Picking/VolumePicker",
|
|
1923
|
+
"standard/Math/Numbers/Vector3",
|
|
1924
|
+
"standard/Math/Geometry/Box3",
|
|
1929
1925
|
],
|
|
1930
1926
|
function (Fields,
|
|
1931
1927
|
X3DFieldDefinition,
|
|
1932
1928
|
FieldDefinitionArray,
|
|
1933
|
-
X3DPickSensorNode,
|
|
1929
|
+
X3DPickSensorNode,
|
|
1934
1930
|
X3DConstants,
|
|
1935
1931
|
IntersectionType,
|
|
1936
1932
|
VolumePicker,
|
|
@@ -1939,207 +1935,205 @@ function (Fields,
|
|
|
1939
1935
|
{
|
|
1940
1936
|
"use strict";
|
|
1941
1937
|
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
var
|
|
2118
|
-
pickedGeometries = this .getPickedGeometries (),
|
|
2119
|
-
active = Boolean (pickedGeometries .length);
|
|
2120
|
-
|
|
2121
|
-
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2122
|
-
|
|
2123
|
-
if (active !== this .isActive_ .getValue ())
|
|
2124
|
-
this .isActive_ = active;
|
|
2125
|
-
|
|
2126
|
-
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
2127
|
-
this .pickedGeometry_ = pickedGeometries;
|
|
2128
|
-
|
|
2129
|
-
break;
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
X3DPickSensorNode .prototype .process .call (this);
|
|
2135
|
-
};
|
|
2136
|
-
})(),
|
|
2137
|
-
});
|
|
2138
|
-
|
|
2139
|
-
return PrimitivePickSensor;
|
|
2140
|
-
});
|
|
1938
|
+
function PrimitivePickSensor (executionContext)
|
|
1939
|
+
{
|
|
1940
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
1941
|
+
|
|
1942
|
+
this .addType (X3DConstants .PrimitivePickSensor);
|
|
1943
|
+
|
|
1944
|
+
this .pickingGeometryNode = null;
|
|
1945
|
+
this .picker = new VolumePicker ();
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
PrimitivePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
1949
|
+
{
|
|
1950
|
+
constructor: PrimitivePickSensor,
|
|
1951
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
1952
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1953
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
1954
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
1955
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
1956
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
1957
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
1958
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
1959
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
1960
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
1961
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
1962
|
+
]),
|
|
1963
|
+
getTypeName: function ()
|
|
1964
|
+
{
|
|
1965
|
+
return "PrimitivePickSensor";
|
|
1966
|
+
},
|
|
1967
|
+
getComponentName: function ()
|
|
1968
|
+
{
|
|
1969
|
+
return "Picking";
|
|
1970
|
+
},
|
|
1971
|
+
getContainerField: function ()
|
|
1972
|
+
{
|
|
1973
|
+
return "children";
|
|
1974
|
+
},
|
|
1975
|
+
initialize: function ()
|
|
1976
|
+
{
|
|
1977
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
1978
|
+
|
|
1979
|
+
this ._pickingGeometry .addInterest ("set_pickingGeometry__", this);
|
|
1980
|
+
|
|
1981
|
+
this .set_pickingGeometry__ ();
|
|
1982
|
+
},
|
|
1983
|
+
set_pickingGeometry__: function ()
|
|
1984
|
+
{
|
|
1985
|
+
this .pickingGeometryNode = null;
|
|
1986
|
+
|
|
1987
|
+
try
|
|
1988
|
+
{
|
|
1989
|
+
var
|
|
1990
|
+
node = this ._pickingGeometry .getValue () .getInnerNode (),
|
|
1991
|
+
type = node .getType ();
|
|
1992
|
+
|
|
1993
|
+
for (var t = type .length - 1; t >= 0; -- t)
|
|
1994
|
+
{
|
|
1995
|
+
switch (type [t])
|
|
1996
|
+
{
|
|
1997
|
+
case X3DConstants .Box:
|
|
1998
|
+
case X3DConstants .Cone:
|
|
1999
|
+
case X3DConstants .Cylinder:
|
|
2000
|
+
case X3DConstants .Sphere:
|
|
2001
|
+
{
|
|
2002
|
+
this .pickingGeometryNode = node;
|
|
2003
|
+
break;
|
|
2004
|
+
}
|
|
2005
|
+
default:
|
|
2006
|
+
continue;
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
catch (error)
|
|
2011
|
+
{ }
|
|
2012
|
+
},
|
|
2013
|
+
process: (function ()
|
|
2014
|
+
{
|
|
2015
|
+
var
|
|
2016
|
+
pickingBBox = new Box3 (),
|
|
2017
|
+
targetBBox = new Box3 (),
|
|
2018
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
2019
|
+
targetCenter = new Vector3 (0, 0, 0);
|
|
2020
|
+
|
|
2021
|
+
return function ()
|
|
2022
|
+
{
|
|
2023
|
+
if (this .pickingGeometryNode)
|
|
2024
|
+
{
|
|
2025
|
+
var
|
|
2026
|
+
modelMatrices = this .getModelMatrices (),
|
|
2027
|
+
targets = this .getTargets ();
|
|
2028
|
+
|
|
2029
|
+
switch (this .getIntersectionType ())
|
|
2030
|
+
{
|
|
2031
|
+
case IntersectionType .BOUNDS:
|
|
2032
|
+
{
|
|
2033
|
+
// Intersect bboxes.
|
|
2034
|
+
|
|
2035
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2036
|
+
{
|
|
2037
|
+
var modelMatrix = modelMatrices [m];
|
|
2038
|
+
|
|
2039
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2040
|
+
|
|
2041
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2042
|
+
{
|
|
2043
|
+
var target = targets [t];
|
|
2044
|
+
|
|
2045
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2046
|
+
|
|
2047
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
2048
|
+
{
|
|
2049
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2050
|
+
targetCenter .assign (targetBBox .center);
|
|
2051
|
+
|
|
2052
|
+
target .intersected = true;
|
|
2053
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
// Send events.
|
|
2059
|
+
|
|
2060
|
+
var
|
|
2061
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2062
|
+
active = Boolean (pickedGeometries .length);
|
|
2063
|
+
|
|
2064
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2065
|
+
|
|
2066
|
+
if (active !== this ._isActive .getValue ())
|
|
2067
|
+
this ._isActive = active;
|
|
2068
|
+
|
|
2069
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
2070
|
+
this ._pickedGeometry = pickedGeometries;
|
|
2071
|
+
|
|
2072
|
+
break;
|
|
2073
|
+
}
|
|
2074
|
+
case IntersectionType .GEOMETRY:
|
|
2075
|
+
{
|
|
2076
|
+
// Intersect geometry.
|
|
2077
|
+
|
|
2078
|
+
var picker = this .picker;
|
|
2079
|
+
|
|
2080
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2081
|
+
{
|
|
2082
|
+
var
|
|
2083
|
+
modelMatrix = modelMatrices [m],
|
|
2084
|
+
pickingShape = this .getPickShape (this .pickingGeometryNode);
|
|
2085
|
+
|
|
2086
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2087
|
+
|
|
2088
|
+
picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
|
|
2089
|
+
|
|
2090
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2091
|
+
{
|
|
2092
|
+
var
|
|
2093
|
+
target = targets [t],
|
|
2094
|
+
targetShape = this .getPickShape (target .geometryNode);
|
|
2095
|
+
|
|
2096
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2097
|
+
|
|
2098
|
+
picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
|
|
2099
|
+
|
|
2100
|
+
if (picker .contactTest ())
|
|
2101
|
+
{
|
|
2102
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2103
|
+
targetCenter .assign (targetBBox .center);
|
|
2104
|
+
|
|
2105
|
+
target .intersected = true;
|
|
2106
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
// Send events.
|
|
2141
2112
|
|
|
2113
|
+
var
|
|
2114
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2115
|
+
active = Boolean (pickedGeometries .length);
|
|
2142
2116
|
|
|
2117
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2118
|
+
|
|
2119
|
+
if (active !== this ._isActive .getValue ())
|
|
2120
|
+
this ._isActive = active;
|
|
2121
|
+
|
|
2122
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
2123
|
+
this ._pickedGeometry = pickedGeometries;
|
|
2124
|
+
|
|
2125
|
+
break;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
2131
|
+
};
|
|
2132
|
+
})(),
|
|
2133
|
+
});
|
|
2134
|
+
|
|
2135
|
+
return PrimitivePickSensor;
|
|
2136
|
+
});
|
|
2143
2137
|
|
|
2144
2138
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2145
2139
|
*******************************************************************************
|
|
@@ -2191,21 +2185,21 @@ function (Fields,
|
|
|
2191
2185
|
|
|
2192
2186
|
|
|
2193
2187
|
define ('x_ite/Components/Picking/VolumePickSensor',[
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2188
|
+
"x_ite/Fields",
|
|
2189
|
+
"x_ite/Base/X3DFieldDefinition",
|
|
2190
|
+
"x_ite/Base/FieldDefinitionArray",
|
|
2191
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
2192
|
+
"x_ite/Base/X3DCast",
|
|
2193
|
+
"x_ite/Base/X3DConstants",
|
|
2194
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
2195
|
+
"x_ite/Browser/Picking/VolumePicker",
|
|
2196
|
+
"standard/Math/Numbers/Vector3",
|
|
2197
|
+
"standard/Math/Geometry/Box3",
|
|
2204
2198
|
],
|
|
2205
2199
|
function (Fields,
|
|
2206
2200
|
X3DFieldDefinition,
|
|
2207
2201
|
FieldDefinitionArray,
|
|
2208
|
-
X3DPickSensorNode,
|
|
2202
|
+
X3DPickSensorNode,
|
|
2209
2203
|
X3DCast,
|
|
2210
2204
|
X3DConstants,
|
|
2211
2205
|
IntersectionType,
|
|
@@ -2215,181 +2209,179 @@ function (Fields,
|
|
|
2215
2209
|
{
|
|
2216
2210
|
"use strict";
|
|
2217
2211
|
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
target .intersected = true;
|
|
2360
|
-
target .distance = pickingCenter .distance (targetCenter);
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
// Send events.
|
|
2366
|
-
|
|
2367
|
-
var
|
|
2368
|
-
pickedGeometries = this .getPickedGeometries (),
|
|
2369
|
-
active = Boolean (pickedGeometries .length);
|
|
2370
|
-
|
|
2371
|
-
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2372
|
-
|
|
2373
|
-
if (active !== this .isActive_ .getValue ())
|
|
2374
|
-
this .isActive_ = active;
|
|
2375
|
-
|
|
2376
|
-
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
2377
|
-
this .pickedGeometry_ = pickedGeometries;
|
|
2378
|
-
|
|
2379
|
-
break;
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
|
|
2384
|
-
X3DPickSensorNode .prototype .process .call (this);
|
|
2385
|
-
};
|
|
2386
|
-
})(),
|
|
2387
|
-
});
|
|
2388
|
-
|
|
2389
|
-
return VolumePickSensor;
|
|
2390
|
-
});
|
|
2212
|
+
function VolumePickSensor (executionContext)
|
|
2213
|
+
{
|
|
2214
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
2215
|
+
|
|
2216
|
+
this .addType (X3DConstants .VolumePickSensor);
|
|
2217
|
+
|
|
2218
|
+
this .pickingGeometryNode = null;
|
|
2219
|
+
this .picker = new VolumePicker ();
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
VolumePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
2223
|
+
{
|
|
2224
|
+
constructor: VolumePickSensor,
|
|
2225
|
+
[Symbol .for ("X_ITE.X3DBaseNode.fieldDefinitions")]: new FieldDefinitionArray ([
|
|
2226
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2227
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
2228
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
2229
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
2230
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
2231
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
2232
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
2233
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
2234
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
2235
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
2236
|
+
]),
|
|
2237
|
+
getTypeName: function ()
|
|
2238
|
+
{
|
|
2239
|
+
return "VolumePickSensor";
|
|
2240
|
+
},
|
|
2241
|
+
getComponentName: function ()
|
|
2242
|
+
{
|
|
2243
|
+
return "Picking";
|
|
2244
|
+
},
|
|
2245
|
+
getContainerField: function ()
|
|
2246
|
+
{
|
|
2247
|
+
return "children";
|
|
2248
|
+
},
|
|
2249
|
+
initialize: function ()
|
|
2250
|
+
{
|
|
2251
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
2252
|
+
|
|
2253
|
+
this ._pickingGeometry .addInterest ("set_pickingGeometry__", this);
|
|
2254
|
+
|
|
2255
|
+
this .set_pickingGeometry__ ();
|
|
2256
|
+
},
|
|
2257
|
+
set_pickingGeometry__: function ()
|
|
2258
|
+
{
|
|
2259
|
+
this .pickingGeometryNode = X3DCast (X3DConstants .X3DGeometryNode, this ._pickingGeometry);
|
|
2260
|
+
},
|
|
2261
|
+
process: (function ()
|
|
2262
|
+
{
|
|
2263
|
+
var
|
|
2264
|
+
pickingBBox = new Box3 (),
|
|
2265
|
+
targetBBox = new Box3 (),
|
|
2266
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
2267
|
+
targetCenter = new Vector3 (0, 0, 0);
|
|
2268
|
+
|
|
2269
|
+
return function ()
|
|
2270
|
+
{
|
|
2271
|
+
if (this .pickingGeometryNode)
|
|
2272
|
+
{
|
|
2273
|
+
var
|
|
2274
|
+
modelMatrices = this .getModelMatrices (),
|
|
2275
|
+
targets = this .getTargets ();
|
|
2276
|
+
|
|
2277
|
+
switch (this .getIntersectionType ())
|
|
2278
|
+
{
|
|
2279
|
+
case IntersectionType .BOUNDS:
|
|
2280
|
+
{
|
|
2281
|
+
// Intersect bboxes.
|
|
2282
|
+
|
|
2283
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2284
|
+
{
|
|
2285
|
+
var modelMatrix = modelMatrices [m];
|
|
2286
|
+
|
|
2287
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2288
|
+
|
|
2289
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2290
|
+
{
|
|
2291
|
+
var target = targets [t];
|
|
2292
|
+
|
|
2293
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2294
|
+
|
|
2295
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
2296
|
+
{
|
|
2297
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2298
|
+
targetCenter .assign (targetBBox .center);
|
|
2299
|
+
|
|
2300
|
+
target .intersected = true;
|
|
2301
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
// Send events.
|
|
2307
|
+
|
|
2308
|
+
var
|
|
2309
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2310
|
+
active = Boolean (pickedGeometries .length);
|
|
2311
|
+
|
|
2312
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2313
|
+
|
|
2314
|
+
if (active !== this ._isActive .getValue ())
|
|
2315
|
+
this ._isActive = active;
|
|
2316
|
+
|
|
2317
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
2318
|
+
this ._pickedGeometry = pickedGeometries;
|
|
2319
|
+
|
|
2320
|
+
break;
|
|
2321
|
+
}
|
|
2322
|
+
case IntersectionType .GEOMETRY:
|
|
2323
|
+
{
|
|
2324
|
+
// Intersect geometry.
|
|
2325
|
+
|
|
2326
|
+
var picker = this .picker;
|
|
2327
|
+
|
|
2328
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2329
|
+
{
|
|
2330
|
+
var
|
|
2331
|
+
modelMatrix = modelMatrices [m],
|
|
2332
|
+
pickingShape = this .getPickShape (this .pickingGeometryNode);
|
|
2333
|
+
|
|
2334
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2335
|
+
|
|
2336
|
+
picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
|
|
2337
|
+
|
|
2338
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2339
|
+
{
|
|
2340
|
+
var
|
|
2341
|
+
target = targets [t],
|
|
2342
|
+
targetShape = this .getPickShape (target .geometryNode);
|
|
2343
|
+
|
|
2344
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2345
|
+
|
|
2346
|
+
picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
|
|
2347
|
+
|
|
2348
|
+
if (picker .contactTest ())
|
|
2349
|
+
{
|
|
2350
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2351
|
+
targetCenter .assign (targetBBox .center);
|
|
2391
2352
|
|
|
2353
|
+
target .intersected = true;
|
|
2354
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2392
2358
|
|
|
2359
|
+
// Send events.
|
|
2360
|
+
|
|
2361
|
+
var
|
|
2362
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2363
|
+
active = Boolean (pickedGeometries .length);
|
|
2364
|
+
|
|
2365
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2366
|
+
|
|
2367
|
+
if (active !== this ._isActive .getValue ())
|
|
2368
|
+
this ._isActive = active;
|
|
2369
|
+
|
|
2370
|
+
if (! this ._pickedGeometry .equals (pickedGeometries))
|
|
2371
|
+
this ._pickedGeometry = pickedGeometries;
|
|
2372
|
+
|
|
2373
|
+
break;
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
2379
|
+
};
|
|
2380
|
+
})(),
|
|
2381
|
+
});
|
|
2382
|
+
|
|
2383
|
+
return VolumePickSensor;
|
|
2384
|
+
});
|
|
2393
2385
|
|
|
2394
2386
|
/*******************************************************************************
|
|
2395
2387
|
*
|
|
@@ -2440,15 +2432,15 @@ function (Fields,
|
|
|
2440
2432
|
|
|
2441
2433
|
|
|
2442
2434
|
define (require .getComponentUrl ("picking"), [
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2435
|
+
"x_ite/Components",
|
|
2436
|
+
"x_ite/Components/Picking/LinePickSensor",
|
|
2437
|
+
"x_ite/Components/Picking/PickableGroup",
|
|
2438
|
+
"x_ite/Components/Picking/PointPickSensor",
|
|
2439
|
+
"x_ite/Components/Picking/PrimitivePickSensor",
|
|
2440
|
+
"x_ite/Components/Picking/VolumePickSensor",
|
|
2441
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
2442
|
+
"x_ite/Components/Picking/X3DPickableObject",
|
|
2443
|
+
require .getComponentUrl ("rigid-body-physics"),
|
|
2452
2444
|
],
|
|
2453
2445
|
function (Components,
|
|
2454
2446
|
LinePickSensor,
|
|
@@ -2461,22 +2453,22 @@ function (Components,
|
|
|
2461
2453
|
{
|
|
2462
2454
|
"use strict";
|
|
2463
2455
|
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2456
|
+
Components .addComponent ({
|
|
2457
|
+
name: "Picking",
|
|
2458
|
+
types:
|
|
2459
|
+
{
|
|
2460
|
+
LinePickSensor: LinePickSensor,
|
|
2461
|
+
PickableGroup: PickableGroup,
|
|
2462
|
+
PointPickSensor: PointPickSensor,
|
|
2463
|
+
PrimitivePickSensor: PrimitivePickSensor,
|
|
2464
|
+
VolumePickSensor: VolumePickSensor,
|
|
2465
|
+
},
|
|
2466
|
+
abstractTypes:
|
|
2467
|
+
{
|
|
2468
|
+
X3DPickSensorNode: X3DPickSensorNode,
|
|
2469
|
+
X3DPickableObject: X3DPickableObject,
|
|
2470
|
+
},
|
|
2471
|
+
});
|
|
2480
2472
|
});
|
|
2481
2473
|
|
|
2482
2474
|
|