x_ite 4.2.17 → 4.7.7
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/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +25 -0
- package/Makefile +27 -10
- package/README.md +13 -145
- package/build/bin/dist.pl +65 -8
- package/build/bin/version-number.pl +25 -0
- package/build/bin/version.pl +54 -14
- package/build/components/annotation.build.js +15 -0
- package/build/components/cad-geometry.build.js +15 -0
- package/build/components/cube-map-texturing.build.js +15 -0
- package/build/components/dis.build.js +15 -0
- package/build/components/event-utilities.build.js +15 -0
- package/build/components/geometry2d.build.js +15 -0
- package/build/components/geospatial.build.js +15 -0
- package/build/components/h-anim.build.js +15 -0
- package/build/components/key-device-sensor.build.js +15 -0
- package/build/components/layout.build.js +15 -0
- package/build/components/nurbs.build.js +15 -0
- package/build/components/particle-systems.build.js +15 -0
- package/build/components/picking.build.js +15 -0
- package/build/components/projective-texture-mapping.build.js +15 -0
- package/build/components/rigid-body-physics.build.js +15 -0
- package/build/components/scripting.build.js +15 -0
- package/build/components/texturing-3d.build.js +15 -0
- package/build/components/volume-rendering.build.js +15 -0
- package/build/components/x_ite.build.js +15 -0
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/x_ite.end.frag.js +25 -0
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +5 -2
- package/dist/{components/texturing-3d.js → assets/components/annotation.js} +341 -263
- package/dist/assets/components/annotation.min.js +1 -0
- package/dist/{components → assets/components}/cad-geometry.js +180 -76
- package/dist/assets/components/cad-geometry.min.js +1 -0
- package/dist/assets/components/cube-map-texturing.js +1222 -0
- package/dist/assets/components/cube-map-texturing.min.js +1 -0
- package/dist/assets/components/dis.js +918 -0
- package/dist/assets/components/dis.min.js +1 -0
- package/dist/assets/components/event-utilities.js +1124 -0
- package/dist/assets/components/event-utilities.min.js +1 -0
- package/dist/assets/components/geometry2d.js +2200 -0
- package/dist/assets/components/geometry2d.min.js +1 -0
- package/dist/{components → assets/components}/geospatial.js +364 -269
- package/dist/assets/components/geospatial.min.js +2 -0
- package/dist/{components → assets/components}/h-anim.js +224 -62
- package/dist/assets/components/h-anim.min.js +1 -0
- package/dist/assets/components/key-device-sensor.js +860 -0
- package/dist/assets/components/key-device-sensor.min.js +1 -0
- package/dist/assets/components/layout.js +2018 -0
- package/dist/assets/components/layout.min.js +1 -0
- package/dist/{components → assets/components}/nurbs.js +632 -348
- package/dist/assets/components/nurbs.min.js +2 -0
- package/dist/{components → assets/components}/particle-systems.js +514 -476
- package/dist/assets/components/particle-systems.min.js +2 -0
- package/dist/assets/components/picking.js +2491 -0
- package/dist/assets/components/picking.min.js +1 -0
- package/dist/assets/components/projective-texture-mapping.js +823 -0
- package/dist/assets/components/projective-texture-mapping.min.js +1 -0
- package/dist/assets/components/rigid-body-physics.js +4579 -0
- package/dist/assets/components/rigid-body-physics.min.js +59 -0
- package/dist/assets/components/scripting.js +816 -0
- package/dist/assets/components/scripting.min.js +1 -0
- package/dist/assets/components/texturing-3d.js +10064 -0
- package/dist/assets/components/texturing-3d.min.js +48 -0
- package/dist/assets/components/volume-rendering.js +3976 -0
- package/dist/assets/components/volume-rendering.min.js +3 -0
- package/dist/assets/components/x_ite.js +295 -0
- package/dist/assets/components/x_ite.min.js +1 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Bold.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-BoldItalic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Italic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Regular.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-RI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-RI.ttf +0 -0
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/hatching/1.png +0 -0
- package/dist/assets/hatching/10.png +0 -0
- package/dist/assets/hatching/11.png +0 -0
- package/dist/assets/hatching/12.png +0 -0
- package/dist/assets/hatching/13.png +0 -0
- package/dist/assets/hatching/14.png +0 -0
- package/dist/assets/hatching/15.png +0 -0
- package/dist/assets/hatching/16.png +0 -0
- package/dist/assets/hatching/17.png +0 -0
- package/dist/assets/hatching/18.png +0 -0
- package/dist/assets/hatching/19.png +0 -0
- package/dist/assets/hatching/2.png +0 -0
- package/dist/assets/hatching/3.png +0 -0
- package/dist/assets/hatching/4.png +0 -0
- package/dist/assets/hatching/5.png +0 -0
- package/dist/assets/hatching/6.png +0 -0
- package/dist/assets/hatching/7.png +0 -0
- package/dist/assets/hatching/8.png +0 -0
- package/dist/assets/hatching/9.png +0 -0
- package/dist/{images → assets/images}/ExamineViewer.png +0 -0
- package/dist/{images → assets/images}/FlyViewer.png +0 -0
- package/dist/{images → assets/images}/NoneViewer.png +0 -0
- package/dist/{images → assets/images}/PlaneViewer.png +0 -0
- package/dist/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/dist/{images → assets/images}/TextureQuality.png +0 -0
- package/dist/{images → assets/images}/Time.png +0 -0
- package/dist/{images → assets/images}/Viewpoint.png +0 -0
- package/dist/{images → assets/images}/WalkViewer.png +0 -0
- package/dist/assets/images/go-next.png +0 -0
- package/dist/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/dist/{images → assets/images}/help-about.png +0 -0
- package/dist/{images → assets/images}/icon.bw.png +0 -0
- package/dist/{images → assets/images}/icon.png +0 -0
- package/dist/assets/images/logo.128.png +0 -0
- package/dist/{images → assets/images}/logo.bw.png +0 -0
- package/dist/{images → assets/images}/logo.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Background.fs +23 -0
- package/dist/assets/shaders/webgl1/Background.vs +16 -0
- package/dist/assets/shaders/webgl1/Depth.fs +60 -0
- package/dist/assets/shaders/webgl1/Depth.vs +13 -0
- package/dist/assets/shaders/webgl1/Fallback.fs +28 -0
- package/dist/assets/shaders/webgl1/Fallback.vs +24 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +15 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.vs +18 -0
- package/dist/assets/shaders/webgl1/Gouraud.fs +529 -0
- package/dist/assets/shaders/webgl1/Gouraud.vs +107 -0
- package/dist/assets/shaders/webgl1/Phong.fs +837 -0
- package/dist/assets/shaders/webgl1/Phong.vs +52 -0
- package/dist/assets/shaders/webgl1/PointSet.fs +541 -0
- package/dist/assets/shaders/webgl1/PointSet.vs +48 -0
- package/dist/assets/shaders/webgl1/Unlit.fs +538 -0
- package/dist/assets/shaders/webgl1/Unlit.vs +52 -0
- package/dist/assets/shaders/webgl1/Wireframe.fs +93 -0
- package/dist/assets/shaders/webgl1/Wireframe.vs +47 -0
- package/dist/assets/shaders/webgl2/Background.fs +25 -0
- package/dist/assets/shaders/webgl2/Background.vs +17 -0
- package/dist/assets/shaders/webgl2/Depth.fs +62 -0
- package/dist/assets/shaders/webgl2/Depth.vs +14 -0
- package/dist/assets/shaders/webgl2/Gouraud.fs +684 -0
- package/dist/assets/shaders/webgl2/Gouraud.vs +108 -0
- package/dist/assets/shaders/webgl2/Phong.fs +1013 -0
- package/dist/assets/shaders/webgl2/Phong.vs +53 -0
- package/dist/assets/shaders/webgl2/PointSet.fs +696 -0
- package/dist/assets/shaders/webgl2/PointSet.vs +49 -0
- package/dist/assets/shaders/webgl2/Unlit.fs +693 -0
- package/dist/assets/shaders/webgl2/Unlit.vs +53 -0
- package/dist/assets/shaders/webgl2/Wireframe.fs +102 -0
- package/dist/assets/shaders/webgl2/Wireframe.vs +48 -0
- package/dist/example.html +8 -7
- package/dist/x_ite.css +167 -49
- package/dist/x_ite.js +66263 -60020
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +5 -0
- package/docs/Accessing-the-External-Browser.md +319 -0
- package/docs/Browser-Support.md +47 -0
- package/docs/Custom-Shaders.md +896 -0
- package/docs/Features.md +49 -0
- package/docs/Glossary.md +339 -0
- package/docs/How-To-Configure-Your-Web-Server.md +56 -0
- package/docs/Supported-Nodes.md +370 -0
- package/docs/What's-New.md +1295 -0
- package/docs/XHTML-DOM-Integration.md +82 -0
- package/docs/_config.yml +140 -0
- package/docs/_data/navigation.yml +137 -0
- package/docs/assets/css/main.scss +100 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/google3696ee938394d7b6.html +1 -0
- package/docs/index.md +1033 -0
- package/docs/reference/Browser-Services.md +361 -0
- package/docs/reference/Constants-Services.md +376 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +128 -0
- package/docs/reference/Field-Services-and-Objects.md +1006 -0
- package/docs/reference/Prototype-Services.md +121 -0
- package/docs/reference/Route-Services.md +49 -0
- package/docs/reference/Scene-Services.md +360 -0
- package/docs/reference/Script-Node-Authoring-Interface.md +342 -0
- package/docs/tutorials/Adding-backgrounds.md +268 -0
- package/docs/tutorials/Adding-fog.md +67 -0
- package/docs/tutorials/Adding-sound.md +326 -0
- package/docs/tutorials/Animating-transforms.md +385 -0
- package/docs/tutorials/Basic-Nodes.md +317 -0
- package/docs/tutorials/Building-a-X3D-world.md +152 -0
- package/docs/tutorials/Building-elevation-grids.md +170 -0
- package/docs/tutorials/Building-extruded-shapes.md +145 -0
- package/docs/tutorials/Building-primitive-shapes.md +204 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +311 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +186 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +208 -0
- package/docs/tutorials/Controlling-detail.md +130 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +277 -0
- package/docs/tutorials/Controlling-navigation.md +70 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +180 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +49 -0
- package/docs/tutorials/Creating-new-node-types.md +313 -0
- package/docs/tutorials/Grouping-nodes.md +237 -0
- package/docs/tutorials/Hello,-World!.md +204 -0
- package/docs/tutorials/Improving-Performance.md +227 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +110 -0
- package/docs/tutorials/Introducing-X3D.md +94 -0
- package/docs/tutorials/Introducing-animation.md +211 -0
- package/docs/tutorials/Introducing-script-use.md +127 -0
- package/docs/tutorials/Lighting-your-world.md +139 -0
- package/docs/tutorials/Mapping-textures.md +212 -0
- package/docs/tutorials/Naming-nodes.md +161 -0
- package/docs/tutorials/Providing-information-about-your-world.md +30 -0
- package/docs/tutorials/Sensing-the-viewer.md +205 -0
- package/docs/tutorials/Sensing-viewer-actions.md +214 -0
- package/docs/tutorials/Transforming-Shapes.md +270 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +631 -0
- package/docs/tutorials/index.md +78 -0
- package/meta/logo/logo.png +0 -0
- package/meta/logo/logo.svg +216 -217
- package/meta/web3d.html +3 -3
- package/package.json +43 -28
- package/src/assets/components/annotation.js +87 -0
- package/src/{components → assets/components}/cad-geometry.js +0 -0
- package/src/{x_ite/Components/CubeMapTexturing.js → assets/components/cube-map-texturing.js} +15 -21
- package/src/assets/components/dis.js +84 -0
- package/src/{x_ite/Components/EventUtilities.js → assets/components/event-utilities.js} +20 -26
- package/src/{x_ite/Components/Geometry2D.js → assets/components/geometry2d.js} +22 -25
- package/src/{components → assets/components}/geospatial.js +0 -0
- package/src/{components → assets/components}/h-anim.js +9 -7
- package/src/{x_ite/Components/KeyDeviceSensor.js → assets/components/key-device-sensor.js} +17 -20
- package/src/{x_ite/Components/Layout.js → assets/components/layout.js} +20 -23
- package/src/{components → assets/components}/nurbs.js +0 -0
- package/src/{components → assets/components}/particle-systems.js +1 -1
- package/src/assets/components/picking.js +87 -0
- package/src/assets/components/projective-texture-mapping.js +75 -0
- package/src/{components → assets/components}/rigid-body-physics.js +7 -2
- package/src/{x_ite/Components/Scripting.js → assets/components/scripting.js} +13 -19
- package/src/{components → assets/components}/texturing-3d.js +12 -13
- package/src/assets/components/volume-rendering.js +118 -0
- package/src/{x_ite/Components/X_ITE.js → assets/components/x_ite.js} +12 -30
- package/src/assets/fonts/DroidSerif-Bold.ttf +0 -0
- package/src/assets/fonts/DroidSerif-BoldItalic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Italic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Regular.ttf +0 -0
- package/src/assets/fonts/Ubuntu-B.ttf +0 -0
- package/src/assets/fonts/Ubuntu-BI.ttf +0 -0
- package/src/assets/fonts/Ubuntu-R.ttf +0 -0
- package/src/assets/fonts/Ubuntu-RI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-B.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-BI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-R.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-RI.ttf +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/hatching/1.png +0 -0
- package/src/assets/hatching/10.png +0 -0
- package/src/assets/hatching/11.png +0 -0
- package/src/assets/hatching/12.png +0 -0
- package/src/assets/hatching/13.png +0 -0
- package/src/assets/hatching/14.png +0 -0
- package/src/assets/hatching/15.png +0 -0
- package/src/assets/hatching/16.png +0 -0
- package/src/assets/hatching/17.png +0 -0
- package/src/assets/hatching/18.png +0 -0
- package/src/assets/hatching/19.png +0 -0
- package/src/assets/hatching/2.png +0 -0
- package/src/assets/hatching/3.png +0 -0
- package/src/assets/hatching/4.png +0 -0
- package/src/assets/hatching/5.png +0 -0
- package/src/assets/hatching/6.png +0 -0
- package/src/assets/hatching/7.png +0 -0
- package/src/assets/hatching/8.png +0 -0
- package/src/assets/hatching/9.png +0 -0
- package/src/{images → assets/images}/ExamineViewer.png +0 -0
- package/src/{images → assets/images}/FlyViewer.png +0 -0
- package/src/{images → assets/images}/NoneViewer.png +0 -0
- package/src/{images → assets/images}/PlaneViewer.png +0 -0
- package/src/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/src/{images → assets/images}/TextureQuality.png +0 -0
- package/src/{images → assets/images}/Time.png +0 -0
- package/src/{images → assets/images}/Viewpoint.png +0 -0
- package/src/{images → assets/images}/WalkViewer.png +0 -0
- package/src/assets/images/go-next.png +0 -0
- package/src/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/src/{images → assets/images}/help-about.png +0 -0
- package/src/{images → assets/images}/icon.bw.png +0 -0
- package/src/{images → assets/images}/icon.png +0 -0
- package/src/assets/images/logo.128.png +0 -0
- package/src/{images → assets/images}/logo.bw.png +0 -0
- package/src/{images → assets/images}/logo.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +102 -0
- package/src/assets/shaders/webgl1/Background.fs +16 -0
- package/src/assets/shaders/webgl1/Background.vs +22 -0
- package/src/assets/shaders/webgl1/Depth.fs +16 -0
- package/src/assets/shaders/webgl1/Depth.vs +20 -0
- package/src/assets/shaders/webgl1/Fallback.fs +38 -0
- package/src/assets/shaders/webgl1/Fallback.vs +30 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +21 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +24 -0
- package/src/assets/shaders/webgl1/Gouraud.fs +66 -0
- package/src/assets/shaders/webgl1/Gouraud.vs +147 -0
- package/src/assets/shaders/webgl1/Phong.fs +172 -0
- package/src/assets/shaders/webgl1/Phong.vs +67 -0
- package/src/assets/shaders/webgl1/PointSet.fs +100 -0
- package/src/assets/shaders/webgl1/PointSet.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +86 -0
- package/src/assets/shaders/webgl1/Unlit.vs +67 -0
- package/src/assets/shaders/webgl1/Wireframe.fs +74 -0
- package/src/assets/shaders/webgl1/Wireframe.vs +63 -0
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +38 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl +18 -0
- package/src/{x_ite/Browser/Shaders/Include/Pack.h → assets/shaders/webgl1/include/Pack.glsl} +0 -1
- package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
- package/src/{x_ite/Browser/Shaders/Include/Shadow.h → assets/shaders/webgl1/include/Shadow.glsl} +33 -33
- package/src/assets/shaders/webgl1/include/Texture.glsl +488 -0
- package/src/assets/shaders/webgl2/Background.fs +19 -0
- package/src/assets/shaders/webgl2/Background.vs +23 -0
- package/src/assets/shaders/webgl2/Depth.fs +19 -0
- package/src/assets/shaders/webgl2/Depth.vs +21 -0
- package/src/assets/shaders/webgl2/Gouraud.fs +64 -0
- package/src/assets/shaders/webgl2/Gouraud.vs +148 -0
- package/src/assets/shaders/webgl2/Phong.fs +170 -0
- package/src/assets/shaders/webgl2/Phong.vs +68 -0
- package/src/assets/shaders/webgl2/PointSet.fs +99 -0
- package/src/assets/shaders/webgl2/PointSet.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +85 -0
- package/src/assets/shaders/webgl2/Unlit.vs +68 -0
- package/src/assets/shaders/webgl2/Wireframe.fs +73 -0
- package/src/assets/shaders/webgl2/Wireframe.vs +64 -0
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Hatch.glsl +18 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +51 -0
- package/src/assets/shaders/webgl2/include/Perlin.glsl +40 -0
- package/src/assets/shaders/webgl2/include/Shadow.glsl +324 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +623 -0
- package/src/bookmarks.js +33 -12
- package/src/dummy.js +1 -0
- package/src/example.html +8 -7
- package/src/examples.js +21 -3
- package/src/lib/ammojs/AmmoJS.js +58 -0
- package/src/lib/ammojs/Makefile +4 -0
- package/src/lib/ammojs/ammo.idl +72 -1
- package/src/lib/ammojs/ammo.js +25 -21
- package/src/lib/jpeg/jpeg.js +1019 -0
- package/src/lib/nurbs/extras/sample.js +137 -80
- package/src/locale/de.po +18 -73
- package/src/locale/fr.po +18 -74
- package/src/spinner.css +18 -6
- package/src/standard/Geospatial/Geodetic.js +43 -43
- package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
- package/src/standard/Geospatial/UniversalTransverseMercator.js +42 -42
- package/src/standard/Math/Algorithm.js +22 -39
- package/src/standard/Math/Algorithms/Bezier.js +147 -0
- package/src/standard/Math/Algorithms/MergeSort.js +2 -2
- package/src/standard/Math/Algorithms/PartialSort.js +6 -6
- package/src/standard/Math/Algorithms/QuickSort.js +8 -6
- package/src/standard/Math/Algorithms/SAT.js +4 -8
- package/src/standard/Math/Algorithms/eigendecomposition.js +37 -33
- package/src/standard/Math/Geometry/Box2.js +84 -56
- package/src/standard/Math/Geometry/Box3.js +400 -358
- package/src/standard/Math/Geometry/Camera.js +19 -16
- package/src/standard/Math/Geometry/Cylinder3.js +13 -13
- package/src/standard/Math/Geometry/Line3.js +34 -34
- package/src/standard/Math/Geometry/Plane3.js +15 -15
- package/src/standard/Math/Geometry/Sphere3.js +122 -105
- package/src/standard/Math/Geometry/Spheroid3.js +1 -1
- package/src/standard/Math/Geometry/Triangle2.js +5 -5
- package/src/standard/Math/Geometry/Triangle3.js +12 -14
- package/src/standard/Math/Geometry/ViewVolume.js +303 -106
- package/src/standard/Math/Numbers/Color3.js +26 -23
- package/src/standard/Math/Numbers/Color4.js +9 -9
- package/src/standard/Math/Numbers/Complex.js +13 -17
- package/src/standard/Math/Numbers/Matrix2.js +20 -13
- package/src/standard/Math/Numbers/Matrix3.js +129 -205
- package/src/standard/Math/Numbers/Matrix4.js +136 -257
- package/src/standard/Math/Numbers/Quaternion.js +49 -138
- package/src/standard/Math/Numbers/Rotation4.js +42 -55
- package/src/standard/Math/Numbers/Vector2.js +32 -115
- package/src/standard/Math/Numbers/Vector3.js +46 -151
- package/src/standard/Math/Numbers/Vector4.js +44 -163
- package/src/standard/Math/Utility/BVH.js +21 -20
- package/src/standard/Math/Utility/MatrixStack.js +4 -4
- package/src/standard/Networking/BinaryTransport.js +8 -8
- package/src/standard/Time/MicroTime.js +81 -0
- package/src/standard/Utility/DataStorage.js +11 -14
- package/src/standard/Utility/MapUtilities.js +69 -0
- package/src/standard/Utility/ObjectCache.js +2 -3
- package/src/standard/Utility/Shuffle.js +5 -6
- package/src/tests.js +84 -5
- package/src/x_ite/Base/Events.js +9 -10
- package/src/x_ite/Base/X3DChildObject.js +20 -16
- package/src/x_ite/Base/X3DEventObject.js +3 -7
- package/src/x_ite/Base/X3DObject.js +44 -27
- package/src/x_ite/Basic/FieldDefinitionArray.js +11 -4
- package/src/x_ite/Basic/X3DBaseNode.js +427 -246
- package/src/x_ite/Basic/X3DField.js +48 -69
- package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
- package/src/x_ite/Basic/X3DObjectArrayField.js +102 -108
- package/src/x_ite/Basic/X3DTypedArrayField.js +194 -163
- package/src/x_ite/Bits/TraverseType.js +2 -5
- package/src/x_ite/Bits/X3DConstants.js +11 -2
- package/src/x_ite/Browser/Core/BrowserOptions.js +89 -68
- package/src/x_ite/Browser/Core/BrowserTimings.js +21 -29
- package/src/x_ite/Browser/Core/ContextMenu.js +139 -60
- package/src/x_ite/Browser/Core/Notification.js +3 -3
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
- package/src/x_ite/Browser/Core/Shading.js +3 -7
- package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
- package/src/x_ite/Browser/Core/X3DCoreContext.js +398 -58
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -28
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +5 -14
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +81 -28
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +53 -44
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +8 -9
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +98 -0
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +14 -206
- package/src/x_ite/Browser/Layout/ScreenText.js +226 -254
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +13 -11
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +15 -9
- package/src/x_ite/Browser/NURBS/NURBS.js +84 -72
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +125 -83
- package/src/x_ite/Browser/Navigation/FlyViewer.js +14 -9
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +60 -40
- package/src/x_ite/Browser/Navigation/NoneViewer.js +12 -1
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +39 -20
- package/src/x_ite/Browser/Navigation/WalkViewer.js +21 -6
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +110 -85
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +11 -6
- package/src/x_ite/Browser/Navigation/X3DViewer.js +73 -48
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -24
- package/src/x_ite/Browser/Networking/urls.js +31 -16
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +5 -6
- package/src/x_ite/Browser/Picking/IntersectionType.js +63 -0
- package/src/x_ite/Browser/Picking/MatchCriterion.js +64 -0
- package/src/x_ite/Browser/Picking/SortOrder.js +65 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +197 -0
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +130 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +26 -20
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -10
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +38 -27
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
- package/src/x_ite/Browser/Shaders/Shader.js +112 -92
- package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +92 -77
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +134 -74
- package/src/x_ite/Browser/Shape/AlphaMode.js +65 -0
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +108 -4
- package/src/x_ite/Browser/Text/PolygonText.js +153 -170
- package/src/x_ite/Browser/Text/TextAlignment.js +3 -7
- package/src/x_ite/Browser/Text/X3DTextContext.js +38 -30
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +49 -74
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +64 -0
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +81 -0
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +65 -0
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +73 -0
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +147 -45
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1126 -0
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +686 -0
- package/src/x_ite/Browser/Time/X3DTimeContext.js +20 -17
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +120 -0
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +28 -0
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +114 -0
- package/src/x_ite/Browser/X3DBrowser.js +282 -224
- package/src/x_ite/Browser/X3DBrowserContext.js +60 -27
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +108 -0
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +101 -0
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +112 -0
- package/src/x_ite/Components/Annotation/IconAnnotation.js +110 -0
- package/src/x_ite/Components/Annotation/TextAnnotation.js +102 -0
- package/src/x_ite/Components/Annotation/URLAnnotation.js +101 -0
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +76 -0
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +4 -4
- package/src/x_ite/Components/CADGeometry/CADFace.js +135 -30
- package/src/x_ite/Components/CADGeometry/CADLayer.js +3 -18
- package/src/x_ite/Components/CADGeometry/CADPart.js +4 -8
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +18 -10
- package/src/x_ite/Components/Core/WorldInfo.js +16 -6
- package/src/x_ite/Components/Core/X3DBindableNode.js +4 -33
- package/src/x_ite/Components/Core/X3DChildNode.js +14 -1
- package/src/x_ite/Components/Core/X3DNode.js +0 -63
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +128 -168
- package/src/x_ite/Components/Core.js +6 -9
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +38 -46
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +31 -30
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +42 -57
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +36 -48
- package/src/x_ite/Components/DIS/EspduTransform.js +12 -6
- package/src/x_ite/Components/DIS/ReceiverPdu.js +12 -6
- package/src/x_ite/Components/DIS/SignalPdu.js +12 -6
- package/src/x_ite/Components/DIS/TransmitterPdu.js +12 -6
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +5 -16
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +55 -3
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +3 -5
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +116 -116
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +5 -6
- package/src/x_ite/Components/EnvironmentalEffects.js +6 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +116 -117
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +169 -49
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +31 -27
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +12 -5
- package/src/x_ite/Components/EnvironmentalSensor.js +6 -9
- package/src/x_ite/Components/Followers/ColorChaser.js +1 -3
- package/src/x_ite/Components/Followers/ColorDamper.js +1 -3
- package/src/x_ite/Components/Followers/CoordinateChaser.js +1 -7
- package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -6
- package/src/x_ite/Components/Followers/OrientationChaser.js +7 -3
- package/src/x_ite/Components/Followers/OrientationDamper.js +7 -3
- package/src/x_ite/Components/Followers/PositionChaser.js +1 -3
- package/src/x_ite/Components/Followers/PositionChaser2D.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper2D.js +1 -3
- package/src/x_ite/Components/Followers/ScalarChaser.js +1 -3
- package/src/x_ite/Components/Followers/ScalarDamper.js +1 -3
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +1 -7
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +1 -7
- package/src/x_ite/Components/Followers/X3DChaserNode.js +20 -18
- package/src/x_ite/Components/Followers/X3DDamperNode.js +5 -7
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +5 -7
- package/src/x_ite/Components/Followers.js +6 -9
- package/src/x_ite/Components/Geometry2D/Arc2D.js +10 -14
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +87 -86
- package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -3
- package/src/x_ite/Components/Geometry2D/Disk2D.js +43 -58
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +4 -8
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +3 -5
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +20 -16
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -3
- package/src/x_ite/Components/Geometry3D/Cylinder.js +3 -5
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +35 -17
- package/src/x_ite/Components/Geometry3D/Extrusion.js +125 -107
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +164 -142
- package/src/x_ite/Components/Geometry3D/Sphere.js +3 -5
- package/src/x_ite/Components/Geometry3D.js +6 -9
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
- package/src/x_ite/Components/Geospatial/GeoLOD.js +207 -124
- package/src/x_ite/Components/Geospatial/GeoLocation.js +6 -6
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +5 -3
- package/src/x_ite/Components/Geospatial/GeoTransform.js +9 -9
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +27 -27
- package/src/x_ite/Components/Grouping/Group.js +3 -3
- package/src/x_ite/Components/Grouping/StaticGroup.js +49 -56
- package/src/x_ite/Components/Grouping/Switch.js +171 -21
- package/src/x_ite/Components/Grouping/Transform.js +3 -3
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +68 -15
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +339 -180
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +51 -25
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +2 -4
- package/src/x_ite/Components/Grouping.js +6 -9
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +4 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimHumanoid.js +24 -14
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +44 -20
- package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +6 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +4 -4
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +8 -7
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +4 -3
- package/src/x_ite/Components/Interpolation.js +6 -9
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +1 -3
- package/src/x_ite/Components/Layering/Layer.js +12 -2
- package/src/x_ite/Components/Layering/LayerSet.js +4 -6
- package/src/x_ite/Components/Layering/Viewport.js +8 -8
- package/src/x_ite/Components/Layering/X3DLayerNode.js +67 -62
- package/src/x_ite/Components/Layering.js +6 -9
- package/src/x_ite/Components/Layout/LayoutGroup.js +18 -15
- package/src/x_ite/Components/Layout/LayoutLayer.js +10 -5
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +12 -14
- package/src/x_ite/Components/Layout/ScreenGroup.js +25 -31
- package/src/x_ite/Components/Lighting/DirectionalLight.js +27 -22
- package/src/x_ite/Components/Lighting/PointLight.js +26 -29
- package/src/x_ite/Components/Lighting/SpotLight.js +29 -24
- package/src/x_ite/Components/Lighting/X3DLightNode.js +85 -66
- package/src/x_ite/Components/Lighting.js +6 -9
- package/src/x_ite/Components/NURBS/Contour2D.js +45 -1
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +53 -25
- package/src/x_ite/Components/NURBS/NurbsCurve.js +21 -24
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +44 -25
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +19 -21
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +18 -20
- package/src/x_ite/Components/NURBS/NurbsSet.js +17 -6
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +15 -16
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +38 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +116 -43
- package/src/x_ite/Components/Navigation/Billboard.js +12 -11
- package/src/x_ite/Components/Navigation/Collision.js +10 -8
- package/src/x_ite/Components/Navigation/LOD.js +207 -59
- package/src/x_ite/Components/Navigation/NavigationInfo.js +29 -43
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +99 -18
- package/src/x_ite/Components/Navigation/Viewpoint.js +15 -15
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +12 -5
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +137 -148
- package/src/x_ite/Components/Navigation.js +6 -9
- package/src/x_ite/Components/Networking/Anchor.js +22 -24
- package/src/x_ite/Components/Networking/Inline.js +63 -44
- package/src/x_ite/Components/Networking/X3DUrlObject.js +88 -8
- package/src/x_ite/Components/Networking.js +6 -9
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +2 -2
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +215 -199
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +44 -39
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +48 -46
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +121 -117
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +21 -18
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +20 -22
- package/src/x_ite/Components/Picking/LinePickSensor.js +251 -6
- package/src/x_ite/Components/Picking/PickableGroup.js +120 -7
- package/src/x_ite/Components/Picking/PointPickSensor.js +260 -8
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +174 -4
- package/src/x_ite/Components/Picking/VolumePickSensor.js +150 -4
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +377 -4
- package/src/x_ite/Components/Picking/X3DPickableObject.js +21 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +26 -11
- package/src/x_ite/Components/PointingDeviceSensor.js +6 -9
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +282 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +227 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +217 -0
- package/src/x_ite/Components/Rendering/ClipPlane.js +8 -10
- package/src/x_ite/Components/Rendering/Color.js +22 -13
- package/src/x_ite/Components/Rendering/ColorRGBA.js +28 -16
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +52 -33
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +17 -14
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +9 -4
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +17 -17
- package/src/x_ite/Components/Rendering/LineSet.js +44 -27
- package/src/x_ite/Components/Rendering/Normal.js +20 -4
- package/src/x_ite/Components/Rendering/PointSet.js +38 -16
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +7 -9
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +6 -8
- package/src/x_ite/Components/Rendering/X3DColorNode.js +16 -1
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +80 -55
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +11 -13
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +622 -477
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +159 -90
- package/src/x_ite/Components/Rendering.js +6 -9
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +142 -26
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +312 -128
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +91 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +189 -4
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +82 -4
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +49 -37
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +45 -39
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +41 -34
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +25 -20
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +15 -16
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +2 -4
- package/src/x_ite/Components/Scripting/Script.js +147 -101
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +2 -4
- package/src/x_ite/Components/Shaders/ComposedShader.js +17 -19
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +9 -3
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/PackagedShader.js +18 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +30 -18
- package/src/x_ite/Components/Shaders/ShaderProgram.js +15 -11
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +681 -558
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +48 -12
- package/src/x_ite/Components/Shaders.js +15 -18
- package/src/x_ite/Components/Shape/Appearance.js +153 -77
- package/src/x_ite/Components/Shape/FillProperties.js +63 -4
- package/src/x_ite/Components/Shape/LineProperties.js +27 -5
- package/src/x_ite/Components/Shape/Material.js +48 -62
- package/src/x_ite/Components/Shape/PointProperties.js +162 -0
- package/src/x_ite/Components/Shape/Shape.js +86 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +53 -59
- package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +9 -6
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +16 -3
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
- package/src/x_ite/Components/Shape/X3DShapeNode.js +41 -17
- package/src/x_ite/Components/Shape.js +22 -16
- package/src/x_ite/Components/Sound/AudioClip.js +36 -50
- package/src/x_ite/Components/Sound/Sound.js +36 -36
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +18 -6
- package/src/x_ite/Components/Sound.js +6 -9
- package/src/x_ite/Components/Text/FontStyle.js +10 -12
- package/src/x_ite/Components/Text/Text.js +6 -6
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +56 -87
- package/src/x_ite/Components/Text.js +6 -9
- package/src/x_ite/Components/Texturing/ImageTexture.js +48 -63
- package/src/x_ite/Components/Texturing/MovieTexture.js +42 -56
- package/src/x_ite/Components/Texturing/MultiTexture.js +236 -11
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +73 -6
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +45 -4
- package/src/x_ite/Components/Texturing/PixelTexture.js +45 -11
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +32 -17
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +68 -8
- package/src/x_ite/Components/Texturing/TextureProperties.js +96 -65
- package/src/x_ite/Components/Texturing/TextureTransform.js +55 -47
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +91 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +183 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +77 -0
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +42 -95
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +3 -17
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +6 -67
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +4 -11
- package/src/x_ite/Components/Texturing.js +31 -25
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +88 -4
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +105 -13
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +124 -4
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +41 -31
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +18 -11
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -6
- package/src/x_ite/Components/Time/TimeSensor.js +23 -19
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +11 -7
- package/src/x_ite/Components/Time.js +6 -9
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +309 -8
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +58 -4
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +217 -6
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +132 -3
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +86 -5
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +309 -11
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +85 -3
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +134 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +222 -9
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +191 -8
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +85 -6
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +95 -5
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +153 -8
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -3
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +62 -0
- package/src/x_ite/Components/X_ITE/BlendMode.js +51 -51
- package/src/x_ite/Components.js +11 -16
- package/src/x_ite/Configuration/ComponentInfo.js +12 -6
- package/src/x_ite/Configuration/ComponentInfoArray.js +4 -7
- package/src/x_ite/Configuration/ProfileInfo.js +10 -6
- package/src/x_ite/Configuration/SupportedComponents.js +66 -40
- package/src/x_ite/Configuration/SupportedNodes.js +22 -6
- package/src/x_ite/Configuration/SupportedProfiles.js +91 -89
- package/src/x_ite/Configuration/UnitInfo.js +12 -2
- package/src/x_ite/Configuration/X3DInfoArray.js +37 -18
- package/src/x_ite/Execution/BindableList.js +63 -38
- package/src/x_ite/Execution/BindableStack.js +63 -71
- package/src/x_ite/Execution/ExportedNode.js +25 -2
- package/src/x_ite/Execution/ImportedNode.js +122 -39
- package/src/x_ite/Execution/Scene.js +22 -14
- package/src/x_ite/Execution/World.js +22 -19
- package/src/x_ite/Execution/X3DExecutionContext.js +381 -221
- package/src/x_ite/Execution/X3DScene.js +213 -53
- package/src/x_ite/{Error.js → Fallback.js} +26 -29
- package/src/x_ite/Fields/ArrayFields.js +176 -57
- package/src/x_ite/Fields/SFBool.js +6 -5
- package/src/x_ite/Fields/SFColor.js +24 -21
- package/src/x_ite/Fields/SFColorRGBA.js +23 -23
- package/src/x_ite/Fields/SFDouble.js +6 -5
- package/src/x_ite/Fields/SFFloat.js +7 -6
- package/src/x_ite/Fields/SFImage.js +37 -36
- package/src/x_ite/Fields/SFInt32.js +5 -4
- package/src/x_ite/Fields/SFMatrix3.js +19 -15
- package/src/x_ite/Fields/SFMatrix4.js +19 -15
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +10 -2
- package/src/x_ite/Fields/SFNode.js +105 -53
- package/src/x_ite/Fields/SFNodeCache.js +93 -0
- package/src/x_ite/Fields/SFRotation.js +31 -27
- package/src/x_ite/Fields/SFString.js +9 -8
- package/src/x_ite/Fields/SFTime.js +6 -5
- package/src/x_ite/Fields/SFVec2.js +17 -13
- package/src/x_ite/Fields/SFVec3.js +21 -17
- package/src/x_ite/Fields/SFVec4.js +24 -20
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +8 -4
- package/src/x_ite/Fields.js +2 -6
- package/src/x_ite/InputOutput/FileLoader.js +174 -190
- package/src/x_ite/InputOutput/Generator.js +133 -104
- package/src/x_ite/Parser/HTMLSupport.js +3 -596
- package/src/x_ite/Parser/JSONParser.js +348 -245
- package/src/x_ite/Parser/Parser.js +314 -303
- package/src/x_ite/Parser/X3DParser.js +41 -20
- package/src/x_ite/Parser/XMLParser.js +178 -60
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +104 -44
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +111 -42
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -14
- package/src/x_ite/Rendering/DependentRenderer.js +7 -9
- package/src/x_ite/Rendering/TextureBuffer.js +24 -19
- package/src/x_ite/Rendering/X3DRenderObject.js +455 -428
- package/src/x_ite/Routing/RouteArray.js +34 -11
- package/src/x_ite/Routing/X3DRoute.js +60 -60
- package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
- package/src/x_ite/X3D.js +30 -37
- package/src/x_ite.config.js +40 -5
- package/src/x_ite.css +165 -45
- package/src/x_ite.html +49 -29
- package/src/x_ite.js +86 -25
- package/x_ite.min.html +49 -22
- package/.bzrignore +0 -3
- package/AUTHORS.md +0 -6
- package/STYLE_GUIDE.md +0 -51
- package/X_ITE.sln +0 -54
- package/X_ITE.userprefs +0 -14
- package/build/build.mdproj +0 -47
- package/build/cad-geometry.build.js +0 -15
- package/build/geospatial.build.js +0 -15
- package/build/h-anim.build.js +0 -15
- package/build/nurbs.build.js +0 -15
- package/build/particle-systems.build.js +0 -15
- package/build/parts/cad-geometry.end.frag +0 -2
- package/build/parts/cad-geometry.start.frag +0 -6
- package/build/parts/geospatial.end.frag +0 -2
- package/build/parts/geospatial.start.frag +0 -6
- package/build/parts/h-anim.end.frag +0 -2
- package/build/parts/h-anim.start.frag +0 -6
- package/build/parts/nurbs.end.frag +0 -2
- package/build/parts/nurbs.start.frag +0 -6
- package/build/parts/particle-systems.end.frag +0 -2
- package/build/parts/particle-systems.start.frag +0 -6
- package/build/parts/rigid-body-physics.end.frag +0 -2
- package/build/parts/rigid-body-physics.start.frag +0 -6
- package/build/parts/texturing-3d.end.frag +0 -2
- package/build/parts/texturing-3d.start.frag +0 -6
- package/build/parts/x_ite.end.frag +0 -9
- package/build/parts/x_ite.start.frag +0 -6
- package/build/rigid-body-physics.build.js +0 -15
- package/build/texturing-3d.build.js +0 -15
- package/dist/components/README +0 -3
- package/dist/components/cad-geometry.min.js +0 -1
- package/dist/components/geospatial.min.js +0 -2
- package/dist/components/h-anim.min.js +0 -1
- package/dist/components/nurbs.min.js +0 -2
- package/dist/components/particle-systems.min.js +0 -2
- package/dist/components/rigid-body-physics.js +0 -3761
- package/dist/components/rigid-body-physics.min.js +0 -56
- package/dist/components/texturing-3d.min.js +0 -1
- package/dist/dist.mdproj +0 -61
- package/dist/images/logo.128.png +0 -0
- package/fonts/fonts.mdproj +0 -29
- package/meta/meta.mdproj +0 -35
- package/src/components/cad-geometry.config.js +0 -56
- package/src/components/geospatial.config.js +0 -56
- package/src/components/h-anim.config.js +0 -56
- package/src/components/nurbs.config.js +0 -61
- package/src/components/particle-systems.config.js +0 -56
- package/src/components/rigid-body-physics.config.js +0 -61
- package/src/components/texturing-3d.config.js +0 -56
- package/src/images/logo.128.png +0 -0
- package/src/locale/de.mo +0 -0
- package/src/locale/fr.mo +0 -0
- package/src/src.mdproj +0 -698
- package/src/standard/Networking/URI.js +0 -785
- package/src/test.x3d +0 -225
- package/src/x_ite/Browser/Shaders/Background.fs +0 -31
- package/src/x_ite/Browser/Shaders/Background.vs +0 -23
- package/src/x_ite/Browser/Shaders/Depth.fs +0 -32
- package/src/x_ite/Browser/Shaders/Depth.vs +0 -21
- package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -135
- package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -145
- package/src/x_ite/Browser/Shaders/Phong.fs +0 -269
- package/src/x_ite/Browser/Shaders/Phong.vs +0 -47
- package/src/x_ite/Browser/Shaders/PointSet.fs +0 -86
- package/src/x_ite/Browser/Shaders/Types.h +0 -55
- package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -82
- package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -61
- package/src/x_ite/Components/DIS.js +0 -91
- package/src/x_ite/Components/Picking.js +0 -94
- package/src/x_ite/Components/VolumeRendering.js +0 -121
|
@@ -0,0 +1,2491 @@
|
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
12
|
+
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
16
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
17
|
+
*******************************************************************************
|
|
18
|
+
*
|
|
19
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
20
|
+
*
|
|
21
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
22
|
+
*
|
|
23
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
24
|
+
*
|
|
25
|
+
* The copyright notice above does not evidence any actual of intended
|
|
26
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
27
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
28
|
+
* create3000.
|
|
29
|
+
*
|
|
30
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
31
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
32
|
+
* permission of create3000.
|
|
33
|
+
*
|
|
34
|
+
* NON-MILITARY USE ONLY
|
|
35
|
+
*
|
|
36
|
+
* All create3000 software are effectively free software with a non-military use
|
|
37
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
38
|
+
* source in any way you please with the exception anything that uses it must be
|
|
39
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
40
|
+
*
|
|
41
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
42
|
+
*
|
|
43
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
44
|
+
*
|
|
45
|
+
* This file is part of the X_ITE Project.
|
|
46
|
+
*
|
|
47
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
48
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
49
|
+
* Free Software Foundation.
|
|
50
|
+
*
|
|
51
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
52
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
53
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
54
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
55
|
+
*
|
|
56
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
57
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
58
|
+
* copy of the GPLv3 License.
|
|
59
|
+
*
|
|
60
|
+
* For Silvio, Joy and Adi.
|
|
61
|
+
*
|
|
62
|
+
******************************************************************************/
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
define ('x_ite/Browser/Picking/MatchCriterion',[],function ()
|
|
66
|
+
{
|
|
67
|
+
"use strict";
|
|
68
|
+
|
|
69
|
+
var i = 0;
|
|
70
|
+
|
|
71
|
+
var MatchCriterion =
|
|
72
|
+
{
|
|
73
|
+
MATCH_ANY: i ++,
|
|
74
|
+
MATCH_EVERY: i ++,
|
|
75
|
+
MATCH_ONLY_ONE: i ++,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return MatchCriterion;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
82
|
+
*******************************************************************************
|
|
83
|
+
*
|
|
84
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
85
|
+
*
|
|
86
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
87
|
+
*
|
|
88
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
89
|
+
*
|
|
90
|
+
* The copyright notice above does not evidence any actual of intended
|
|
91
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
92
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
93
|
+
* create3000.
|
|
94
|
+
*
|
|
95
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
96
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
97
|
+
* permission of create3000.
|
|
98
|
+
*
|
|
99
|
+
* NON-MILITARY USE ONLY
|
|
100
|
+
*
|
|
101
|
+
* All create3000 software are effectively free software with a non-military use
|
|
102
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
103
|
+
* source in any way you please with the exception anything that uses it must be
|
|
104
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
105
|
+
*
|
|
106
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
107
|
+
*
|
|
108
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
109
|
+
*
|
|
110
|
+
* This file is part of the X_ITE Project.
|
|
111
|
+
*
|
|
112
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
113
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
114
|
+
* Free Software Foundation.
|
|
115
|
+
*
|
|
116
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
117
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
118
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
119
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
120
|
+
*
|
|
121
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
122
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
123
|
+
* copy of the GPLv3 License.
|
|
124
|
+
*
|
|
125
|
+
* For Silvio, Joy and Adi.
|
|
126
|
+
*
|
|
127
|
+
******************************************************************************/
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
define ('x_ite/Browser/Picking/IntersectionType',[],function ()
|
|
131
|
+
{
|
|
132
|
+
"use strict";
|
|
133
|
+
|
|
134
|
+
var i = 0;
|
|
135
|
+
|
|
136
|
+
var IntersectionType =
|
|
137
|
+
{
|
|
138
|
+
BOUNDS: i ++,
|
|
139
|
+
GEOMETRY: i ++,
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
return IntersectionType;
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
146
|
+
*******************************************************************************
|
|
147
|
+
*
|
|
148
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
149
|
+
*
|
|
150
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
151
|
+
*
|
|
152
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
153
|
+
*
|
|
154
|
+
* The copyright notice above does not evidence any actual of intended
|
|
155
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
156
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
157
|
+
* create3000.
|
|
158
|
+
*
|
|
159
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
160
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
161
|
+
* permission of create3000.
|
|
162
|
+
*
|
|
163
|
+
* NON-MILITARY USE ONLY
|
|
164
|
+
*
|
|
165
|
+
* All create3000 software are effectively free software with a non-military use
|
|
166
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
167
|
+
* source in any way you please with the exception anything that uses it must be
|
|
168
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
169
|
+
*
|
|
170
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
171
|
+
*
|
|
172
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
173
|
+
*
|
|
174
|
+
* This file is part of the X_ITE Project.
|
|
175
|
+
*
|
|
176
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
177
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
178
|
+
* Free Software Foundation.
|
|
179
|
+
*
|
|
180
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
181
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
182
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
183
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
184
|
+
*
|
|
185
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
186
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
187
|
+
* copy of the GPLv3 License.
|
|
188
|
+
*
|
|
189
|
+
* For Silvio, Joy and Adi.
|
|
190
|
+
*
|
|
191
|
+
******************************************************************************/
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
define ('x_ite/Browser/Picking/SortOrder',[],function ()
|
|
195
|
+
{
|
|
196
|
+
"use strict";
|
|
197
|
+
|
|
198
|
+
var i = 0;
|
|
199
|
+
|
|
200
|
+
var SortOrder =
|
|
201
|
+
{
|
|
202
|
+
ANY: i ++,
|
|
203
|
+
CLOSEST: i ++,
|
|
204
|
+
ALL: i ++,
|
|
205
|
+
ALL_SORTED: i ++,
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
return SortOrder;
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
212
|
+
*******************************************************************************
|
|
213
|
+
*
|
|
214
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
215
|
+
*
|
|
216
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
217
|
+
*
|
|
218
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
219
|
+
*
|
|
220
|
+
* The copyright notice above does not evidence any actual of intended
|
|
221
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
222
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
223
|
+
* create3000.
|
|
224
|
+
*
|
|
225
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
226
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
227
|
+
* permission of create3000.
|
|
228
|
+
*
|
|
229
|
+
* NON-MILITARY USE ONLY
|
|
230
|
+
*
|
|
231
|
+
* All create3000 software are effectively free software with a non-military use
|
|
232
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
233
|
+
* source in any way you please with the exception anything that uses it must be
|
|
234
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
235
|
+
*
|
|
236
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
237
|
+
*
|
|
238
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
239
|
+
*
|
|
240
|
+
* This file is part of the X_ITE Project.
|
|
241
|
+
*
|
|
242
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
243
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
244
|
+
* Free Software Foundation.
|
|
245
|
+
*
|
|
246
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
247
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
248
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
249
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
250
|
+
*
|
|
251
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
252
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
253
|
+
* copy of the GPLv3 License.
|
|
254
|
+
*
|
|
255
|
+
* For Silvio, Joy and Adi.
|
|
256
|
+
*
|
|
257
|
+
******************************************************************************/
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
define ('x_ite/Components/Picking/X3DPickSensorNode',[
|
|
261
|
+
"x_ite/Fields",
|
|
262
|
+
"x_ite/Components/Core/X3DSensorNode",
|
|
263
|
+
"x_ite/Bits/TraverseType",
|
|
264
|
+
"x_ite/Bits/X3DConstants",
|
|
265
|
+
"x_ite/Browser/Picking/MatchCriterion",
|
|
266
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
267
|
+
"x_ite/Browser/Picking/SortOrder",
|
|
268
|
+
"standard/Math/Numbers/Matrix4",
|
|
269
|
+
"standard/Math/Algorithms/QuickSort",
|
|
270
|
+
"standard/Utility/ObjectCache",
|
|
271
|
+
],
|
|
272
|
+
function (Fields,
|
|
273
|
+
X3DSensorNode,
|
|
274
|
+
TraverseType,
|
|
275
|
+
X3DConstants,
|
|
276
|
+
MatchCriterion,
|
|
277
|
+
IntersectionType,
|
|
278
|
+
SortOrder,
|
|
279
|
+
Matrix4,
|
|
280
|
+
QuickSort,
|
|
281
|
+
ObjectCache)
|
|
282
|
+
{
|
|
283
|
+
"use strict";
|
|
284
|
+
|
|
285
|
+
var ModelMatrixCache = ObjectCache (Matrix4);
|
|
286
|
+
|
|
287
|
+
function compareDistance (lhs, rhs) { return lhs .distance < rhs .distance; }
|
|
288
|
+
|
|
289
|
+
function X3DPickSensorNode (executionContext)
|
|
290
|
+
{
|
|
291
|
+
X3DSensorNode .call (this, executionContext);
|
|
292
|
+
|
|
293
|
+
this .addType (X3DConstants .X3DPickSensorNode);
|
|
294
|
+
|
|
295
|
+
this .objectType = new Set ();
|
|
296
|
+
this .intersectionType = IntersectionType .BOUNDS;
|
|
297
|
+
this .sortOrder = SortOrder .CLOSEST;
|
|
298
|
+
this .pickTargetNodes = new Set ();
|
|
299
|
+
this .modelMatrices = [ ];
|
|
300
|
+
this .targets = [ ];
|
|
301
|
+
this .targets .size = 0;
|
|
302
|
+
this .pickedTargets = [ ];
|
|
303
|
+
this .pickedTargetsSorter = new QuickSort (this .pickedTargets, compareDistance);
|
|
304
|
+
this .pickedGeometries = new Fields .MFNode (); // Must be unique for each X3DPickSensorNode.
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
X3DPickSensorNode .prototype = Object .assign (Object .create (X3DSensorNode .prototype),
|
|
308
|
+
{
|
|
309
|
+
constructor: X3DPickSensorNode,
|
|
310
|
+
initialize: function ()
|
|
311
|
+
{
|
|
312
|
+
this .isLive () .addInterest ("set_live__", this);
|
|
313
|
+
|
|
314
|
+
this .enabled_ .addInterest ("set_live__", this);
|
|
315
|
+
this .objectType_ .addInterest ("set_objectType__", this);
|
|
316
|
+
this .matchCriterion_ .addInterest ("set_matchCriterion__", this);
|
|
317
|
+
this .intersectionType_ .addInterest ("set_intersectionType__", this);
|
|
318
|
+
this .sortOrder_ .addInterest ("set_sortOrder__", this);
|
|
319
|
+
this .pickTarget_ .addInterest ("set_pickTarget__", this);
|
|
320
|
+
|
|
321
|
+
this .set_objectType__ ();
|
|
322
|
+
this .set_matchCriterion__ ();
|
|
323
|
+
this .set_intersectionType__ ();
|
|
324
|
+
this .set_sortOrder__ ();
|
|
325
|
+
this .set_pickTarget__ ();
|
|
326
|
+
},
|
|
327
|
+
getObjectType: function ()
|
|
328
|
+
{
|
|
329
|
+
return this .objectType;
|
|
330
|
+
},
|
|
331
|
+
getMatchCriterion: function ()
|
|
332
|
+
{
|
|
333
|
+
return this .matchCriterion;
|
|
334
|
+
},
|
|
335
|
+
getIntersectionType: function ()
|
|
336
|
+
{
|
|
337
|
+
return this .intersectionType;
|
|
338
|
+
},
|
|
339
|
+
getSortOrder: function ()
|
|
340
|
+
{
|
|
341
|
+
return this .sortOrder;
|
|
342
|
+
},
|
|
343
|
+
getModelMatrices: function ()
|
|
344
|
+
{
|
|
345
|
+
return this .modelMatrices;
|
|
346
|
+
},
|
|
347
|
+
getTargets: function ()
|
|
348
|
+
{
|
|
349
|
+
return this .targets;
|
|
350
|
+
},
|
|
351
|
+
getPickShape: (function ()
|
|
352
|
+
{
|
|
353
|
+
var pickShapes = new WeakMap ();
|
|
354
|
+
|
|
355
|
+
return function (geometryNode)
|
|
356
|
+
{
|
|
357
|
+
var pickShape = pickShapes .get (geometryNode);
|
|
358
|
+
|
|
359
|
+
if (pickShape !== undefined)
|
|
360
|
+
return pickShape;
|
|
361
|
+
|
|
362
|
+
var
|
|
363
|
+
shapeNode = this .getExecutionContext () .createNode ("Shape", false),
|
|
364
|
+
collidableShapeNode = this .getExecutionContext () .createNode ("CollidableShape", false);
|
|
365
|
+
|
|
366
|
+
shapeNode .setPrivate (true);
|
|
367
|
+
collidableShapeNode .setPrivate (true);
|
|
368
|
+
collidableShapeNode .setConvex (true);
|
|
369
|
+
|
|
370
|
+
shapeNode .geometry_ = geometryNode;
|
|
371
|
+
collidableShapeNode .shape_ = shapeNode;
|
|
372
|
+
|
|
373
|
+
shapeNode .setup ();
|
|
374
|
+
collidableShapeNode .setup ();
|
|
375
|
+
|
|
376
|
+
pickShapes .set (geometryNode, collidableShapeNode);
|
|
377
|
+
|
|
378
|
+
return collidableShapeNode;
|
|
379
|
+
};
|
|
380
|
+
})(),
|
|
381
|
+
getPickedGeometries: (function ()
|
|
382
|
+
{
|
|
383
|
+
return function ()
|
|
384
|
+
{
|
|
385
|
+
var
|
|
386
|
+
targets = this .targets,
|
|
387
|
+
numTargets = targets .size,
|
|
388
|
+
pickedTargets = this .pickedTargets,
|
|
389
|
+
pickedGeometries = this .pickedGeometries;
|
|
390
|
+
|
|
391
|
+
// Filter intersecting targets.
|
|
392
|
+
|
|
393
|
+
pickedTargets .length = 0;
|
|
394
|
+
|
|
395
|
+
for (var i = 0; i < numTargets; ++ i)
|
|
396
|
+
{
|
|
397
|
+
var target = targets [i];
|
|
398
|
+
|
|
399
|
+
if (target .intersected)
|
|
400
|
+
pickedTargets .push (target);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// No pickedTargets, return.
|
|
404
|
+
|
|
405
|
+
if (pickedTargets .length === 0)
|
|
406
|
+
{
|
|
407
|
+
pickedGeometries .length = 0;
|
|
408
|
+
|
|
409
|
+
return pickedGeometries;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// Return sorted pickedTargets.
|
|
413
|
+
|
|
414
|
+
switch (this .sortOrder)
|
|
415
|
+
{
|
|
416
|
+
case SortOrder .ANY:
|
|
417
|
+
{
|
|
418
|
+
pickedTargets .length = 1;
|
|
419
|
+
pickedGeometries [0] = this .getPickedGeometry (pickedTargets [0]);
|
|
420
|
+
pickedGeometries .length = 1;
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
423
|
+
case SortOrder .CLOSEST:
|
|
424
|
+
{
|
|
425
|
+
this .pickedTargetsSorter .sort (0, pickedTargets .length);
|
|
426
|
+
|
|
427
|
+
pickedTargets .length = 1;
|
|
428
|
+
pickedGeometries [0] = this .getPickedGeometry (pickedTargets [0]);
|
|
429
|
+
pickedGeometries .length = 1;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
case SortOrder .ALL:
|
|
433
|
+
{
|
|
434
|
+
for (var i = 0, length = pickedTargets .length; i < length; ++ i)
|
|
435
|
+
pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
|
|
436
|
+
|
|
437
|
+
pickedGeometries .length = length;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
case SortOrder .ALL_SORTED:
|
|
441
|
+
{
|
|
442
|
+
this .pickedTargetsSorter .sort (0, pickedTargets .length);
|
|
443
|
+
|
|
444
|
+
for (var i = 0, length = pickedTargets .length; i < length; ++ i)
|
|
445
|
+
pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
|
|
446
|
+
|
|
447
|
+
pickedGeometries .length = length;
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
return pickedGeometries;
|
|
453
|
+
};
|
|
454
|
+
})(),
|
|
455
|
+
getPickedGeometry: function (target)
|
|
456
|
+
{
|
|
457
|
+
var
|
|
458
|
+
executionContext = this .getExecutionContext (),
|
|
459
|
+
geometryNode = target .geometryNode;
|
|
460
|
+
|
|
461
|
+
if (geometryNode .getExecutionContext () === executionContext)
|
|
462
|
+
return geometryNode;
|
|
463
|
+
|
|
464
|
+
var instance = geometryNode .getExecutionContext ();
|
|
465
|
+
|
|
466
|
+
if (instance .getType () .indexOf (X3DConstants .X3DPrototypeInstance) !== -1 && instance .getExecutionContext () === executionContext)
|
|
467
|
+
return instance;
|
|
468
|
+
|
|
469
|
+
var pickingHierarchy = target .pickingHierarchy;
|
|
470
|
+
|
|
471
|
+
for (var i = pickingHierarchy .length - 1; i >= 0; -- i)
|
|
472
|
+
{
|
|
473
|
+
var node = pickingHierarchy [i];
|
|
474
|
+
|
|
475
|
+
if (node .getExecutionContext () === executionContext)
|
|
476
|
+
return node;
|
|
477
|
+
|
|
478
|
+
var instance = node .getExecutionContext ();
|
|
479
|
+
|
|
480
|
+
if (instance .getType () .indexOf (X3DConstants .X3DPrototypeInstance) !== -1 && instance .getExecutionContext () === executionContext)
|
|
481
|
+
return instance;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return null;
|
|
485
|
+
},
|
|
486
|
+
getPickedTargets: function ()
|
|
487
|
+
{
|
|
488
|
+
return this .pickedTargets;
|
|
489
|
+
},
|
|
490
|
+
set_live__: function ()
|
|
491
|
+
{
|
|
492
|
+
if (this .isLive () .getValue () && this .enabled_ .getValue () && ! this .objectType .has ("NONE"))
|
|
493
|
+
{
|
|
494
|
+
this .getBrowser () .addPickSensor (this);
|
|
495
|
+
this .setPickableObject (true);
|
|
496
|
+
}
|
|
497
|
+
else
|
|
498
|
+
{
|
|
499
|
+
this .getBrowser () .removePickSensor (this);
|
|
500
|
+
this .setPickableObject (false);
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
set_objectType__: function ()
|
|
504
|
+
{
|
|
505
|
+
this .objectType .clear ();
|
|
506
|
+
|
|
507
|
+
for (var i = 0, length = this .objectType_ .length; i < length; ++ i)
|
|
508
|
+
{
|
|
509
|
+
this .objectType .add (this .objectType_ [i]);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
this .set_live__ ();
|
|
513
|
+
},
|
|
514
|
+
set_matchCriterion__: (function ()
|
|
515
|
+
{
|
|
516
|
+
var matchCriterions = new Map ([
|
|
517
|
+
["MATCH_ANY", MatchCriterion .MATCH_ANY],
|
|
518
|
+
["MATCH_EVERY", MatchCriterion .MATCH_EVERY],
|
|
519
|
+
["MATCH_ONLY_ONE", MatchCriterion .MATCH_ONLY_ONE],
|
|
520
|
+
]);
|
|
521
|
+
|
|
522
|
+
return function ()
|
|
523
|
+
{
|
|
524
|
+
this .matchCriterion = matchCriterions .get (this .matchCriterion_ .getValue ());
|
|
525
|
+
|
|
526
|
+
if (this .matchCriterion === undefined)
|
|
527
|
+
this .matchCriterion = MatchCriterionType .MATCH_ANY;
|
|
528
|
+
};
|
|
529
|
+
})(),
|
|
530
|
+
set_intersectionType__: (function ()
|
|
531
|
+
{
|
|
532
|
+
var intersectionTypes = new Map ([
|
|
533
|
+
["BOUNDS", IntersectionType .BOUNDS],
|
|
534
|
+
["GEOMETRY", IntersectionType .GEOMETRY],
|
|
535
|
+
]);
|
|
536
|
+
|
|
537
|
+
return function ()
|
|
538
|
+
{
|
|
539
|
+
this .intersectionType = intersectionTypes .get (this .intersectionType_ .getValue ());
|
|
540
|
+
|
|
541
|
+
if (this .intersectionType === undefined)
|
|
542
|
+
this .intersectionType = IntersectionType .BOUNDS;
|
|
543
|
+
};
|
|
544
|
+
})(),
|
|
545
|
+
set_sortOrder__: (function ()
|
|
546
|
+
{
|
|
547
|
+
var sortOrders = new Map ([
|
|
548
|
+
["ANY", SortOrder .ANY],
|
|
549
|
+
["CLOSEST", SortOrder .CLOSEST],
|
|
550
|
+
["ALL", SortOrder .ALL],
|
|
551
|
+
["ALL_SORTED", SortOrder .ALL_SORTED],
|
|
552
|
+
]);
|
|
553
|
+
|
|
554
|
+
return function ()
|
|
555
|
+
{
|
|
556
|
+
this .sortOrder = sortOrders .get (this .sortOrder_ .getValue ());
|
|
557
|
+
|
|
558
|
+
if (this .sortOrder === undefined)
|
|
559
|
+
this .sortOrder = SortOrder .CLOSEST;
|
|
560
|
+
};
|
|
561
|
+
})(),
|
|
562
|
+
set_pickTarget__: function ()
|
|
563
|
+
{
|
|
564
|
+
this .pickTargetNodes .clear ();
|
|
565
|
+
|
|
566
|
+
for (var i = 0, length = this .pickTarget_ .length; i < length; ++ i)
|
|
567
|
+
{
|
|
568
|
+
try
|
|
569
|
+
{
|
|
570
|
+
var
|
|
571
|
+
node = this .pickTarget_ [i] .getValue () .getInnerNode (),
|
|
572
|
+
type = node .getType ();
|
|
573
|
+
|
|
574
|
+
for (var t = type .length - 1; t >= 0; -- t)
|
|
575
|
+
{
|
|
576
|
+
switch (type [t])
|
|
577
|
+
{
|
|
578
|
+
case X3DConstants .Inline:
|
|
579
|
+
case X3DConstants .Shape:
|
|
580
|
+
case X3DConstants .X3DGroupingNode:
|
|
581
|
+
{
|
|
582
|
+
this .pickTargetNodes .add (node);
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
default:
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
catch (error)
|
|
591
|
+
{ }
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
traverse: function (type, renderObject)
|
|
595
|
+
{
|
|
596
|
+
// X3DPickSensorNode nodes are sorted out and only traversed during PICKING, except if is child of a LOD or Switch node.
|
|
597
|
+
|
|
598
|
+
if (type !== TraverseType .PICKING)
|
|
599
|
+
return;
|
|
600
|
+
|
|
601
|
+
if (this .getPickableObject ())
|
|
602
|
+
this .modelMatrices .push (ModelMatrixCache .pop () .assign (renderObject .getModelViewMatrix () .get ()));
|
|
603
|
+
},
|
|
604
|
+
collect: function (geometryNode, modelMatrix, pickingHierarchy)
|
|
605
|
+
{
|
|
606
|
+
var pickTargetNodes = this .pickTargetNodes;
|
|
607
|
+
|
|
608
|
+
var haveTarget = pickingHierarchy .some (function (node)
|
|
609
|
+
{
|
|
610
|
+
return pickTargetNodes .has (node);
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
if (haveTarget)
|
|
614
|
+
{
|
|
615
|
+
var targets = this .targets;
|
|
616
|
+
|
|
617
|
+
if (targets .size < targets .length)
|
|
618
|
+
{
|
|
619
|
+
var target = targets [targets .size];
|
|
620
|
+
}
|
|
621
|
+
else
|
|
622
|
+
{
|
|
623
|
+
var target = { modelMatrix: new Matrix4 (), pickingHierarchy: [ ], pickedPoint: [ ], intersections: [ ] };
|
|
624
|
+
|
|
625
|
+
targets .push (target);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
++ targets .size;
|
|
629
|
+
|
|
630
|
+
target .intersected = false;
|
|
631
|
+
target .geometryNode = geometryNode;
|
|
632
|
+
target .pickedPoint .length = 0;
|
|
633
|
+
target .intersections .length = 0;
|
|
634
|
+
target .modelMatrix .assign (modelMatrix);
|
|
635
|
+
|
|
636
|
+
var destPickingHierarchy = target .pickingHierarchy;
|
|
637
|
+
|
|
638
|
+
for (var i = 0, length = pickingHierarchy .length; i < length; ++ i)
|
|
639
|
+
destPickingHierarchy [i] = pickingHierarchy [i];
|
|
640
|
+
|
|
641
|
+
destPickingHierarchy .length = length;
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
process: function ()
|
|
645
|
+
{
|
|
646
|
+
var modelMatrices = this .modelMatrices;
|
|
647
|
+
|
|
648
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
649
|
+
ModelMatrixCache .push (modelMatrices [m]);
|
|
650
|
+
|
|
651
|
+
this .modelMatrices .length = 0;
|
|
652
|
+
this .targets .size = 0;
|
|
653
|
+
},
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
return X3DPickSensorNode;
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
660
|
+
*******************************************************************************
|
|
661
|
+
*
|
|
662
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
663
|
+
*
|
|
664
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
665
|
+
*
|
|
666
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
667
|
+
*
|
|
668
|
+
* The copyright notice above does not evidence any actual of intended
|
|
669
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
670
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
671
|
+
* create3000.
|
|
672
|
+
*
|
|
673
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
674
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
675
|
+
* permission of create3000.
|
|
676
|
+
*
|
|
677
|
+
* NON-MILITARY USE ONLY
|
|
678
|
+
*
|
|
679
|
+
* All create3000 software are effectively free software with a non-military use
|
|
680
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
681
|
+
* source in any way you please with the exception anything that uses it must be
|
|
682
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
683
|
+
*
|
|
684
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
685
|
+
*
|
|
686
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
687
|
+
*
|
|
688
|
+
* This file is part of the X_ITE Project.
|
|
689
|
+
*
|
|
690
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
691
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
692
|
+
* Free Software Foundation.
|
|
693
|
+
*
|
|
694
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
695
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
696
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
697
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
698
|
+
*
|
|
699
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
700
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
701
|
+
* copy of the GPLv3 License.
|
|
702
|
+
*
|
|
703
|
+
* For Silvio, Joy and Adi.
|
|
704
|
+
*
|
|
705
|
+
******************************************************************************/
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
define ('x_ite/Components/Picking/LinePickSensor',[
|
|
709
|
+
"x_ite/Fields",
|
|
710
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
711
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
712
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
713
|
+
"x_ite/Bits/X3DConstants",
|
|
714
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
715
|
+
"standard/Math/Numbers/Vector3",
|
|
716
|
+
"standard/Math/Numbers/Matrix4",
|
|
717
|
+
"standard/Math/Geometry/Box3",
|
|
718
|
+
"standard/Math/Geometry/Line3",
|
|
719
|
+
],
|
|
720
|
+
function (Fields,
|
|
721
|
+
X3DFieldDefinition,
|
|
722
|
+
FieldDefinitionArray,
|
|
723
|
+
X3DPickSensorNode,
|
|
724
|
+
X3DConstants,
|
|
725
|
+
IntersectionType,
|
|
726
|
+
Vector3,
|
|
727
|
+
Matrix4,
|
|
728
|
+
Box3,
|
|
729
|
+
Line3)
|
|
730
|
+
{
|
|
731
|
+
"use strict";
|
|
732
|
+
|
|
733
|
+
function LinePickSensor (executionContext)
|
|
734
|
+
{
|
|
735
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
736
|
+
|
|
737
|
+
this .addType (X3DConstants .LinePickSensor);
|
|
738
|
+
|
|
739
|
+
this .pickingGeometryNode = null;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
LinePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
743
|
+
{
|
|
744
|
+
constructor: LinePickSensor,
|
|
745
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
746
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
747
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
748
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
749
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
750
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
751
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
752
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
753
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedTextureCoordinate", new Fields .MFVec3f ()),
|
|
754
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedNormal", new Fields .MFVec3f ()),
|
|
755
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedPoint", new Fields .MFVec3f ()),
|
|
756
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
757
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
758
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
759
|
+
]),
|
|
760
|
+
getTypeName: function ()
|
|
761
|
+
{
|
|
762
|
+
return "LinePickSensor";
|
|
763
|
+
},
|
|
764
|
+
getComponentName: function ()
|
|
765
|
+
{
|
|
766
|
+
return "Picking";
|
|
767
|
+
},
|
|
768
|
+
getContainerField: function ()
|
|
769
|
+
{
|
|
770
|
+
return "children";
|
|
771
|
+
},
|
|
772
|
+
initialize: function ()
|
|
773
|
+
{
|
|
774
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
775
|
+
|
|
776
|
+
this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
|
|
777
|
+
|
|
778
|
+
this .set_pickingGeometry__ ();
|
|
779
|
+
},
|
|
780
|
+
set_pickingGeometry__: function ()
|
|
781
|
+
{
|
|
782
|
+
this .pickingGeometryNode = null;
|
|
783
|
+
|
|
784
|
+
try
|
|
785
|
+
{
|
|
786
|
+
var
|
|
787
|
+
node = this .pickingGeometry_ .getValue () .getInnerNode (),
|
|
788
|
+
type = node .getType ();
|
|
789
|
+
|
|
790
|
+
for (var t = type .length - 1; t >= 0; -- t)
|
|
791
|
+
{
|
|
792
|
+
switch (type [t])
|
|
793
|
+
{
|
|
794
|
+
case X3DConstants .IndexedLineSet:
|
|
795
|
+
case X3DConstants .LineSet:
|
|
796
|
+
{
|
|
797
|
+
this .pickingGeometryNode = node;
|
|
798
|
+
break;
|
|
799
|
+
}
|
|
800
|
+
default:
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
catch (error)
|
|
806
|
+
{ }
|
|
807
|
+
},
|
|
808
|
+
process: (function ()
|
|
809
|
+
{
|
|
810
|
+
var
|
|
811
|
+
pickingBBox = new Box3 (),
|
|
812
|
+
targetBBox = new Box3 (),
|
|
813
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
814
|
+
targetCenter = new Vector3 (0, 0, 0),
|
|
815
|
+
matrix = new Matrix4 (),
|
|
816
|
+
point1 = new Vector3 (0, 0, 0),
|
|
817
|
+
point2 = new Vector3 (0, 0, 0),
|
|
818
|
+
line = new Line3 (Vector3 .Zero, Vector3 .zAxis),
|
|
819
|
+
a = new Vector3 (0, 0, 0),
|
|
820
|
+
b = new Vector3 (0, 0, 0),
|
|
821
|
+
clipPlanes = [ ],
|
|
822
|
+
intersections = [ ],
|
|
823
|
+
texCoord = new Vector3 (0, 0, 0),
|
|
824
|
+
pickedTextureCoordinate = new Fields .MFVec3f (),
|
|
825
|
+
pickedNormal = new Fields .MFVec3f (),
|
|
826
|
+
pickedPoint = new Fields .MFVec3f ();
|
|
827
|
+
|
|
828
|
+
return function ()
|
|
829
|
+
{
|
|
830
|
+
if (this .pickingGeometryNode)
|
|
831
|
+
{
|
|
832
|
+
var
|
|
833
|
+
modelMatrices = this .getModelMatrices (),
|
|
834
|
+
targets = this .getTargets ();
|
|
835
|
+
|
|
836
|
+
switch (this .getIntersectionType ())
|
|
837
|
+
{
|
|
838
|
+
case IntersectionType .BOUNDS:
|
|
839
|
+
{
|
|
840
|
+
// Intersect bboxes.
|
|
841
|
+
|
|
842
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
843
|
+
{
|
|
844
|
+
var modelMatrix = modelMatrices [m];
|
|
845
|
+
|
|
846
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
847
|
+
|
|
848
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
849
|
+
{
|
|
850
|
+
var target = targets [t];
|
|
851
|
+
|
|
852
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
853
|
+
|
|
854
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
855
|
+
{
|
|
856
|
+
pickingCenter .assign (pickingBBox .center);
|
|
857
|
+
targetCenter .assign (targetBBox .center);
|
|
858
|
+
|
|
859
|
+
target .intersected = true;
|
|
860
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// Send events.
|
|
866
|
+
|
|
867
|
+
var
|
|
868
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
869
|
+
active = Boolean (pickedGeometries .length);
|
|
870
|
+
|
|
871
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
872
|
+
|
|
873
|
+
if (active !== this .isActive_ .getValue ())
|
|
874
|
+
this .isActive_ = active;
|
|
875
|
+
|
|
876
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
877
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
878
|
+
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
case IntersectionType .GEOMETRY:
|
|
882
|
+
{
|
|
883
|
+
// Intersect geometry.
|
|
884
|
+
|
|
885
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
886
|
+
{
|
|
887
|
+
var modelMatrix = modelMatrices [m];
|
|
888
|
+
|
|
889
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
890
|
+
|
|
891
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
892
|
+
{
|
|
893
|
+
try
|
|
894
|
+
{
|
|
895
|
+
var
|
|
896
|
+
target = targets [t],
|
|
897
|
+
geometryNode = target .geometryNode,
|
|
898
|
+
vertices = this .pickingGeometryNode .getVertices ();
|
|
899
|
+
|
|
900
|
+
targetBBox .assign (geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
901
|
+
matrix .assign (target .modelMatrix) .inverse () .multLeft (modelMatrix);
|
|
902
|
+
|
|
903
|
+
for (var v = 0, vLength = vertices .length; v < vLength; v += 8)
|
|
904
|
+
{
|
|
905
|
+
matrix .multVecMatrix (point1 .set (vertices [v + 0], vertices [v + 1], vertices [v + 2]));
|
|
906
|
+
matrix .multVecMatrix (point2 .set (vertices [v + 4], vertices [v + 5], vertices [v + 6]));
|
|
907
|
+
line .setPoints (point1, point2);
|
|
908
|
+
|
|
909
|
+
intersections .length = 0;
|
|
910
|
+
|
|
911
|
+
if (geometryNode .intersectsLine (line, clipPlanes, target .modelMatrix, intersections))
|
|
912
|
+
{
|
|
913
|
+
for (var i = 0, iLength = intersections .length; i < iLength; ++ i)
|
|
914
|
+
{
|
|
915
|
+
// Test if intersection.point is between point1 and point2.
|
|
916
|
+
|
|
917
|
+
var intersection = intersections [i];
|
|
918
|
+
|
|
919
|
+
a .assign (intersection .point) .subtract (point1);
|
|
920
|
+
b .assign (intersection .point) .subtract (point2);
|
|
921
|
+
|
|
922
|
+
var
|
|
923
|
+
c = a .add (b) .abs (),
|
|
924
|
+
s = point1 .distance (point2);
|
|
925
|
+
|
|
926
|
+
if (c <= s)
|
|
927
|
+
target .intersections .push (intersection);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
if (target .intersections .length)
|
|
933
|
+
{
|
|
934
|
+
pickingCenter .assign (pickingBBox .center);
|
|
935
|
+
targetCenter .assign (targetBBox .center);
|
|
936
|
+
|
|
937
|
+
target .intersected = true;
|
|
938
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
catch (error)
|
|
942
|
+
{
|
|
943
|
+
// Catch inverse.
|
|
944
|
+
console .log (error);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// Send events.
|
|
950
|
+
|
|
951
|
+
var
|
|
952
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
953
|
+
active = Boolean (pickedGeometries .length);
|
|
954
|
+
|
|
955
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
956
|
+
|
|
957
|
+
if (active !== this .isActive_ .getValue ())
|
|
958
|
+
this .isActive_ = active;
|
|
959
|
+
|
|
960
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
961
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
962
|
+
|
|
963
|
+
var pickedTargets = this .getPickedTargets ();
|
|
964
|
+
|
|
965
|
+
pickedTextureCoordinate .length = 0;
|
|
966
|
+
pickedNormal .length = 0;
|
|
967
|
+
pickedPoint .length = 0;
|
|
968
|
+
|
|
969
|
+
for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
|
|
970
|
+
{
|
|
971
|
+
var pickedIntersections = pickedTargets [t] .intersections;
|
|
972
|
+
|
|
973
|
+
for (var i = 0, iLength = pickedIntersections .length; i < iLength; ++ i)
|
|
974
|
+
{
|
|
975
|
+
var
|
|
976
|
+
intersection = pickedIntersections [i],
|
|
977
|
+
t = intersection .texCoord;
|
|
978
|
+
|
|
979
|
+
texCoord .set (t .x, t .y, t .z);
|
|
980
|
+
|
|
981
|
+
pickedTextureCoordinate .push (texCoord);
|
|
982
|
+
pickedNormal .push (intersection .normal);
|
|
983
|
+
pickedPoint .push (intersection .point);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
if (! this .pickedTextureCoordinate_ .equals (pickedTextureCoordinate))
|
|
988
|
+
this .pickedTextureCoordinate_ = pickedTextureCoordinate;
|
|
989
|
+
|
|
990
|
+
if (! this .pickedNormal_ .equals (pickedNormal))
|
|
991
|
+
this .pickedNormal_ = pickedNormal;
|
|
992
|
+
|
|
993
|
+
if (! this .pickedPoint_ .equals (pickedPoint))
|
|
994
|
+
this .pickedPoint_ = pickedPoint;
|
|
995
|
+
|
|
996
|
+
break;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
1002
|
+
};
|
|
1003
|
+
})(),
|
|
1004
|
+
});
|
|
1005
|
+
|
|
1006
|
+
return LinePickSensor;
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1012
|
+
*******************************************************************************
|
|
1013
|
+
*
|
|
1014
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1015
|
+
*
|
|
1016
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1017
|
+
*
|
|
1018
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1019
|
+
*
|
|
1020
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1021
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1022
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1023
|
+
* create3000.
|
|
1024
|
+
*
|
|
1025
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1026
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1027
|
+
* permission of create3000.
|
|
1028
|
+
*
|
|
1029
|
+
* NON-MILITARY USE ONLY
|
|
1030
|
+
*
|
|
1031
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1032
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1033
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1034
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1035
|
+
*
|
|
1036
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1037
|
+
*
|
|
1038
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1039
|
+
*
|
|
1040
|
+
* This file is part of the X_ITE Project.
|
|
1041
|
+
*
|
|
1042
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1043
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1044
|
+
* Free Software Foundation.
|
|
1045
|
+
*
|
|
1046
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1047
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1048
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1049
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1050
|
+
*
|
|
1051
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1052
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1053
|
+
* copy of the GPLv3 License.
|
|
1054
|
+
*
|
|
1055
|
+
* For Silvio, Joy and Adi.
|
|
1056
|
+
*
|
|
1057
|
+
******************************************************************************/
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
define ('x_ite/Components/Picking/X3DPickableObject',[
|
|
1061
|
+
"x_ite/Bits/X3DConstants",
|
|
1062
|
+
],
|
|
1063
|
+
function (X3DConstants)
|
|
1064
|
+
{
|
|
1065
|
+
"use strict";
|
|
1066
|
+
|
|
1067
|
+
function X3DPickableObject (executionContext)
|
|
1068
|
+
{
|
|
1069
|
+
this .addType (X3DConstants .X3DPickableObject);
|
|
1070
|
+
|
|
1071
|
+
this .objectType = new Set ();
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
X3DPickableObject .prototype =
|
|
1075
|
+
{
|
|
1076
|
+
constructor: X3DPickableObject,
|
|
1077
|
+
initialize: function ()
|
|
1078
|
+
{
|
|
1079
|
+
this .objectType_ .addInterest ("set_objectType__", this);
|
|
1080
|
+
|
|
1081
|
+
this .set_objectType__ ();
|
|
1082
|
+
},
|
|
1083
|
+
getObjectType: function ()
|
|
1084
|
+
{
|
|
1085
|
+
return this .objectType;
|
|
1086
|
+
},
|
|
1087
|
+
set_objectType__: function ()
|
|
1088
|
+
{
|
|
1089
|
+
this .objectType .clear ();
|
|
1090
|
+
|
|
1091
|
+
for (var i = 0, length = this .objectType_ .length; i < length; ++ i)
|
|
1092
|
+
{
|
|
1093
|
+
this .objectType .add (this .objectType_ [i]);
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
return X3DPickableObject;
|
|
1099
|
+
});
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1104
|
+
*******************************************************************************
|
|
1105
|
+
*
|
|
1106
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1107
|
+
*
|
|
1108
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1109
|
+
*
|
|
1110
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1111
|
+
*
|
|
1112
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1113
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1114
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1115
|
+
* create3000.
|
|
1116
|
+
*
|
|
1117
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1118
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1119
|
+
* permission of create3000.
|
|
1120
|
+
*
|
|
1121
|
+
* NON-MILITARY USE ONLY
|
|
1122
|
+
*
|
|
1123
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1124
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1125
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1126
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1127
|
+
*
|
|
1128
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1129
|
+
*
|
|
1130
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1131
|
+
*
|
|
1132
|
+
* This file is part of the X_ITE Project.
|
|
1133
|
+
*
|
|
1134
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1135
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1136
|
+
* Free Software Foundation.
|
|
1137
|
+
*
|
|
1138
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1139
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1140
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1141
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1142
|
+
*
|
|
1143
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1144
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1145
|
+
* copy of the GPLv3 License.
|
|
1146
|
+
*
|
|
1147
|
+
* For Silvio, Joy and Adi.
|
|
1148
|
+
*
|
|
1149
|
+
******************************************************************************/
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
define ('x_ite/Components/Picking/PickableGroup',[
|
|
1153
|
+
"x_ite/Fields",
|
|
1154
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1155
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1156
|
+
"x_ite/Components/Grouping/X3DGroupingNode",
|
|
1157
|
+
"x_ite/Components/Picking/X3DPickableObject",
|
|
1158
|
+
"x_ite/Browser/Picking/MatchCriterion",
|
|
1159
|
+
"x_ite/Bits/X3DConstants",
|
|
1160
|
+
"x_ite/Bits/TraverseType",
|
|
1161
|
+
],
|
|
1162
|
+
function (Fields,
|
|
1163
|
+
X3DFieldDefinition,
|
|
1164
|
+
FieldDefinitionArray,
|
|
1165
|
+
X3DGroupingNode,
|
|
1166
|
+
X3DPickableObject,
|
|
1167
|
+
MatchCriterion,
|
|
1168
|
+
X3DConstants,
|
|
1169
|
+
TraverseType)
|
|
1170
|
+
{
|
|
1171
|
+
"use strict";
|
|
1172
|
+
|
|
1173
|
+
function PickableGroup (executionContext)
|
|
1174
|
+
{
|
|
1175
|
+
X3DGroupingNode .call (this, executionContext);
|
|
1176
|
+
X3DPickableObject .call (this, executionContext);
|
|
1177
|
+
|
|
1178
|
+
this .addType (X3DConstants .PickableGroup);
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
PickableGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
|
|
1182
|
+
X3DPickableObject .prototype,
|
|
1183
|
+
{
|
|
1184
|
+
constructor: PickableGroup,
|
|
1185
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1186
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1187
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickable", new Fields .SFBool (true)),
|
|
1188
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
1189
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
1190
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
1191
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
1192
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
1193
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
1194
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
1195
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
1196
|
+
]),
|
|
1197
|
+
getTypeName: function ()
|
|
1198
|
+
{
|
|
1199
|
+
return "PickableGroup";
|
|
1200
|
+
},
|
|
1201
|
+
getComponentName: function ()
|
|
1202
|
+
{
|
|
1203
|
+
return "Picking";
|
|
1204
|
+
},
|
|
1205
|
+
getContainerField: function ()
|
|
1206
|
+
{
|
|
1207
|
+
return "children";
|
|
1208
|
+
},
|
|
1209
|
+
initialize: function ()
|
|
1210
|
+
{
|
|
1211
|
+
X3DGroupingNode .prototype .initialize .call (this);
|
|
1212
|
+
X3DPickableObject .prototype .initialize .call (this);
|
|
1213
|
+
|
|
1214
|
+
this .pickable_ .addInterest ("set_pickable__", this);
|
|
1215
|
+
|
|
1216
|
+
this .set_pickable__ ();
|
|
1217
|
+
},
|
|
1218
|
+
set_pickableObjects__: function ()
|
|
1219
|
+
{
|
|
1220
|
+
this .set_pickable__ ();
|
|
1221
|
+
},
|
|
1222
|
+
set_pickable__: function ()
|
|
1223
|
+
{
|
|
1224
|
+
this .setPickableObject (Boolean (this .pickable_ .getValue () || this .getTransformSensors () .size));
|
|
1225
|
+
},
|
|
1226
|
+
traverse: (function ()
|
|
1227
|
+
{
|
|
1228
|
+
const pickSensorNodes = new Set ();
|
|
1229
|
+
|
|
1230
|
+
return function (type, renderObject)
|
|
1231
|
+
{
|
|
1232
|
+
if (type === TraverseType .PICKING)
|
|
1233
|
+
{
|
|
1234
|
+
if (this .pickable_ .getValue ())
|
|
1235
|
+
{
|
|
1236
|
+
if (this .getObjectType () .has ("NONE"))
|
|
1237
|
+
return;
|
|
1238
|
+
|
|
1239
|
+
const
|
|
1240
|
+
browser = renderObject .getBrowser (),
|
|
1241
|
+
pickableStack = browser .getPickable ();
|
|
1242
|
+
|
|
1243
|
+
if (this .getObjectType () .has ("ALL"))
|
|
1244
|
+
{
|
|
1245
|
+
pickableStack .push (true);
|
|
1246
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1247
|
+
pickableStack .pop ();
|
|
1248
|
+
}
|
|
1249
|
+
else
|
|
1250
|
+
{
|
|
1251
|
+
// Filter pick sensors.
|
|
1252
|
+
|
|
1253
|
+
const pickSensorStack = browser .getPickSensors ();
|
|
1254
|
+
|
|
1255
|
+
for (const pickSensorNode of pickSensorStack .at (-1))
|
|
1256
|
+
{
|
|
1257
|
+
if (! pickSensorNode .getObjectType () .has ("ALL"))
|
|
1258
|
+
{
|
|
1259
|
+
let intersection = 0;
|
|
1260
|
+
|
|
1261
|
+
for (const objectType of this .getObjectType ())
|
|
1262
|
+
{
|
|
1263
|
+
if (pickSensorNode .getObjectType () .has (objectType))
|
|
1264
|
+
{
|
|
1265
|
+
++ intersection;
|
|
1266
|
+
break;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
switch (pickSensorNode .getMatchCriterion ())
|
|
1271
|
+
{
|
|
1272
|
+
case MatchCriterion .MATCH_ANY:
|
|
1273
|
+
{
|
|
1274
|
+
if (intersection === 0)
|
|
1275
|
+
continue;
|
|
1276
|
+
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
case MatchCriterion .MATCH_EVERY:
|
|
1280
|
+
{
|
|
1281
|
+
if (intersection !== pickSensor .getObjectType () .size)
|
|
1282
|
+
continue;
|
|
1283
|
+
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
case MatchCriterion .MATCH_ONLY_ONE:
|
|
1287
|
+
{
|
|
1288
|
+
if (intersection !== 1)
|
|
1289
|
+
continue;
|
|
1290
|
+
|
|
1291
|
+
break;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
pickSensorNodes .add (pickSensorNode);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
pickableStack .push (true);
|
|
1300
|
+
pickSensorStack .push (pickSensorNodes);
|
|
1301
|
+
|
|
1302
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1303
|
+
|
|
1304
|
+
pickSensorStack .pop ();
|
|
1305
|
+
pickableStack .pop ();
|
|
1306
|
+
|
|
1307
|
+
pickSensorNodes .clear ();
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
else
|
|
1312
|
+
{
|
|
1313
|
+
X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
|
|
1314
|
+
}
|
|
1315
|
+
};
|
|
1316
|
+
})(),
|
|
1317
|
+
});
|
|
1318
|
+
|
|
1319
|
+
return PickableGroup;
|
|
1320
|
+
});
|
|
1321
|
+
|
|
1322
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1323
|
+
*******************************************************************************
|
|
1324
|
+
*
|
|
1325
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1326
|
+
*
|
|
1327
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1328
|
+
*
|
|
1329
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1330
|
+
*
|
|
1331
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1332
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1333
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1334
|
+
* create3000.
|
|
1335
|
+
*
|
|
1336
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1337
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1338
|
+
* permission of create3000.
|
|
1339
|
+
*
|
|
1340
|
+
* NON-MILITARY USE ONLY
|
|
1341
|
+
*
|
|
1342
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1343
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1344
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1345
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1346
|
+
*
|
|
1347
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1348
|
+
*
|
|
1349
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1350
|
+
*
|
|
1351
|
+
* This file is part of the X_ITE Project.
|
|
1352
|
+
*
|
|
1353
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1354
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1355
|
+
* Free Software Foundation.
|
|
1356
|
+
*
|
|
1357
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1358
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1359
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1360
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1361
|
+
*
|
|
1362
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1363
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1364
|
+
* copy of the GPLv3 License.
|
|
1365
|
+
*
|
|
1366
|
+
* For Silvio, Joy and Adi.
|
|
1367
|
+
*
|
|
1368
|
+
******************************************************************************/
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
define ('x_ite/Browser/Picking/VolumePicker',[
|
|
1372
|
+
"standard/Math/Numbers/Vector3",
|
|
1373
|
+
"standard/Math/Numbers/Rotation4",
|
|
1374
|
+
"standard/Math/Numbers/Matrix4",
|
|
1375
|
+
require .getComponentUrl ("rigid-body-physics"),
|
|
1376
|
+
],
|
|
1377
|
+
function (Vector3,
|
|
1378
|
+
Rotation4,
|
|
1379
|
+
Matrix4,
|
|
1380
|
+
RigidBodyPhysics)
|
|
1381
|
+
{
|
|
1382
|
+
"use strict";
|
|
1383
|
+
|
|
1384
|
+
var Ammo = RigidBodyPhysics .Ammo;
|
|
1385
|
+
|
|
1386
|
+
function VolumePicker ()
|
|
1387
|
+
{
|
|
1388
|
+
this .broadphase = new Ammo .btDbvtBroadphase ();
|
|
1389
|
+
this .collisionConfiguration = new Ammo .btDefaultCollisionConfiguration ();
|
|
1390
|
+
this .dispatcher = new Ammo .btCollisionDispatcher (this .collisionConfiguration);
|
|
1391
|
+
this .collisionWorld = new Ammo .btCollisionWorld (this .dispatcher, this .broadphase, this .collisionConfiguration);
|
|
1392
|
+
|
|
1393
|
+
this .compoundShape1 = new Ammo .btCompoundShape ();
|
|
1394
|
+
this .motionState1 = new Ammo .btDefaultMotionState ();
|
|
1395
|
+
this .constructionInfo1 = new Ammo .btRigidBodyConstructionInfo (0, this .motionState1, this .compoundShape1);
|
|
1396
|
+
this .rigidBody1 = new Ammo .btRigidBody (this .constructionInfo1);
|
|
1397
|
+
|
|
1398
|
+
this .compoundShape2 = new Ammo .btCompoundShape ();
|
|
1399
|
+
this .motionState2 = new Ammo .btDefaultMotionState ();
|
|
1400
|
+
this .constructionInfo2 = new Ammo .btRigidBodyConstructionInfo (0, this .motionState2, this .compoundShape2);
|
|
1401
|
+
this .rigidBody2 = new Ammo .btRigidBody (this .constructionInfo2);
|
|
1402
|
+
|
|
1403
|
+
this .collisionWorld .addCollisionObject (this .rigidBody1);
|
|
1404
|
+
this .collisionWorld .addCollisionObject (this .rigidBody2);
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
VolumePicker .prototype =
|
|
1408
|
+
{
|
|
1409
|
+
constuctor: VolumePicker,
|
|
1410
|
+
setChildShape1: function (matrix, childShape)
|
|
1411
|
+
{
|
|
1412
|
+
this .setChildShape (this .compoundShape1, matrix, childShape);
|
|
1413
|
+
},
|
|
1414
|
+
setChildShape2: function (matrix, childShape)
|
|
1415
|
+
{
|
|
1416
|
+
this .setChildShape (this .compoundShape2, matrix, childShape);
|
|
1417
|
+
},
|
|
1418
|
+
setChildShape1Components: function (transform, localScaling, childShape)
|
|
1419
|
+
{
|
|
1420
|
+
this .setChildShapeComponents (this .compoundShape1, transform, localScaling, childShape);
|
|
1421
|
+
},
|
|
1422
|
+
setChildShape2Components: function (transform, localScaling, childShape)
|
|
1423
|
+
{
|
|
1424
|
+
this .setChildShapeComponents (this .compoundShape2, transform, localScaling, childShape);
|
|
1425
|
+
},
|
|
1426
|
+
setChildShape: (function ()
|
|
1427
|
+
{
|
|
1428
|
+
var
|
|
1429
|
+
translation = new Vector3 (0, 0, 0),
|
|
1430
|
+
rotation = new Rotation4 (0, 0, 1, 0),
|
|
1431
|
+
scale = new Vector3 (1, 1, 1),
|
|
1432
|
+
s = new Ammo .btVector3 (0, 0, 0);
|
|
1433
|
+
|
|
1434
|
+
return function (compoundShape, matrix, childShape)
|
|
1435
|
+
{
|
|
1436
|
+
try
|
|
1437
|
+
{
|
|
1438
|
+
if (compoundShape .getNumChildShapes ())
|
|
1439
|
+
compoundShape .removeChildShapeByIndex (0);
|
|
1440
|
+
|
|
1441
|
+
if (childShape .getNumChildShapes ())
|
|
1442
|
+
{
|
|
1443
|
+
matrix .get (translation, rotation, scale);
|
|
1444
|
+
|
|
1445
|
+
s .setValue (scale .x, scale .y, scale .z);
|
|
1446
|
+
|
|
1447
|
+
childShape .setLocalScaling (s);
|
|
1448
|
+
compoundShape .addChildShape (this .getTransform (translation, rotation), childShape);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
catch (error)
|
|
1452
|
+
{
|
|
1453
|
+
// matrix .get
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
})(),
|
|
1457
|
+
setChildShapeComponents: function (compoundShape, transform, localScaling, childShape)
|
|
1458
|
+
{
|
|
1459
|
+
if (compoundShape .getNumChildShapes ())
|
|
1460
|
+
compoundShape .removeChildShapeByIndex (0);
|
|
1461
|
+
|
|
1462
|
+
if (childShape .getNumChildShapes ())
|
|
1463
|
+
{
|
|
1464
|
+
childShape .setLocalScaling (localScaling);
|
|
1465
|
+
compoundShape .addChildShape (transform, childShape);
|
|
1466
|
+
}
|
|
1467
|
+
},
|
|
1468
|
+
contactTest: function ()
|
|
1469
|
+
{
|
|
1470
|
+
this .collisionWorld .performDiscreteCollisionDetection ();
|
|
1471
|
+
|
|
1472
|
+
var numManifolds = this .dispatcher .getNumManifolds ();
|
|
1473
|
+
|
|
1474
|
+
for (var i = 0; i < numManifolds; ++ i)
|
|
1475
|
+
{
|
|
1476
|
+
var
|
|
1477
|
+
contactManifold = this .dispatcher .getManifoldByIndexInternal (i),
|
|
1478
|
+
numContacts = contactManifold .getNumContacts ();
|
|
1479
|
+
|
|
1480
|
+
for (var j = 0; j < numContacts; ++ j)
|
|
1481
|
+
{
|
|
1482
|
+
var pt = contactManifold .getContactPoint (j);
|
|
1483
|
+
|
|
1484
|
+
if (pt .getDistance () <= 0)
|
|
1485
|
+
return true;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
return false;
|
|
1490
|
+
},
|
|
1491
|
+
getTransform: (function ()
|
|
1492
|
+
{
|
|
1493
|
+
var
|
|
1494
|
+
T = new Ammo .btTransform (),
|
|
1495
|
+
o = new Ammo .btVector3 (0, 0, 0),
|
|
1496
|
+
m = new Matrix4 ();
|
|
1497
|
+
|
|
1498
|
+
return function (translation, rotation, transform)
|
|
1499
|
+
{
|
|
1500
|
+
var t = transform || T;
|
|
1501
|
+
|
|
1502
|
+
m .set (translation, rotation);
|
|
1503
|
+
|
|
1504
|
+
o .setValue (m [12], m [13], m [14]);
|
|
1505
|
+
|
|
1506
|
+
t .getBasis () .setValue (m [0], m [4], m [8],
|
|
1507
|
+
m [1], m [5], m [9],
|
|
1508
|
+
m [2], m [6], m [10]);
|
|
1509
|
+
|
|
1510
|
+
t .setOrigin (o);
|
|
1511
|
+
|
|
1512
|
+
return t;
|
|
1513
|
+
};
|
|
1514
|
+
})(),
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
return VolumePicker;
|
|
1518
|
+
});
|
|
1519
|
+
|
|
1520
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1521
|
+
*******************************************************************************
|
|
1522
|
+
*
|
|
1523
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1524
|
+
*
|
|
1525
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1526
|
+
*
|
|
1527
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1528
|
+
*
|
|
1529
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1530
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1531
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1532
|
+
* create3000.
|
|
1533
|
+
*
|
|
1534
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1535
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1536
|
+
* permission of create3000.
|
|
1537
|
+
*
|
|
1538
|
+
* NON-MILITARY USE ONLY
|
|
1539
|
+
*
|
|
1540
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1541
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1542
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1543
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1544
|
+
*
|
|
1545
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1546
|
+
*
|
|
1547
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1548
|
+
*
|
|
1549
|
+
* This file is part of the X_ITE Project.
|
|
1550
|
+
*
|
|
1551
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1552
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1553
|
+
* Free Software Foundation.
|
|
1554
|
+
*
|
|
1555
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1556
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1557
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1558
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1559
|
+
*
|
|
1560
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1561
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1562
|
+
* copy of the GPLv3 License.
|
|
1563
|
+
*
|
|
1564
|
+
* For Silvio, Joy and Adi.
|
|
1565
|
+
*
|
|
1566
|
+
******************************************************************************/
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
define ('x_ite/Components/Picking/PointPickSensor',[
|
|
1570
|
+
"x_ite/Fields",
|
|
1571
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1572
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1573
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
1574
|
+
"x_ite/Bits/X3DCast",
|
|
1575
|
+
"x_ite/Bits/X3DConstants",
|
|
1576
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
1577
|
+
"x_ite/Browser/Picking/VolumePicker",
|
|
1578
|
+
"standard/Math/Numbers/Vector3",
|
|
1579
|
+
"standard/Math/Numbers/Rotation4",
|
|
1580
|
+
"standard/Math/Geometry/Box3",
|
|
1581
|
+
require .getComponentUrl ("rigid-body-physics"),
|
|
1582
|
+
],
|
|
1583
|
+
function (Fields,
|
|
1584
|
+
X3DFieldDefinition,
|
|
1585
|
+
FieldDefinitionArray,
|
|
1586
|
+
X3DPickSensorNode,
|
|
1587
|
+
X3DCast,
|
|
1588
|
+
X3DConstants,
|
|
1589
|
+
IntersectionType,
|
|
1590
|
+
VolumePicker,
|
|
1591
|
+
Vector3,
|
|
1592
|
+
Rotation4,
|
|
1593
|
+
Box3,
|
|
1594
|
+
RigidBodyPhysics)
|
|
1595
|
+
{
|
|
1596
|
+
"use strict";
|
|
1597
|
+
|
|
1598
|
+
var Ammo = RigidBodyPhysics .Ammo;
|
|
1599
|
+
|
|
1600
|
+
function PointPickSensor (executionContext)
|
|
1601
|
+
{
|
|
1602
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
1603
|
+
|
|
1604
|
+
this .addType (X3DConstants .PointPickSensor);
|
|
1605
|
+
|
|
1606
|
+
this .pickingGeometryNode = null;
|
|
1607
|
+
this .picker = new VolumePicker ();
|
|
1608
|
+
this .compoundShapes = [ ];
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
PointPickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
1612
|
+
{
|
|
1613
|
+
constructor: PointPickSensor,
|
|
1614
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1615
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1616
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
1617
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
1618
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
1619
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
1620
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
1621
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
1622
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedPoint", new Fields .MFVec3f ()),
|
|
1623
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
1624
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
1625
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
1626
|
+
]),
|
|
1627
|
+
getTypeName: function ()
|
|
1628
|
+
{
|
|
1629
|
+
return "PointPickSensor";
|
|
1630
|
+
},
|
|
1631
|
+
getComponentName: function ()
|
|
1632
|
+
{
|
|
1633
|
+
return "Picking";
|
|
1634
|
+
},
|
|
1635
|
+
getContainerField: function ()
|
|
1636
|
+
{
|
|
1637
|
+
return "children";
|
|
1638
|
+
},
|
|
1639
|
+
initialize: function ()
|
|
1640
|
+
{
|
|
1641
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
1642
|
+
|
|
1643
|
+
this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
|
|
1644
|
+
|
|
1645
|
+
this .set_pickingGeometry__ ();
|
|
1646
|
+
},
|
|
1647
|
+
set_pickingGeometry__: function ()
|
|
1648
|
+
{
|
|
1649
|
+
if (this .pickingGeometryNode)
|
|
1650
|
+
this .pickingGeometryNode .rebuild_ .removeInterest ("set_geometry__", this);
|
|
1651
|
+
|
|
1652
|
+
this .pickingGeometryNode = X3DCast (X3DConstants .PointSet, this .pickingGeometry_);
|
|
1653
|
+
|
|
1654
|
+
if (this .pickingGeometryNode)
|
|
1655
|
+
this .pickingGeometryNode .rebuild_ .addInterest ("set_geometry__", this);
|
|
1656
|
+
|
|
1657
|
+
this .set_geometry__ ();
|
|
1658
|
+
},
|
|
1659
|
+
set_geometry__: (function ()
|
|
1660
|
+
{
|
|
1661
|
+
var
|
|
1662
|
+
defaultScale = new Ammo .btVector3 (1, 1, 1),
|
|
1663
|
+
o = new Ammo .btVector3 (),
|
|
1664
|
+
t = new Ammo .btTransform ();
|
|
1665
|
+
|
|
1666
|
+
return function ()
|
|
1667
|
+
{
|
|
1668
|
+
var compoundShapes = this .compoundShapes;
|
|
1669
|
+
|
|
1670
|
+
if (this .pickingGeometryNode)
|
|
1671
|
+
{
|
|
1672
|
+
var coord = this .pickingGeometryNode .getCoord ();
|
|
1673
|
+
|
|
1674
|
+
if (coord)
|
|
1675
|
+
{
|
|
1676
|
+
for (var i = 0, length = coord .getSize (); i < length; ++ i)
|
|
1677
|
+
{
|
|
1678
|
+
if (i < compoundShapes .length)
|
|
1679
|
+
{
|
|
1680
|
+
var
|
|
1681
|
+
compoundShape = compoundShapes [i],
|
|
1682
|
+
point = coord .get1Point (i, compoundShape .point);
|
|
1683
|
+
|
|
1684
|
+
o .setValue (point .x, point .y, point .z);
|
|
1685
|
+
t .setOrigin (o);
|
|
1686
|
+
|
|
1687
|
+
compoundShape .setLocalScaling (defaultScale);
|
|
1688
|
+
compoundShape .updateChildTransform (0, t);
|
|
1689
|
+
}
|
|
1690
|
+
else
|
|
1691
|
+
{
|
|
1692
|
+
var
|
|
1693
|
+
compoundShape = new Ammo .btCompoundShape (),
|
|
1694
|
+
sphereShape = new Ammo .btSphereShape (0),
|
|
1695
|
+
point = coord .get1Point (i, new Vector3 (0, 0, 0));
|
|
1696
|
+
|
|
1697
|
+
compoundShape .point = point;
|
|
1698
|
+
|
|
1699
|
+
o .setValue (point .x, point .y, point .z);
|
|
1700
|
+
t .setOrigin (o);
|
|
1701
|
+
|
|
1702
|
+
compoundShape .addChildShape (t, sphereShape);
|
|
1703
|
+
compoundShapes .push (compoundShape);
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
compoundShapes .length = length;
|
|
1708
|
+
}
|
|
1709
|
+
else
|
|
1710
|
+
{
|
|
1711
|
+
compoundShapes .length = 0;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
else
|
|
1715
|
+
{
|
|
1716
|
+
compoundShapes .length = 0;
|
|
1717
|
+
}
|
|
1718
|
+
};
|
|
1719
|
+
})(),
|
|
1720
|
+
process: (function ()
|
|
1721
|
+
{
|
|
1722
|
+
var
|
|
1723
|
+
pickingBBox = new Box3 (),
|
|
1724
|
+
targetBBox = new Box3 (),
|
|
1725
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
1726
|
+
targetCenter = new Vector3 (0, 0, 0),
|
|
1727
|
+
transform = new Ammo .btTransform (),
|
|
1728
|
+
localScaling = new Ammo .btVector3 (),
|
|
1729
|
+
translation = new Vector3 (0, 0, 0),
|
|
1730
|
+
rotation = new Rotation4 (0, 0, 1, 0),
|
|
1731
|
+
scale = new Vector3 (1, 1, 1),
|
|
1732
|
+
pickedPoint = new Fields .MFVec3f ();
|
|
1733
|
+
|
|
1734
|
+
return function ()
|
|
1735
|
+
{
|
|
1736
|
+
if (this .pickingGeometryNode)
|
|
1737
|
+
{
|
|
1738
|
+
var
|
|
1739
|
+
modelMatrices = this .getModelMatrices (),
|
|
1740
|
+
targets = this .getTargets ();
|
|
1741
|
+
|
|
1742
|
+
switch (this .getIntersectionType ())
|
|
1743
|
+
{
|
|
1744
|
+
case IntersectionType .BOUNDS:
|
|
1745
|
+
{
|
|
1746
|
+
// Intersect bboxes.
|
|
1747
|
+
|
|
1748
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
1749
|
+
{
|
|
1750
|
+
var modelMatrix = modelMatrices [m];
|
|
1751
|
+
|
|
1752
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
1753
|
+
|
|
1754
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
1755
|
+
{
|
|
1756
|
+
var target = targets [t];
|
|
1757
|
+
|
|
1758
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
1759
|
+
|
|
1760
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
1761
|
+
{
|
|
1762
|
+
pickingCenter .assign (pickingBBox .center);
|
|
1763
|
+
targetCenter .assign (targetBBox .center);
|
|
1764
|
+
|
|
1765
|
+
target .intersected = true;
|
|
1766
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
// Send events.
|
|
1772
|
+
|
|
1773
|
+
var
|
|
1774
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
1775
|
+
active = Boolean (pickedGeometries .length);
|
|
1776
|
+
|
|
1777
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
1778
|
+
|
|
1779
|
+
if (active !== this .isActive_ .getValue ())
|
|
1780
|
+
this .isActive_ = active;
|
|
1781
|
+
|
|
1782
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
1783
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
1784
|
+
|
|
1785
|
+
break;
|
|
1786
|
+
}
|
|
1787
|
+
case IntersectionType .GEOMETRY:
|
|
1788
|
+
{
|
|
1789
|
+
// Intersect geometry.
|
|
1790
|
+
|
|
1791
|
+
var
|
|
1792
|
+
picker = this .picker,
|
|
1793
|
+
compoundShapes = this .compoundShapes;
|
|
1794
|
+
|
|
1795
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
1796
|
+
{
|
|
1797
|
+
var modelMatrix = modelMatrices [m];
|
|
1798
|
+
|
|
1799
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
1800
|
+
|
|
1801
|
+
modelMatrix .get (translation, rotation, scale);
|
|
1802
|
+
|
|
1803
|
+
picker .getTransform (translation, rotation, transform);
|
|
1804
|
+
localScaling .setValue (scale .x, scale .y, scale .z);
|
|
1805
|
+
|
|
1806
|
+
for (var c = 0, cLength = compoundShapes .length; c < cLength; ++ c)
|
|
1807
|
+
{
|
|
1808
|
+
var compoundShape = compoundShapes [c];
|
|
1809
|
+
|
|
1810
|
+
picker .setChildShape1Components (transform, localScaling, compoundShape);
|
|
1811
|
+
|
|
1812
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
1813
|
+
{
|
|
1814
|
+
var
|
|
1815
|
+
target = targets [t],
|
|
1816
|
+
targetShape = this .getPickShape (target .geometryNode);
|
|
1817
|
+
|
|
1818
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
1819
|
+
|
|
1820
|
+
picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
|
|
1821
|
+
|
|
1822
|
+
if (picker .contactTest ())
|
|
1823
|
+
{
|
|
1824
|
+
pickingCenter .assign (pickingBBox .center);
|
|
1825
|
+
targetCenter .assign (targetBBox .center);
|
|
1826
|
+
|
|
1827
|
+
target .intersected = true;
|
|
1828
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
1829
|
+
target .pickedPoint .push (compoundShape .point);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
// Send events.
|
|
1836
|
+
|
|
1837
|
+
var
|
|
1838
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
1839
|
+
active = Boolean (pickedGeometries .length);
|
|
1840
|
+
|
|
1841
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
1842
|
+
|
|
1843
|
+
if (active !== this .isActive_ .getValue ())
|
|
1844
|
+
this .isActive_ = active;
|
|
1845
|
+
|
|
1846
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
1847
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
1848
|
+
|
|
1849
|
+
var pickedTargets = this .getPickedTargets ();
|
|
1850
|
+
|
|
1851
|
+
pickedPoint .length = 0;
|
|
1852
|
+
|
|
1853
|
+
for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
|
|
1854
|
+
{
|
|
1855
|
+
var pp = pickedTargets [t] .pickedPoint;
|
|
1856
|
+
|
|
1857
|
+
for (var p = 0, pLength = pp .length; p < pLength; ++ p)
|
|
1858
|
+
pickedPoint .push (pp [p]);
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
if (! this .pickedPoint_ .equals (pickedPoint))
|
|
1862
|
+
this .pickedPoint_ = pickedPoint;
|
|
1863
|
+
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
1870
|
+
};
|
|
1871
|
+
})(),
|
|
1872
|
+
});
|
|
1873
|
+
|
|
1874
|
+
return PointPickSensor;
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1877
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1878
|
+
*******************************************************************************
|
|
1879
|
+
*
|
|
1880
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1881
|
+
*
|
|
1882
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1883
|
+
*
|
|
1884
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1885
|
+
*
|
|
1886
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1887
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1888
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1889
|
+
* create3000.
|
|
1890
|
+
*
|
|
1891
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1892
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1893
|
+
* permission of create3000.
|
|
1894
|
+
*
|
|
1895
|
+
* NON-MILITARY USE ONLY
|
|
1896
|
+
*
|
|
1897
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1898
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1899
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1900
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1901
|
+
*
|
|
1902
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1903
|
+
*
|
|
1904
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1905
|
+
*
|
|
1906
|
+
* This file is part of the X_ITE Project.
|
|
1907
|
+
*
|
|
1908
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1909
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1910
|
+
* Free Software Foundation.
|
|
1911
|
+
*
|
|
1912
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1913
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1914
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1915
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1916
|
+
*
|
|
1917
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1918
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1919
|
+
* copy of the GPLv3 License.
|
|
1920
|
+
*
|
|
1921
|
+
* For Silvio, Joy and Adi.
|
|
1922
|
+
*
|
|
1923
|
+
******************************************************************************/
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
define ('x_ite/Components/Picking/PrimitivePickSensor',[
|
|
1927
|
+
"x_ite/Fields",
|
|
1928
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1929
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1930
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
1931
|
+
"x_ite/Bits/X3DConstants",
|
|
1932
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
1933
|
+
"x_ite/Browser/Picking/VolumePicker",
|
|
1934
|
+
"standard/Math/Numbers/Vector3",
|
|
1935
|
+
"standard/Math/Geometry/Box3",
|
|
1936
|
+
],
|
|
1937
|
+
function (Fields,
|
|
1938
|
+
X3DFieldDefinition,
|
|
1939
|
+
FieldDefinitionArray,
|
|
1940
|
+
X3DPickSensorNode,
|
|
1941
|
+
X3DConstants,
|
|
1942
|
+
IntersectionType,
|
|
1943
|
+
VolumePicker,
|
|
1944
|
+
Vector3,
|
|
1945
|
+
Box3)
|
|
1946
|
+
{
|
|
1947
|
+
"use strict";
|
|
1948
|
+
|
|
1949
|
+
function PrimitivePickSensor (executionContext)
|
|
1950
|
+
{
|
|
1951
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
1952
|
+
|
|
1953
|
+
this .addType (X3DConstants .PrimitivePickSensor);
|
|
1954
|
+
|
|
1955
|
+
this .pickingGeometryNode = null;
|
|
1956
|
+
this .picker = new VolumePicker ();
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
PrimitivePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
1960
|
+
{
|
|
1961
|
+
constructor: PrimitivePickSensor,
|
|
1962
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1963
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1964
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
1965
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
1966
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
1967
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
1968
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
1969
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
1970
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
1971
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
1972
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
1973
|
+
]),
|
|
1974
|
+
getTypeName: function ()
|
|
1975
|
+
{
|
|
1976
|
+
return "PrimitivePickSensor";
|
|
1977
|
+
},
|
|
1978
|
+
getComponentName: function ()
|
|
1979
|
+
{
|
|
1980
|
+
return "Picking";
|
|
1981
|
+
},
|
|
1982
|
+
getContainerField: function ()
|
|
1983
|
+
{
|
|
1984
|
+
return "children";
|
|
1985
|
+
},
|
|
1986
|
+
initialize: function ()
|
|
1987
|
+
{
|
|
1988
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
1989
|
+
|
|
1990
|
+
this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
|
|
1991
|
+
|
|
1992
|
+
this .set_pickingGeometry__ ();
|
|
1993
|
+
},
|
|
1994
|
+
set_pickingGeometry__: function ()
|
|
1995
|
+
{
|
|
1996
|
+
this .pickingGeometryNode = null;
|
|
1997
|
+
|
|
1998
|
+
try
|
|
1999
|
+
{
|
|
2000
|
+
var
|
|
2001
|
+
node = this .pickingGeometry_ .getValue () .getInnerNode (),
|
|
2002
|
+
type = node .getType ();
|
|
2003
|
+
|
|
2004
|
+
for (var t = type .length - 1; t >= 0; -- t)
|
|
2005
|
+
{
|
|
2006
|
+
switch (type [t])
|
|
2007
|
+
{
|
|
2008
|
+
case X3DConstants .Box:
|
|
2009
|
+
case X3DConstants .Cone:
|
|
2010
|
+
case X3DConstants .Cylinder:
|
|
2011
|
+
case X3DConstants .Sphere:
|
|
2012
|
+
{
|
|
2013
|
+
this .pickingGeometryNode = node;
|
|
2014
|
+
break;
|
|
2015
|
+
}
|
|
2016
|
+
default:
|
|
2017
|
+
continue;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
catch (error)
|
|
2022
|
+
{ }
|
|
2023
|
+
},
|
|
2024
|
+
process: (function ()
|
|
2025
|
+
{
|
|
2026
|
+
var
|
|
2027
|
+
pickingBBox = new Box3 (),
|
|
2028
|
+
targetBBox = new Box3 (),
|
|
2029
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
2030
|
+
targetCenter = new Vector3 (0, 0, 0);
|
|
2031
|
+
|
|
2032
|
+
return function ()
|
|
2033
|
+
{
|
|
2034
|
+
if (this .pickingGeometryNode)
|
|
2035
|
+
{
|
|
2036
|
+
var
|
|
2037
|
+
modelMatrices = this .getModelMatrices (),
|
|
2038
|
+
targets = this .getTargets ();
|
|
2039
|
+
|
|
2040
|
+
switch (this .getIntersectionType ())
|
|
2041
|
+
{
|
|
2042
|
+
case IntersectionType .BOUNDS:
|
|
2043
|
+
{
|
|
2044
|
+
// Intersect bboxes.
|
|
2045
|
+
|
|
2046
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2047
|
+
{
|
|
2048
|
+
var modelMatrix = modelMatrices [m];
|
|
2049
|
+
|
|
2050
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2051
|
+
|
|
2052
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2053
|
+
{
|
|
2054
|
+
var target = targets [t];
|
|
2055
|
+
|
|
2056
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2057
|
+
|
|
2058
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
2059
|
+
{
|
|
2060
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2061
|
+
targetCenter .assign (targetBBox .center);
|
|
2062
|
+
|
|
2063
|
+
target .intersected = true;
|
|
2064
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
// Send events.
|
|
2070
|
+
|
|
2071
|
+
var
|
|
2072
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2073
|
+
active = Boolean (pickedGeometries .length);
|
|
2074
|
+
|
|
2075
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2076
|
+
|
|
2077
|
+
if (active !== this .isActive_ .getValue ())
|
|
2078
|
+
this .isActive_ = active;
|
|
2079
|
+
|
|
2080
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
2081
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
2082
|
+
|
|
2083
|
+
break;
|
|
2084
|
+
}
|
|
2085
|
+
case IntersectionType .GEOMETRY:
|
|
2086
|
+
{
|
|
2087
|
+
// Intersect geometry.
|
|
2088
|
+
|
|
2089
|
+
var picker = this .picker;
|
|
2090
|
+
|
|
2091
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2092
|
+
{
|
|
2093
|
+
var
|
|
2094
|
+
modelMatrix = modelMatrices [m],
|
|
2095
|
+
pickingShape = this .getPickShape (this .pickingGeometryNode);
|
|
2096
|
+
|
|
2097
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2098
|
+
|
|
2099
|
+
picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
|
|
2100
|
+
|
|
2101
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2102
|
+
{
|
|
2103
|
+
var
|
|
2104
|
+
target = targets [t],
|
|
2105
|
+
targetShape = this .getPickShape (target .geometryNode);
|
|
2106
|
+
|
|
2107
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2108
|
+
|
|
2109
|
+
picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
|
|
2110
|
+
|
|
2111
|
+
if (picker .contactTest ())
|
|
2112
|
+
{
|
|
2113
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2114
|
+
targetCenter .assign (targetBBox .center);
|
|
2115
|
+
|
|
2116
|
+
target .intersected = true;
|
|
2117
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
// Send events.
|
|
2123
|
+
|
|
2124
|
+
var
|
|
2125
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2126
|
+
active = Boolean (pickedGeometries .length);
|
|
2127
|
+
|
|
2128
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2129
|
+
|
|
2130
|
+
if (active !== this .isActive_ .getValue ())
|
|
2131
|
+
this .isActive_ = active;
|
|
2132
|
+
|
|
2133
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
2134
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
2135
|
+
|
|
2136
|
+
break;
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
2142
|
+
};
|
|
2143
|
+
})(),
|
|
2144
|
+
});
|
|
2145
|
+
|
|
2146
|
+
return PrimitivePickSensor;
|
|
2147
|
+
});
|
|
2148
|
+
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2152
|
+
*******************************************************************************
|
|
2153
|
+
*
|
|
2154
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2155
|
+
*
|
|
2156
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2157
|
+
*
|
|
2158
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2159
|
+
*
|
|
2160
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2161
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2162
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2163
|
+
* create3000.
|
|
2164
|
+
*
|
|
2165
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2166
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2167
|
+
* permission of create3000.
|
|
2168
|
+
*
|
|
2169
|
+
* NON-MILITARY USE ONLY
|
|
2170
|
+
*
|
|
2171
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2172
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2173
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2174
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2175
|
+
*
|
|
2176
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2177
|
+
*
|
|
2178
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2179
|
+
*
|
|
2180
|
+
* This file is part of the X_ITE Project.
|
|
2181
|
+
*
|
|
2182
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2183
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2184
|
+
* Free Software Foundation.
|
|
2185
|
+
*
|
|
2186
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2187
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2188
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2189
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2190
|
+
*
|
|
2191
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2192
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2193
|
+
* copy of the GPLv3 License.
|
|
2194
|
+
*
|
|
2195
|
+
* For Silvio, Joy and Adi.
|
|
2196
|
+
*
|
|
2197
|
+
******************************************************************************/
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
define ('x_ite/Components/Picking/VolumePickSensor',[
|
|
2201
|
+
"x_ite/Fields",
|
|
2202
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2203
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2204
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
2205
|
+
"x_ite/Bits/X3DCast",
|
|
2206
|
+
"x_ite/Bits/X3DConstants",
|
|
2207
|
+
"x_ite/Browser/Picking/IntersectionType",
|
|
2208
|
+
"x_ite/Browser/Picking/VolumePicker",
|
|
2209
|
+
"standard/Math/Numbers/Vector3",
|
|
2210
|
+
"standard/Math/Geometry/Box3",
|
|
2211
|
+
],
|
|
2212
|
+
function (Fields,
|
|
2213
|
+
X3DFieldDefinition,
|
|
2214
|
+
FieldDefinitionArray,
|
|
2215
|
+
X3DPickSensorNode,
|
|
2216
|
+
X3DCast,
|
|
2217
|
+
X3DConstants,
|
|
2218
|
+
IntersectionType,
|
|
2219
|
+
VolumePicker,
|
|
2220
|
+
Vector3,
|
|
2221
|
+
Box3)
|
|
2222
|
+
{
|
|
2223
|
+
"use strict";
|
|
2224
|
+
|
|
2225
|
+
function VolumePickSensor (executionContext)
|
|
2226
|
+
{
|
|
2227
|
+
X3DPickSensorNode .call (this, executionContext);
|
|
2228
|
+
|
|
2229
|
+
this .addType (X3DConstants .VolumePickSensor);
|
|
2230
|
+
|
|
2231
|
+
this .pickingGeometryNode = null;
|
|
2232
|
+
this .picker = new VolumePicker ();
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
VolumePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
|
|
2236
|
+
{
|
|
2237
|
+
constructor: VolumePickSensor,
|
|
2238
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
2239
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2240
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
2241
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
|
|
2242
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
|
|
2243
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
|
|
2244
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
|
|
2245
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
2246
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
|
|
2247
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
|
|
2248
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
|
|
2249
|
+
]),
|
|
2250
|
+
getTypeName: function ()
|
|
2251
|
+
{
|
|
2252
|
+
return "VolumePickSensor";
|
|
2253
|
+
},
|
|
2254
|
+
getComponentName: function ()
|
|
2255
|
+
{
|
|
2256
|
+
return "Picking";
|
|
2257
|
+
},
|
|
2258
|
+
getContainerField: function ()
|
|
2259
|
+
{
|
|
2260
|
+
return "children";
|
|
2261
|
+
},
|
|
2262
|
+
initialize: function ()
|
|
2263
|
+
{
|
|
2264
|
+
X3DPickSensorNode .prototype .initialize .call (this);
|
|
2265
|
+
|
|
2266
|
+
this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
|
|
2267
|
+
|
|
2268
|
+
this .set_pickingGeometry__ ();
|
|
2269
|
+
},
|
|
2270
|
+
set_pickingGeometry__: function ()
|
|
2271
|
+
{
|
|
2272
|
+
this .pickingGeometryNode = X3DCast (X3DConstants .X3DGeometryNode, this .pickingGeometry_);
|
|
2273
|
+
},
|
|
2274
|
+
process: (function ()
|
|
2275
|
+
{
|
|
2276
|
+
var
|
|
2277
|
+
pickingBBox = new Box3 (),
|
|
2278
|
+
targetBBox = new Box3 (),
|
|
2279
|
+
pickingCenter = new Vector3 (0, 0, 0),
|
|
2280
|
+
targetCenter = new Vector3 (0, 0, 0);
|
|
2281
|
+
|
|
2282
|
+
return function ()
|
|
2283
|
+
{
|
|
2284
|
+
if (this .pickingGeometryNode)
|
|
2285
|
+
{
|
|
2286
|
+
var
|
|
2287
|
+
modelMatrices = this .getModelMatrices (),
|
|
2288
|
+
targets = this .getTargets ();
|
|
2289
|
+
|
|
2290
|
+
switch (this .getIntersectionType ())
|
|
2291
|
+
{
|
|
2292
|
+
case IntersectionType .BOUNDS:
|
|
2293
|
+
{
|
|
2294
|
+
// Intersect bboxes.
|
|
2295
|
+
|
|
2296
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2297
|
+
{
|
|
2298
|
+
var modelMatrix = modelMatrices [m];
|
|
2299
|
+
|
|
2300
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2301
|
+
|
|
2302
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2303
|
+
{
|
|
2304
|
+
var target = targets [t];
|
|
2305
|
+
|
|
2306
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2307
|
+
|
|
2308
|
+
if (pickingBBox .intersectsBox (targetBBox))
|
|
2309
|
+
{
|
|
2310
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2311
|
+
targetCenter .assign (targetBBox .center);
|
|
2312
|
+
|
|
2313
|
+
target .intersected = true;
|
|
2314
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
// Send events.
|
|
2320
|
+
|
|
2321
|
+
var
|
|
2322
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2323
|
+
active = Boolean (pickedGeometries .length);
|
|
2324
|
+
|
|
2325
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2326
|
+
|
|
2327
|
+
if (active !== this .isActive_ .getValue ())
|
|
2328
|
+
this .isActive_ = active;
|
|
2329
|
+
|
|
2330
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
2331
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
2332
|
+
|
|
2333
|
+
break;
|
|
2334
|
+
}
|
|
2335
|
+
case IntersectionType .GEOMETRY:
|
|
2336
|
+
{
|
|
2337
|
+
// Intersect geometry.
|
|
2338
|
+
|
|
2339
|
+
var picker = this .picker;
|
|
2340
|
+
|
|
2341
|
+
for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
|
|
2342
|
+
{
|
|
2343
|
+
var
|
|
2344
|
+
modelMatrix = modelMatrices [m],
|
|
2345
|
+
pickingShape = this .getPickShape (this .pickingGeometryNode);
|
|
2346
|
+
|
|
2347
|
+
pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
|
|
2348
|
+
|
|
2349
|
+
picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
|
|
2350
|
+
|
|
2351
|
+
for (var t = 0, tLength = targets .size; t < tLength; ++ t)
|
|
2352
|
+
{
|
|
2353
|
+
var
|
|
2354
|
+
target = targets [t],
|
|
2355
|
+
targetShape = this .getPickShape (target .geometryNode);
|
|
2356
|
+
|
|
2357
|
+
targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
|
|
2358
|
+
|
|
2359
|
+
picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
|
|
2360
|
+
|
|
2361
|
+
if (picker .contactTest ())
|
|
2362
|
+
{
|
|
2363
|
+
pickingCenter .assign (pickingBBox .center);
|
|
2364
|
+
targetCenter .assign (targetBBox .center);
|
|
2365
|
+
|
|
2366
|
+
target .intersected = true;
|
|
2367
|
+
target .distance = pickingCenter .distance (targetCenter);
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
// Send events.
|
|
2373
|
+
|
|
2374
|
+
var
|
|
2375
|
+
pickedGeometries = this .getPickedGeometries (),
|
|
2376
|
+
active = Boolean (pickedGeometries .length);
|
|
2377
|
+
|
|
2378
|
+
pickedGeometries .remove (0, pickedGeometries .length, null);
|
|
2379
|
+
|
|
2380
|
+
if (active !== this .isActive_ .getValue ())
|
|
2381
|
+
this .isActive_ = active;
|
|
2382
|
+
|
|
2383
|
+
if (! this .pickedGeometry_ .equals (pickedGeometries))
|
|
2384
|
+
this .pickedGeometry_ = pickedGeometries;
|
|
2385
|
+
|
|
2386
|
+
break;
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
X3DPickSensorNode .prototype .process .call (this);
|
|
2392
|
+
};
|
|
2393
|
+
})(),
|
|
2394
|
+
});
|
|
2395
|
+
|
|
2396
|
+
return VolumePickSensor;
|
|
2397
|
+
});
|
|
2398
|
+
|
|
2399
|
+
|
|
2400
|
+
|
|
2401
|
+
/*******************************************************************************
|
|
2402
|
+
*
|
|
2403
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2404
|
+
*
|
|
2405
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2406
|
+
*
|
|
2407
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2408
|
+
*
|
|
2409
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2410
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2411
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2412
|
+
* create3000.
|
|
2413
|
+
*
|
|
2414
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2415
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2416
|
+
* permission of create3000.
|
|
2417
|
+
*
|
|
2418
|
+
* NON-MILITARY USE ONLY
|
|
2419
|
+
*
|
|
2420
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2421
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2422
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2423
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2424
|
+
*
|
|
2425
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2426
|
+
*
|
|
2427
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2428
|
+
*
|
|
2429
|
+
* This file is part of the X_ITE Project.
|
|
2430
|
+
*
|
|
2431
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2432
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2433
|
+
* Free Software Foundation.
|
|
2434
|
+
*
|
|
2435
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2436
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2437
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2438
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2439
|
+
*
|
|
2440
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2441
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2442
|
+
* copy of the GPLv3 License.
|
|
2443
|
+
*
|
|
2444
|
+
* For Silvio, Joy and Adi.
|
|
2445
|
+
*
|
|
2446
|
+
******************************************************************************/
|
|
2447
|
+
|
|
2448
|
+
|
|
2449
|
+
define (require .getComponentUrl ("picking"), [
|
|
2450
|
+
"x_ite/Components",
|
|
2451
|
+
"x_ite/Components/Picking/LinePickSensor",
|
|
2452
|
+
"x_ite/Components/Picking/PickableGroup",
|
|
2453
|
+
"x_ite/Components/Picking/PointPickSensor",
|
|
2454
|
+
"x_ite/Components/Picking/PrimitivePickSensor",
|
|
2455
|
+
"x_ite/Components/Picking/VolumePickSensor",
|
|
2456
|
+
"x_ite/Components/Picking/X3DPickSensorNode",
|
|
2457
|
+
"x_ite/Components/Picking/X3DPickableObject",
|
|
2458
|
+
require .getComponentUrl ("rigid-body-physics"),
|
|
2459
|
+
],
|
|
2460
|
+
function (Components,
|
|
2461
|
+
LinePickSensor,
|
|
2462
|
+
PickableGroup,
|
|
2463
|
+
PointPickSensor,
|
|
2464
|
+
PrimitivePickSensor,
|
|
2465
|
+
VolumePickSensor,
|
|
2466
|
+
X3DPickSensorNode,
|
|
2467
|
+
X3DPickableObject)
|
|
2468
|
+
{
|
|
2469
|
+
"use strict";
|
|
2470
|
+
|
|
2471
|
+
Components .addComponent ({
|
|
2472
|
+
name: "Picking",
|
|
2473
|
+
types:
|
|
2474
|
+
{
|
|
2475
|
+
LinePickSensor: LinePickSensor,
|
|
2476
|
+
PickableGroup: PickableGroup,
|
|
2477
|
+
PointPickSensor: PointPickSensor,
|
|
2478
|
+
PrimitivePickSensor: PrimitivePickSensor,
|
|
2479
|
+
VolumePickSensor: VolumePickSensor,
|
|
2480
|
+
},
|
|
2481
|
+
abstractTypes:
|
|
2482
|
+
{
|
|
2483
|
+
X3DPickSensorNode: X3DPickSensorNode,
|
|
2484
|
+
X3DPickableObject: X3DPickableObject,
|
|
2485
|
+
},
|
|
2486
|
+
});
|
|
2487
|
+
});
|
|
2488
|
+
|
|
2489
|
+
|
|
2490
|
+
})
|
|
2491
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|