x_ite 4.0.5 → 4.7.5
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/settings.json +15 -0
- package/.vscode/tasks.json +25 -0
- package/Makefile +55 -15
- package/README.md +13 -130
- package/build/bin/dist.pl +156 -0
- package/build/bin/version-number.pl +25 -0
- package/build/{version.pl → bin/version.pl} +64 -21
- 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 +2 -0
- package/build/parts/default.start.frag +6 -0
- package/build/parts/x_ite.end.frag +23 -0
- package/build/parts/x_ite.start.frag +8 -0
- package/build/x_ite.build.js +18 -0
- package/dist/LICENSE.txt +49 -0
- package/dist/assets/components/annotation.js +813 -0
- package/dist/assets/components/annotation.min.js +1 -0
- package/dist/assets/components/cad-geometry.js +1037 -0
- package/dist/assets/components/cad-geometry.min.js +1 -0
- package/dist/assets/components/cube-map-texturing.js +1212 -0
- package/dist/assets/components/cube-map-texturing.min.js +1 -0
- package/dist/assets/components/dis.js +908 -0
- package/dist/assets/components/dis.min.js +1 -0
- package/dist/assets/components/event-utilities.js +1114 -0
- package/dist/assets/components/event-utilities.min.js +1 -0
- package/dist/assets/components/geometry2d.js +2190 -0
- package/dist/assets/components/geometry2d.min.js +1 -0
- package/dist/assets/components/geospatial.js +3850 -0
- package/dist/assets/components/geospatial.min.js +2 -0
- package/dist/assets/components/h-anim.js +1084 -0
- package/dist/assets/components/h-anim.min.js +1 -0
- package/dist/assets/components/key-device-sensor.js +850 -0
- package/dist/assets/components/key-device-sensor.min.js +1 -0
- package/dist/assets/components/layout.js +2008 -0
- package/dist/assets/components/layout.min.js +1 -0
- package/dist/assets/components/nurbs.js +5388 -0
- package/dist/assets/components/nurbs.min.js +2 -0
- package/dist/assets/components/particle-systems.js +4216 -0
- package/dist/assets/components/particle-systems.min.js +2 -0
- package/dist/assets/components/picking.js +2481 -0
- package/dist/assets/components/picking.min.js +1 -0
- package/dist/assets/components/projective-texture-mapping.js +813 -0
- package/dist/assets/components/projective-texture-mapping.min.js +1 -0
- package/dist/assets/components/rigid-body-physics.js +4569 -0
- package/dist/assets/components/rigid-body-physics.min.js +59 -0
- package/dist/assets/components/scripting.js +801 -0
- package/dist/assets/components/scripting.min.js +1 -0
- package/dist/assets/components/texturing-3d.js +10054 -0
- package/dist/assets/components/texturing-3d.min.js +48 -0
- package/dist/assets/components/volume-rendering.js +3966 -0
- package/dist/assets/components/volume-rendering.min.js +3 -0
- package/dist/assets/components/x_ite.js +285 -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 +16 -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 +108 -0
- package/dist/assets/shaders/webgl1/Phong.fs +838 -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 +541 -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 +109 -0
- package/dist/assets/shaders/webgl2/Phong.fs +1014 -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 +696 -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 +180 -59
- package/dist/x_ite.js +74696 -68048
- package/dist/x_ite.min.js +42 -41
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +5 -0
- package/docs/Accessing-the-External-Browser.md +290 -0
- package/docs/Browser-Support.md +47 -0
- package/docs/Custom-Shaders.md +905 -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 +1240 -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 +1026 -0
- package/docs/reference/Browser-Services.md +333 -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 +334 -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 +76 -54
- package/package.json +41 -24
- package/src/assets/components/annotation.js +87 -0
- package/src/assets/components/cad-geometry.js +88 -0
- package/src/assets/components/cube-map-texturing.js +78 -0
- package/src/assets/components/dis.js +84 -0
- package/src/assets/components/event-utilities.js +93 -0
- package/src/assets/components/geometry2d.js +93 -0
- package/src/assets/components/geospatial.js +102 -0
- package/src/assets/components/h-anim.js +83 -0
- package/src/assets/components/key-device-sensor.js +78 -0
- package/src/assets/components/layout.js +87 -0
- package/src/assets/components/nurbs.js +118 -0
- package/src/assets/components/particle-systems.js +105 -0
- package/src/assets/components/picking.js +87 -0
- package/src/assets/components/projective-texture-mapping.js +75 -0
- package/src/assets/components/rigid-body-physics.js +123 -0
- package/src/assets/components/scripting.js +72 -0
- package/src/assets/components/texturing-3d.js +91 -0
- package/src/assets/components/volume-rendering.js +118 -0
- package/src/assets/components/x_ite.js +69 -0
- 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 +22 -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 +148 -0
- package/src/assets/shaders/webgl1/Phong.fs +173 -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 +89 -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/assets/shaders/webgl1/include/Pack.glsl +51 -0
- package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
- package/src/assets/shaders/webgl1/include/Shadow.glsl +310 -0
- 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 +149 -0
- package/src/assets/shaders/webgl2/Phong.fs +171 -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 +88 -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 +83 -164
- package/src/dummy.js +1 -0
- package/src/example.html +8 -7
- package/src/examples.js +150 -0
- package/src/lib/ammojs/AmmoJS.js +58 -0
- package/src/lib/ammojs/Makefile +26 -0
- package/src/lib/ammojs/ammo.idl +1031 -0
- package/src/lib/ammojs/ammo.js +40 -0
- package/src/lib/jpeg/jpeg.js +1019 -0
- package/src/lib/nurbs/extras/sample.js +242 -0
- package/src/lib/nurbs/nurbs.js +342 -0
- package/src/lib/nurbs/src/evaluate.js +413 -0
- package/src/lib/nurbs/src/numerical-derivative.js +54 -0
- package/src/lib/nurbs/src/support.js +151 -0
- package/src/lib/nurbs/src/transform.js +78 -0
- package/src/lib/nurbs/src/utils/accessor-preamble.js +33 -0
- package/src/lib/nurbs/src/utils/bisection-search.js +28 -0
- package/src/lib/nurbs/src/utils/cache-key.js +57 -0
- package/src/lib/nurbs/src/utils/create-accessors.js +110 -0
- package/src/lib/nurbs/src/utils/infer-type.js +52 -0
- package/src/lib/nurbs/src/utils/is-array-like.js +10 -0
- package/src/lib/nurbs/src/utils/is-ndarray-like.js +18 -0
- package/src/lib/nurbs/src/utils/is-ndarray.js +21 -0
- package/src/lib/nurbs/src/utils/ndloop.js +23 -0
- package/src/lib/nurbs/src/utils/size-getter.js +22 -0
- package/src/lib/nurbs/src/utils/variable.js +31 -0
- package/src/locale/de.po +8 -3
- package/src/locale/fr.po +9 -4
- package/src/locale/gettext.js +3 -3
- package/src/spinner.css +21 -8
- package/src/standard/Geospatial/Geodetic.js +48 -48
- package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
- package/src/standard/Geospatial/UniversalTransverseMercator.js +43 -43
- package/src/standard/Math/Algorithm.js +25 -41
- 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 +97 -0
- 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 +457 -284
- package/src/standard/Math/Geometry/Camera.js +24 -15
- package/src/standard/Math/Geometry/Cylinder3.js +13 -13
- package/src/standard/Math/Geometry/Line3.js +61 -53
- package/src/standard/Math/Geometry/Plane3.js +16 -16
- 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 +6 -6
- package/src/standard/Math/Geometry/Triangle3.js +80 -88
- package/src/standard/Math/Geometry/ViewVolume.js +315 -116
- package/src/standard/Math/Numbers/Color3.js +45 -29
- package/src/standard/Math/Numbers/Color4.js +25 -14
- package/src/standard/Math/Numbers/Complex.js +15 -22
- package/src/standard/Math/Numbers/Matrix2.js +37 -17
- package/src/standard/Math/Numbers/Matrix3.js +181 -212
- package/src/standard/Math/Numbers/Matrix4.js +204 -262
- package/src/standard/Math/Numbers/Quaternion.js +60 -147
- package/src/standard/Math/Numbers/Rotation4.js +197 -129
- package/src/standard/Math/Numbers/Vector2.js +53 -109
- package/src/standard/Math/Numbers/Vector3.js +75 -144
- package/src/standard/Math/Numbers/Vector4.js +85 -155
- package/src/standard/Math/Utility/BVH.js +35 -30
- package/src/standard/Math/Utility/MatrixStack.js +6 -9
- package/src/standard/Networking/BinaryTransport.js +8 -8
- package/src/standard/Time/MicroTime.js +79 -0
- package/src/standard/Utility/DataStorage.js +40 -17
- 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 +386 -0
- package/src/x_ite/Base/Events.js +22 -30
- package/src/x_ite/Base/X3DChildObject.js +35 -19
- package/src/x_ite/Base/X3DEventObject.js +10 -12
- package/src/x_ite/Base/X3DObject.js +63 -43
- package/src/x_ite/Basic/FieldDefinitionArray.js +16 -10
- package/src/x_ite/Basic/X3DArrayField.js +3 -430
- package/src/x_ite/Basic/X3DBaseNode.js +551 -288
- package/src/x_ite/Basic/X3DField.js +133 -96
- package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
- package/src/x_ite/Basic/X3DObjectArrayField.js +545 -0
- package/src/x_ite/Basic/X3DTypedArrayField.js +839 -0
- package/src/x_ite/Bits/TraverseType.js +2 -5
- package/src/x_ite/Bits/X3DConstants.js +12 -322
- package/src/x_ite/Browser/Core/BrowserOptions.js +205 -77
- package/src/x_ite/Browser/Core/BrowserProperties.js +2 -4
- package/src/x_ite/Browser/Core/BrowserTimings.js +16 -15
- package/src/x_ite/Browser/Core/ContextMenu.js +202 -80
- package/src/x_ite/Browser/Core/Notification.js +14 -6
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
- package/src/x_ite/Browser/Core/RenderingProperties.js +10 -11
- package/src/x_ite/Browser/Core/Shading.js +66 -0
- package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
- package/src/x_ite/Browser/Core/X3DCoreContext.js +495 -48
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -23
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +12 -20
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +82 -34
- package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +3 -5
- package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +3 -5
- package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +12 -9
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +60 -42
- package/src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js +16 -20
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
- package/src/x_ite/Browser/Geometry3D/BoxOptions.js +17 -21
- package/src/x_ite/Browser/Geometry3D/ConeOptions.js +2 -4
- package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +2 -4
- package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +2 -4
- package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +3 -5
- 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/Interpolation/CatmullRomSplineInterpolator.js +12 -12
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1.js +2 -4
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +2 -4
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +22 -200
- package/src/x_ite/Browser/Layout/ScreenText.js +287 -295
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +15 -12
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +18 -12
- package/src/x_ite/Browser/NURBS/NURBS.js +481 -0
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +587 -127
- package/src/x_ite/Browser/Navigation/FlyViewer.js +23 -5
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +402 -18
- package/src/x_ite/Browser/Navigation/NoneViewer.js +13 -3
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +46 -28
- package/src/x_ite/Browser/Navigation/WalkViewer.js +45 -17
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +414 -207
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +65 -48
- package/src/x_ite/Browser/Navigation/X3DViewer.js +99 -45
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +39 -38
- package/src/x_ite/Browser/Networking/urls.js +34 -5
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +7 -9
- 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 +89 -30
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer.js +1 -3
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +33 -15
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +39 -151
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
- package/src/x_ite/Browser/Shaders/Shader.js +150 -50
- package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +94 -77
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +220 -5
- 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/Sound/X3DSoundContext.js +1 -20
- package/src/x_ite/Browser/Text/PolygonText.js +165 -359
- 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 +58 -84
- 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 +148 -41
- 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 +2 -2
- 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 -182
- package/src/x_ite/Browser/X3DBrowserContext.js +77 -43
- 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/{PointingDeviceSensor/TouchGroup.js → Annotation/GroupAnnotation.js} +30 -24
- 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 +6 -8
- package/src/x_ite/Components/CADGeometry/CADFace.js +137 -33
- package/src/x_ite/Components/CADGeometry/CADLayer.js +5 -18
- package/src/x_ite/Components/CADGeometry/CADPart.js +6 -12
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +20 -36
- package/src/x_ite/Components/CADGeometry/QuadSet.js +11 -24
- package/src/x_ite/Components/CADGeometry/X3DProductStructureChildNode.js +2 -4
- package/src/x_ite/Components/Core/MetadataBoolean.js +2 -4
- package/src/x_ite/Components/Core/MetadataDouble.js +2 -4
- package/src/x_ite/Components/Core/MetadataFloat.js +2 -4
- package/src/x_ite/Components/Core/MetadataInteger.js +2 -4
- package/src/x_ite/Components/Core/MetadataSet.js +2 -4
- package/src/x_ite/Components/Core/MetadataString.js +2 -4
- package/src/x_ite/Components/Core/WorldInfo.js +18 -10
- package/src/x_ite/Components/Core/X3DBindableNode.js +5 -36
- package/src/x_ite/Components/Core/X3DChildNode.js +16 -5
- package/src/x_ite/Components/Core/X3DInfoNode.js +2 -4
- package/src/x_ite/Components/Core/X3DMetadataObject.js +1 -3
- package/src/x_ite/Components/Core/X3DNode.js +2 -64
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +190 -210
- package/src/x_ite/Components/Core/X3DSensorNode.js +2 -4
- package/src/x_ite/Components/Core.js +111 -0
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +42 -50
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +41 -42
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +44 -59
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +48 -46
- package/src/x_ite/Components/DIS/DISEntityManager.js +2 -4
- package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +2 -4
- package/src/x_ite/Components/DIS/EspduTransform.js +13 -9
- package/src/x_ite/Components/DIS/ReceiverPdu.js +13 -9
- package/src/x_ite/Components/DIS/SignalPdu.js +13 -9
- package/src/x_ite/Components/DIS/TransmitterPdu.js +13 -9
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +2 -4
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +15 -18
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +59 -7
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +12 -10
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +2 -4
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +149 -143
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +61 -22
- package/src/x_ite/Components/EnvironmentalEffects.js +90 -0
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +121 -121
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +173 -53
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +33 -31
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +19 -11
- package/src/x_ite/Components/EnvironmentalSensor.js +81 -0
- package/src/x_ite/Components/EventUtilities/BooleanFilter.js +2 -4
- package/src/x_ite/Components/EventUtilities/BooleanSequencer.js +2 -4
- package/src/x_ite/Components/EventUtilities/BooleanToggle.js +2 -4
- package/src/x_ite/Components/EventUtilities/BooleanTrigger.js +2 -4
- package/src/x_ite/Components/EventUtilities/IntegerSequencer.js +2 -4
- package/src/x_ite/Components/EventUtilities/IntegerTrigger.js +2 -4
- package/src/x_ite/Components/EventUtilities/TimeTrigger.js +2 -4
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +2 -4
- package/src/x_ite/Components/EventUtilities/X3DTriggerNode.js +2 -4
- package/src/x_ite/Components/Followers/ColorChaser.js +3 -7
- package/src/x_ite/Components/Followers/ColorDamper.js +3 -7
- package/src/x_ite/Components/Followers/CoordinateChaser.js +3 -11
- package/src/x_ite/Components/Followers/CoordinateDamper.js +2 -10
- package/src/x_ite/Components/Followers/OrientationChaser.js +9 -7
- package/src/x_ite/Components/Followers/OrientationDamper.js +9 -7
- package/src/x_ite/Components/Followers/PositionChaser.js +3 -7
- package/src/x_ite/Components/Followers/PositionChaser2D.js +3 -7
- package/src/x_ite/Components/Followers/PositionDamper.js +3 -7
- package/src/x_ite/Components/Followers/PositionDamper2D.js +3 -7
- package/src/x_ite/Components/Followers/ScalarChaser.js +7 -7
- package/src/x_ite/Components/Followers/ScalarDamper.js +3 -7
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +3 -11
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +3 -11
- package/src/x_ite/Components/Followers/X3DChaserNode.js +26 -26
- package/src/x_ite/Components/Followers/X3DDamperNode.js +6 -10
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +11 -11
- package/src/x_ite/Components/Followers.js +120 -0
- package/src/x_ite/Components/Geometry2D/Arc2D.js +28 -30
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +95 -93
- package/src/x_ite/Components/Geometry2D/Circle2D.js +16 -15
- package/src/x_ite/Components/Geometry2D/Disk2D.js +80 -88
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +13 -19
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +12 -18
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +13 -13
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +31 -30
- package/src/x_ite/Components/Geometry3D/Box.js +12 -12
- package/src/x_ite/Components/Geometry3D/Cone.js +34 -36
- package/src/x_ite/Components/Geometry3D/Cylinder.js +52 -54
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +90 -52
- package/src/x_ite/Components/Geometry3D/Extrusion.js +472 -388
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +193 -163
- package/src/x_ite/Components/Geometry3D/Sphere.js +17 -19
- package/src/x_ite/Components/Geometry3D.js +90 -0
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +124 -61
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +54 -36
- package/src/x_ite/Components/Geospatial/GeoLOD.js +190 -98
- package/src/x_ite/Components/Geospatial/GeoLocation.js +8 -10
- package/src/x_ite/Components/Geospatial/GeoMetadata.js +2 -4
- package/src/x_ite/Components/Geospatial/GeoOrigin.js +2 -4
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +4 -4
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +10 -7
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +4 -4
- package/src/x_ite/Components/Geospatial/GeoTransform.js +13 -13
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +131 -78
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +7 -9
- package/src/x_ite/Components/Grouping/Group.js +5 -7
- package/src/x_ite/Components/Grouping/StaticGroup.js +194 -22
- package/src/x_ite/Components/Grouping/Switch.js +174 -25
- package/src/x_ite/Components/Grouping/Transform.js +5 -7
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +70 -16
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +442 -151
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +53 -29
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +6 -9
- package/src/x_ite/Components/Grouping.js +93 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +8 -10
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +360 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +108 -23
- package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +14 -14
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +14 -16
- package/src/x_ite/Components/Interpolation/ColorInterpolator.js +13 -11
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator.js +21 -13
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator2D.js +19 -11
- package/src/x_ite/Components/Interpolation/EaseInEaseOut.js +8 -8
- package/src/x_ite/Components/Interpolation/NormalInterpolator.js +28 -14
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +27 -16
- package/src/x_ite/Components/Interpolation/PositionInterpolator.js +10 -8
- package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +10 -8
- package/src/x_ite/Components/Interpolation/ScalarInterpolator.js +2 -4
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator.js +7 -9
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator2D.js +7 -9
- package/src/x_ite/Components/Interpolation/SplineScalarInterpolator.js +7 -9
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +10 -11
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +2 -4
- package/src/x_ite/Components/Interpolation.js +111 -0
- package/src/x_ite/Components/KeyDeviceSensor/KeySensor.js +72 -8
- package/src/x_ite/Components/KeyDeviceSensor/StringSensor.js +65 -4
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +5 -29
- package/src/x_ite/Components/Layering/Layer.js +14 -6
- package/src/x_ite/Components/Layering/LayerSet.js +6 -10
- package/src/x_ite/Components/Layering/Viewport.js +10 -12
- package/src/x_ite/Components/Layering/X3DLayerNode.js +76 -69
- package/src/x_ite/Components/Layering/X3DViewportNode.js +2 -6
- package/src/x_ite/Components/Layering.js +84 -0
- package/src/x_ite/Components/Layout/Layout.js +163 -173
- package/src/x_ite/Components/Layout/LayoutGroup.js +20 -19
- package/src/x_ite/Components/Layout/LayoutLayer.js +12 -9
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +4 -8
- package/src/x_ite/Components/Layout/ScreenGroup.js +63 -56
- package/src/x_ite/Components/Layout/X3DLayoutNode.js +2 -4
- package/src/x_ite/Components/Lighting/DirectionalLight.js +41 -31
- package/src/x_ite/Components/Lighting/PointLight.js +117 -104
- package/src/x_ite/Components/Lighting/SpotLight.js +77 -53
- package/src/x_ite/Components/Lighting/X3DLightNode.js +90 -68
- package/src/x_ite/Components/Lighting.js +81 -0
- package/src/x_ite/Components/NURBS/Contour2D.js +47 -5
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +69 -5
- package/src/x_ite/Components/NURBS/CoordinateDouble.js +2 -4
- package/src/x_ite/Components/NURBS/NurbsCurve.js +140 -10
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +117 -8
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +139 -10
- package/src/x_ite/Components/NURBS/NurbsPatchSurface.js +3 -5
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +125 -10
- package/src/x_ite/Components/NURBS/NurbsSet.js +92 -11
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +96 -12
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +88 -7
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +88 -7
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +62 -13
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +41 -6
- package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +2 -4
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +333 -7
- package/src/x_ite/Components/NURBS/X3DParametricGeometryNode.js +9 -5
- package/src/x_ite/Components/Navigation/Billboard.js +14 -15
- package/src/x_ite/Components/Navigation/Collision.js +13 -12
- package/src/x_ite/Components/Navigation/LOD.js +221 -66
- package/src/x_ite/Components/Navigation/NavigationInfo.js +110 -99
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +138 -45
- package/src/x_ite/Components/Navigation/Viewpoint.js +55 -33
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +18 -10
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +241 -181
- package/src/x_ite/Components/Navigation.js +93 -0
- package/src/x_ite/Components/Networking/Anchor.js +24 -28
- package/src/x_ite/Components/Networking/Inline.js +68 -50
- package/src/x_ite/Components/Networking/LoadSensor.js +2 -4
- package/src/x_ite/Components/Networking/X3DNetworkSensorNode.js +2 -4
- package/src/x_ite/Components/Networking/X3DUrlObject.js +93 -11
- package/src/x_ite/Components/Networking.js +84 -0
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +6 -8
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +8 -4
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +7 -4
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +4 -4
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +451 -287
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +7 -4
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +53 -40
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +62 -55
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +133 -123
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +25 -22
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +28 -27
- package/src/x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode.js +2 -4
- package/src/x_ite/Components/Picking/LinePickSensor.js +253 -10
- package/src/x_ite/Components/Picking/PickableGroup.js +121 -10
- package/src/x_ite/Components/Picking/PointPickSensor.js +262 -12
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +176 -8
- package/src/x_ite/Components/Picking/VolumePickSensor.js +152 -8
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +378 -7
- package/src/x_ite/Components/Picking/X3DPickableObject.js +22 -4
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +33 -15
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +7 -4
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +2 -4
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +4 -4
- package/src/x_ite/Components/PointingDeviceSensor/X3DDragSensorNode.js +4 -4
- package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +3 -5
- package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +2 -4
- package/src/x_ite/Components/PointingDeviceSensor.js +90 -0
- 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 +12 -16
- package/src/x_ite/Components/Rendering/Color.js +62 -17
- package/src/x_ite/Components/Rendering/ColorRGBA.js +65 -17
- package/src/x_ite/Components/Rendering/Coordinate.js +4 -4
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +68 -81
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +20 -19
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +10 -7
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +21 -23
- package/src/x_ite/Components/Rendering/LineSet.js +54 -37
- package/src/x_ite/Components/Rendering/Normal.js +65 -13
- package/src/x_ite/Components/Rendering/PointSet.js +52 -33
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +10 -14
- package/src/x_ite/Components/Rendering/TriangleSet.js +2 -4
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +9 -13
- package/src/x_ite/Components/Rendering/X3DColorNode.js +13 -12
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +118 -79
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +103 -44
- package/src/x_ite/Components/Rendering/X3DGeometricPropertyNode.js +2 -4
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +722 -591
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +129 -92
- package/src/x_ite/Components/Rendering/X3DNormalNode.js +2 -4
- package/src/x_ite/Components/Rendering.js +132 -0
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +116 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +199 -11
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +436 -11
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +118 -10
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +192 -9
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +84 -8
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +20 -14
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +200 -12
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +14 -4
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +424 -17
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +295 -19
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +162 -10
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +135 -8
- package/src/x_ite/Components/RigidBodyPhysics/UniversalJoint.js +10 -6
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +93 -9
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +5 -8
- package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +150 -4
- package/src/x_ite/Components/Scripting/Script.js +156 -105
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +3 -7
- package/src/x_ite/Components/Shaders/ComposedShader.js +38 -53
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +38 -15
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +32 -14
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +32 -14
- package/src/x_ite/Components/Shaders/PackagedShader.js +19 -17
- package/src/x_ite/Components/Shaders/ProgramShader.js +2 -4
- package/src/x_ite/Components/Shaders/ShaderPart.js +38 -26
- package/src/x_ite/Components/Shaders/ShaderProgram.js +16 -14
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +836 -699
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +61 -101
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +2 -4
- package/src/x_ite/Components/Shaders.js +102 -0
- package/src/x_ite/Components/Shape/Appearance.js +179 -69
- package/src/x_ite/Components/Shape/FillProperties.js +65 -8
- package/src/x_ite/Components/Shape/LineProperties.js +29 -9
- package/src/x_ite/Components/Shape/Material.js +50 -64
- package/src/x_ite/Components/Shape/PointProperties.js +162 -0
- package/src/x_ite/Components/Shape/Shape.js +116 -68
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +56 -62
- package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
- package/src/x_ite/Components/Shape/X3DAppearanceChildNode.js +2 -4
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +14 -11
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +17 -6
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
- package/src/x_ite/Components/Shape/X3DShapeNode.js +54 -29
- package/src/x_ite/Components/Shape.js +108 -0
- package/src/x_ite/Components/Sound/AudioClip.js +47 -57
- package/src/x_ite/Components/Sound/Sound.js +177 -83
- package/src/x_ite/Components/Sound/X3DSoundNode.js +2 -4
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +38 -24
- package/src/x_ite/Components/Sound.js +81 -0
- package/src/x_ite/Components/Text/FontStyle.js +4 -6
- package/src/x_ite/Components/Text/Text.js +21 -18
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +58 -93
- package/src/x_ite/Components/Text.js +78 -0
- package/src/x_ite/Components/Texturing/ImageTexture.js +57 -67
- package/src/x_ite/Components/Texturing/MovieTexture.js +59 -70
- package/src/x_ite/Components/Texturing/MultiTexture.js +238 -15
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +85 -8
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +47 -8
- package/src/x_ite/Components/Texturing/PixelTexture.js +61 -27
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +72 -22
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +69 -11
- package/src/x_ite/Components/Texturing/TextureProperties.js +98 -69
- package/src/x_ite/Components/Texturing/TextureTransform.js +58 -52
- 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 -97
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +4 -12
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +10 -71
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +5 -14
- package/src/x_ite/Components/Texturing.js +120 -0
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +90 -8
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +106 -16
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +126 -8
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +75 -25
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +74 -24
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +42 -36
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +19 -16
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -8
- package/src/x_ite/Components/Time/TimeSensor.js +68 -38
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +29 -29
- package/src/x_ite/Components/Time.js +75 -0
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +311 -12
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +60 -8
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +219 -10
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +134 -7
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +88 -9
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +311 -15
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +87 -7
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +136 -6
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +224 -13
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +193 -12
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +87 -10
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +97 -9
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +155 -12
- package/src/x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode.js +2 -4
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -5
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +64 -4
- package/src/x_ite/Components/X_ITE/BlendMode.js +206 -0
- package/src/x_ite/Components.js +110 -0
- package/src/x_ite/Configuration/ComponentInfo.js +21 -15
- package/src/x_ite/Configuration/ComponentInfoArray.js +11 -16
- package/src/x_ite/Configuration/ProfileInfo.js +10 -10
- package/src/x_ite/Configuration/ProfileInfoArray.js +10 -3
- package/src/x_ite/Configuration/SupportedComponents.js +312 -303
- package/src/x_ite/Configuration/SupportedNodes.js +44 -716
- package/src/x_ite/Configuration/SupportedProfiles.js +196 -168
- package/src/x_ite/Configuration/UnitInfo.js +22 -8
- package/src/x_ite/Configuration/UnitInfoArray.js +2 -3
- package/src/x_ite/Configuration/X3DInfoArray.js +46 -26
- package/src/x_ite/DEBUG.js +4 -5
- package/src/x_ite/Execution/BindableList.js +99 -34
- package/src/x_ite/Execution/BindableStack.js +65 -74
- package/src/x_ite/Execution/ExportedNode.js +32 -9
- package/src/x_ite/Execution/ImportedNode.js +144 -63
- package/src/x_ite/Execution/Scene.js +33 -35
- package/src/x_ite/Execution/World.js +31 -29
- package/src/x_ite/Execution/X3DExecutionContext.js +452 -194
- package/src/x_ite/Execution/X3DScene.js +303 -74
- package/src/x_ite/{Error.js → Fallback.js} +25 -24
- package/src/x_ite/Fields/ArrayFields.js +315 -112
- package/src/x_ite/Fields/SFBool.js +11 -10
- package/src/x_ite/Fields/SFColor.js +43 -19
- package/src/x_ite/Fields/SFColorRGBA.js +40 -18
- package/src/x_ite/Fields/SFDouble.js +17 -10
- package/src/x_ite/Fields/SFFloat.js +18 -11
- package/src/x_ite/Fields/SFImage.js +47 -38
- package/src/x_ite/Fields/SFInt32.js +10 -9
- package/src/x_ite/Fields/SFMatrix3.js +24 -17
- package/src/x_ite/Fields/SFMatrix4.js +24 -17
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +15 -8
- package/src/x_ite/Fields/SFNode.js +119 -39
- package/src/x_ite/Fields/SFNodeCache.js +89 -0
- package/src/x_ite/Fields/SFRotation.js +42 -27
- package/src/x_ite/Fields/SFString.js +14 -15
- package/src/x_ite/Fields/SFTime.js +12 -11
- package/src/x_ite/Fields/SFVec2.js +17 -14
- package/src/x_ite/Fields/SFVec3.js +23 -17
- package/src/x_ite/Fields/SFVec4.js +25 -19
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +51 -19
- package/src/x_ite/Fields.js +3 -9
- package/src/x_ite/InputOutput/FileLoader.js +264 -181
- package/src/x_ite/InputOutput/Generator.js +136 -60
- package/src/x_ite/Parser/HTMLSupport.js +3 -596
- package/src/x_ite/Parser/JSONParser.js +446 -0
- package/src/x_ite/Parser/Parser.js +617 -652
- package/src/x_ite/Parser/X3DParser.js +176 -0
- package/src/x_ite/Parser/XMLParser.js +359 -94
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +19 -3
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +19 -3
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +120 -61
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +144 -59
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -18
- package/src/x_ite/Rendering/DependentRenderer.js +9 -13
- package/src/x_ite/Rendering/{DepthBuffer.js → TextureBuffer.js} +84 -53
- package/src/x_ite/Rendering/X3DRenderObject.js +640 -531
- package/src/x_ite/Routing/RouteArray.js +38 -16
- package/src/x_ite/Routing/X3DRoute.js +67 -68
- package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
- package/src/x_ite/X3D.js +74 -70
- package/src/x_ite.config.js +91 -0
- package/src/x_ite.css +175 -53
- package/src/x_ite.html +128 -439
- package/src/x_ite.js +87 -25
- package/tests/{SEE.txt → README.md} +1 -0
- package/tests/tests.mdproj +1 -1
- package/x_ite.min.html +128 -439
- package/.bzrignore +0 -3
- package/.npmignore +0 -3
- package/AUTHORS.md +0 -6
- package/STYLE_GUIDE.md +0 -51
- package/X_ITE.sln +0 -56
- package/X_ITE.userprefs +0 -13
- package/build/build.mdproj +0 -24
- package/build/dist.pl +0 -97
- package/build/parts/end.frag +0 -10
- package/build/parts/start.frag +0 -7
- package/dist/LICENCES.txt +0 -344
- package/dist/dist.mdproj +0 -45
- package/dist/images/logo.128.png +0 -0
- package/fonts/fonts.mdproj +0 -29
- package/meta/meta.mdproj +0 -35
- package/require.build.js +0 -15
- package/require.build.min.js +0 -15
- package/src/images/logo.128.png +0 -0
- package/src/lib/jquery-contextMenu/README.md +0 -355
- package/src/lib/jquery-contextMenu/dist/images/cut.png +0 -0
- package/src/lib/jquery-contextMenu/dist/images/door.png +0 -0
- package/src/lib/jquery-contextMenu/dist/images/page_white_add.png +0 -0
- package/src/lib/jquery-contextMenu/dist/images/page_white_copy.png +0 -0
- package/src/lib/jquery-contextMenu/dist/images/page_white_delete.png +0 -0
- package/src/lib/jquery-contextMenu/dist/images/page_white_edit.png +0 -0
- package/src/lib/jquery-contextMenu/dist/images/page_white_paste.png +0 -0
- package/src/lib/jquery-contextMenu/dist/jquery.contextMenu.css +0 -155
- package/src/lib/jquery-contextMenu/dist/jquery.contextMenu.js +0 -1811
- package/src/lib/jquery-contextMenu/dist/jquery.contextMenu.min.css +0 -16
- package/src/lib/jquery-contextMenu/dist/jquery.contextMenu.min.css.map +0 -1
- package/src/lib/jquery-contextMenu/dist/jquery.contextMenu.min.js +0 -18
- package/src/lib/jquery-contextMenu/dist/jquery.contextMenu.min.js.map +0 -1
- package/src/lib/jquery-contextMenu/dist/jquery.ui.position.js +0 -517
- package/src/lib/jquery-contextMenu/dist/jquery.ui.position.min.js +0 -4
- package/src/lib/jquery-contextMenu/package.json +0 -99
- package/src/lib/opentype.js/.npmignore +0 -5
- package/src/locale/de.mo +0 -0
- package/src/locale/fr.mo +0 -0
- package/src/require.config.js +0 -51
- package/src/src.mdproj +0 -729
- package/src/standard/Networking/URI.js +0 -687
- package/src/x_ite/Browser/Shaders/BackgroundSphereFragmentShader.fs +0 -29
- package/src/x_ite/Browser/Shaders/BackgroundSphereVertexShader.vs +0 -22
- package/src/x_ite/Browser/Shaders/Bits/Line3.h +0 -14
- package/src/x_ite/Browser/Shaders/Bits/Plane3.h +0 -47
- package/src/x_ite/Browser/Shaders/Bits/Random.h +0 -31
- package/src/x_ite/Browser/Shaders/Depth.fs +0 -51
- package/src/x_ite/Browser/Shaders/Depth.vs +0 -20
- package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -110
- package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -188
- package/src/x_ite/Browser/Shaders/Phong.fs +0 -255
- package/src/x_ite/Browser/Shaders/Phong.vs +0 -38
- package/src/x_ite/Browser/Shaders/PointSet.fs +0 -64
- package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -61
- package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -55
- package/src/x_ite/Components/H-Anim/HAnimHumanoid.js +0 -118
|
@@ -0,0 +1,3850 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
|
|
3
|
+
var
|
|
4
|
+
define = X3D .define,
|
|
5
|
+
require = X3D .require,
|
|
6
|
+
module = { };
|
|
7
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
|
+
*******************************************************************************
|
|
9
|
+
*
|
|
10
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
11
|
+
*
|
|
12
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
13
|
+
*
|
|
14
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
15
|
+
*
|
|
16
|
+
* The copyright notice above does not evidence any actual of intended
|
|
17
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
18
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
19
|
+
* create3000.
|
|
20
|
+
*
|
|
21
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
22
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
23
|
+
* permission of create3000.
|
|
24
|
+
*
|
|
25
|
+
* NON-MILITARY USE ONLY
|
|
26
|
+
*
|
|
27
|
+
* All create3000 software are effectively free software with a non-military use
|
|
28
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
29
|
+
* source in any way you please with the exception anything that uses it must be
|
|
30
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
31
|
+
*
|
|
32
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
33
|
+
*
|
|
34
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
35
|
+
*
|
|
36
|
+
* This file is part of the X_ITE Project.
|
|
37
|
+
*
|
|
38
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
39
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
40
|
+
* Free Software Foundation.
|
|
41
|
+
*
|
|
42
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
43
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
44
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
45
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
46
|
+
*
|
|
47
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
48
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
49
|
+
* copy of the GPLv3 License.
|
|
50
|
+
*
|
|
51
|
+
* For Silvio, Joy and Adi.
|
|
52
|
+
*
|
|
53
|
+
******************************************************************************/
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
define ('standard/Math/Geometry/Spheroid3',[],function ()
|
|
57
|
+
{
|
|
58
|
+
"use strict";
|
|
59
|
+
|
|
60
|
+
function Spheroid3 (semiMajorAxis, semiMinorAxis)
|
|
61
|
+
{
|
|
62
|
+
switch (arguments .length)
|
|
63
|
+
{
|
|
64
|
+
case 0:
|
|
65
|
+
this .semiMajorAxis = 0; // a
|
|
66
|
+
this .semiMinorAxis = 0; // c
|
|
67
|
+
break;
|
|
68
|
+
case 2:
|
|
69
|
+
this .semiMajorAxis = semiMajorAxis; // a
|
|
70
|
+
this .semiMinorAxis = semiMinorAxis; // c
|
|
71
|
+
break;
|
|
72
|
+
case 3:
|
|
73
|
+
const f_1 = arguments [1];
|
|
74
|
+
this .semiMajorAxis = semiMajorAxis; // a
|
|
75
|
+
this .semiMinorAxis = semiMajorAxis * (1 - 1 / f_1); // c
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Spheroid3 .prototype =
|
|
81
|
+
{
|
|
82
|
+
constructor: Spheroid3,
|
|
83
|
+
getSemiMajorAxis: function ()
|
|
84
|
+
{
|
|
85
|
+
// Returns the semi-major axis (a)
|
|
86
|
+
return this .semiMajorAxis; // a
|
|
87
|
+
},
|
|
88
|
+
getSemiMinorAxis: function ()
|
|
89
|
+
{
|
|
90
|
+
// Returns the semi-minor axis (c)
|
|
91
|
+
return this .semiMinorAxis; // c
|
|
92
|
+
},
|
|
93
|
+
toString: function ()
|
|
94
|
+
{
|
|
95
|
+
return this .semiMajorAxis + " " + this .semiMinorAxis;
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return Spheroid3;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
103
|
+
*******************************************************************************
|
|
104
|
+
*
|
|
105
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
106
|
+
*
|
|
107
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
108
|
+
*
|
|
109
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
110
|
+
*
|
|
111
|
+
* The copyright notice above does not evidence any actual of intended
|
|
112
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
113
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
114
|
+
* create3000.
|
|
115
|
+
*
|
|
116
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
117
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
118
|
+
* permission of create3000.
|
|
119
|
+
*
|
|
120
|
+
* NON-MILITARY USE ONLY
|
|
121
|
+
*
|
|
122
|
+
* All create3000 software are effectively free software with a non-military use
|
|
123
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
124
|
+
* source in any way you please with the exception anything that uses it must be
|
|
125
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
126
|
+
*
|
|
127
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
128
|
+
*
|
|
129
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
130
|
+
*
|
|
131
|
+
* This file is part of the X_ITE Project.
|
|
132
|
+
*
|
|
133
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
134
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
135
|
+
* Free Software Foundation.
|
|
136
|
+
*
|
|
137
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
138
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
139
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
140
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
141
|
+
*
|
|
142
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
143
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
144
|
+
* copy of the GPLv3 License.
|
|
145
|
+
*
|
|
146
|
+
* For Silvio, Joy and Adi.
|
|
147
|
+
*
|
|
148
|
+
******************************************************************************/
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
define ('standard/Geospatial/ReferenceEllipsoids',[
|
|
152
|
+
"standard/Math/Geometry/Spheroid3",
|
|
153
|
+
],
|
|
154
|
+
function (Spheroid3)
|
|
155
|
+
{
|
|
156
|
+
"use strict";
|
|
157
|
+
|
|
158
|
+
const ReferenceEllipsoids =
|
|
159
|
+
{
|
|
160
|
+
// Earth
|
|
161
|
+
// X3D Specification
|
|
162
|
+
AA: new Spheroid3 (6377563.396, 299.3249646, true), // Airy 1830
|
|
163
|
+
AM: new Spheroid3 (6377340.189, 299.3249646, true), // Modified Airy
|
|
164
|
+
AN: new Spheroid3 (6378160, 298.25, true), // Australian National
|
|
165
|
+
BN: new Spheroid3 (6377483.865, 299.1528128, true), // Bessel 1841 (Namibia)
|
|
166
|
+
BR: new Spheroid3 (6377397.155, 299.1528128, true), // Bessel 1841 (Ethiopia Indonesia...)
|
|
167
|
+
CC: new Spheroid3 (6378206.4, 294.9786982, true), // Clarke 1866
|
|
168
|
+
CD: new Spheroid3 (6378249.145, 293.465, true), // Clarke 1880
|
|
169
|
+
EA: new Spheroid3 (6377276.345, 300.8017, true), // Everest (India 1830)
|
|
170
|
+
EB: new Spheroid3 (6377298.556, 300.8017, true), // Everest (Sabah & Sarawak)
|
|
171
|
+
EC: new Spheroid3 (6377301.243, 300.8017, true), // Everest (India 1956)
|
|
172
|
+
ED: new Spheroid3 (6377295.664, 300.8017, true), // Everest (W. Malaysia 1969)
|
|
173
|
+
EE: new Spheroid3 (6377304.063, 300.8017, true), // Everest (W. Malaysia & Singapore 1948)
|
|
174
|
+
EF: new Spheroid3 (6377309.613, 300.8017, true), // Everest (Pakistan)
|
|
175
|
+
FA: new Spheroid3 (6378155, 298.3, true), // Modified Fischer 1960
|
|
176
|
+
HE: new Spheroid3 (6378200, 298.3, true), // Helmert 1906
|
|
177
|
+
HO: new Spheroid3 (6378270, 297, true), // Hough 1960
|
|
178
|
+
ID: new Spheroid3 (6378160, 298.247, true), // Indonesian 1974
|
|
179
|
+
IN: new Spheroid3 (6378388, 297, true), // International 1924
|
|
180
|
+
KA: new Spheroid3 (6378245, 298.3, true), // Krassovsky 1940
|
|
181
|
+
RF: new Spheroid3 (6378137, 298.257222101, true), // Geodetic Reference System 1980 (GRS 80)
|
|
182
|
+
SA: new Spheroid3 (6378160, 298.25, true), // South American 1969
|
|
183
|
+
WD: new Spheroid3 (6378135, 298.26, true), // WGS 72
|
|
184
|
+
WE: new Spheroid3 (6378137, 298.257223563, true), // WGS 84
|
|
185
|
+
// Solar System
|
|
186
|
+
// http://en.wikipedia.de
|
|
187
|
+
// Can someone give me more accurate parameters.
|
|
188
|
+
SUN: new Spheroid3 (696342000, 1 / 9e-6, true),
|
|
189
|
+
MERCURY: new Spheroid3 (2439700, 2439700),
|
|
190
|
+
VENUS: new Spheroid3 (6051800, 6051800),
|
|
191
|
+
MOON: new Spheroid3 (1738140, 1735970),
|
|
192
|
+
MARS: new Spheroid3 (3395428, 3377678), // http://adsabs.harvard.edu/abs/2010EM%26P..106....1A
|
|
193
|
+
JUPITER: new Spheroid3 (71492000, 66854000),
|
|
194
|
+
SATURN: new Spheroid3 (60268000, 54364000),
|
|
195
|
+
URANUS: new Spheroid3 (2555000, 24973000),
|
|
196
|
+
NEPTUNE: new Spheroid3 (24764000, 24341000),
|
|
197
|
+
PLUTO: new Spheroid3 (1153000, 1153000),
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
return ReferenceEllipsoids;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
204
|
+
*******************************************************************************
|
|
205
|
+
*
|
|
206
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
207
|
+
*
|
|
208
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
209
|
+
*
|
|
210
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
211
|
+
*
|
|
212
|
+
* The copyright notice above does not evidence any actual of intended
|
|
213
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
214
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
215
|
+
* create3000.
|
|
216
|
+
*
|
|
217
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
218
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
219
|
+
* permission of create3000.
|
|
220
|
+
*
|
|
221
|
+
* NON-MILITARY USE ONLY
|
|
222
|
+
*
|
|
223
|
+
* All create3000 software are effectively free software with a non-military use
|
|
224
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
225
|
+
* source in any way you please with the exception anything that uses it must be
|
|
226
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
227
|
+
*
|
|
228
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
229
|
+
*
|
|
230
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
231
|
+
*
|
|
232
|
+
* This file is part of the X_ITE Project.
|
|
233
|
+
*
|
|
234
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
235
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
236
|
+
* Free Software Foundation.
|
|
237
|
+
*
|
|
238
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
239
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
240
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
241
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
242
|
+
*
|
|
243
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
244
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
245
|
+
* copy of the GPLv3 License.
|
|
246
|
+
*
|
|
247
|
+
* For Silvio, Joy and Adi.
|
|
248
|
+
*
|
|
249
|
+
******************************************************************************/
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
define ('standard/Geospatial/Geodetic',[
|
|
253
|
+
"standard/Math/Numbers/Vector3",
|
|
254
|
+
"standard/Math/Algorithm",
|
|
255
|
+
],
|
|
256
|
+
function (Vector3,
|
|
257
|
+
Algorithm)
|
|
258
|
+
{
|
|
259
|
+
"use strict";
|
|
260
|
+
|
|
261
|
+
const
|
|
262
|
+
EPS_H = 1e-3,
|
|
263
|
+
EPS_P = 1e-10,
|
|
264
|
+
IMAX = 30;
|
|
265
|
+
|
|
266
|
+
function Geodetic (spheroid, latitudeFirst, radians)
|
|
267
|
+
{
|
|
268
|
+
this .longitudeFirst = ! latitudeFirst;
|
|
269
|
+
this .degrees = ! radians;
|
|
270
|
+
this .a = spheroid .getSemiMajorAxis ();
|
|
271
|
+
this .c = spheroid .getSemiMinorAxis ();
|
|
272
|
+
this .c2a2 = Math .pow (spheroid .getSemiMinorAxis () / this .a, 2);
|
|
273
|
+
this .ecc2 = 1 - this .c2a2;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
Geodetic .prototype =
|
|
277
|
+
{
|
|
278
|
+
constructor: Geodetic,
|
|
279
|
+
convert: function (geodetic, result)
|
|
280
|
+
{
|
|
281
|
+
const elevation = geodetic .z;
|
|
282
|
+
|
|
283
|
+
if (this .longitudeFirst)
|
|
284
|
+
{
|
|
285
|
+
var
|
|
286
|
+
latitude = geodetic .y,
|
|
287
|
+
longitude = geodetic .x;
|
|
288
|
+
}
|
|
289
|
+
else
|
|
290
|
+
{
|
|
291
|
+
var
|
|
292
|
+
latitude = geodetic .x,
|
|
293
|
+
longitude = geodetic .y;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (this .degrees)
|
|
297
|
+
{
|
|
298
|
+
latitude *= Math .PI / 180;
|
|
299
|
+
longitude *= Math .PI / 180;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return this .convertRadians (latitude, longitude, elevation, result);
|
|
303
|
+
},
|
|
304
|
+
convertRadians: function (latitude, longitude, elevation, result)
|
|
305
|
+
{
|
|
306
|
+
const
|
|
307
|
+
slat = Math .sin (latitude),
|
|
308
|
+
slat2 = Math .pow (slat, 2),
|
|
309
|
+
clat = Math .cos (latitude),
|
|
310
|
+
N = this .a / Math .sqrt (1 - this .ecc2 * slat2),
|
|
311
|
+
Nhl = (N + elevation) * clat;
|
|
312
|
+
|
|
313
|
+
return result .set (Nhl * Math .cos (longitude),
|
|
314
|
+
Nhl * Math .sin (longitude),
|
|
315
|
+
(N * this .c2a2 + elevation) * slat);
|
|
316
|
+
},
|
|
317
|
+
apply: function (geocentric, result)
|
|
318
|
+
{
|
|
319
|
+
this .applyRadians (geocentric, result);
|
|
320
|
+
|
|
321
|
+
if (this .degrees)
|
|
322
|
+
{
|
|
323
|
+
result .x *= 180 / Math .PI; // latitude
|
|
324
|
+
result .y *= 180 / Math .PI; // longitude
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (this .longitudeFirst)
|
|
328
|
+
{
|
|
329
|
+
const tmp = result .x;
|
|
330
|
+
|
|
331
|
+
result .x = result .y; // latitude
|
|
332
|
+
result .y = tmp; // longitude
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return result;
|
|
336
|
+
},
|
|
337
|
+
applyRadians: function (geocentric, result)
|
|
338
|
+
{
|
|
339
|
+
const
|
|
340
|
+
x = geocentric .x,
|
|
341
|
+
y = geocentric .y,
|
|
342
|
+
z = geocentric .z;
|
|
343
|
+
|
|
344
|
+
const P = Math .sqrt (x * x + y * y);
|
|
345
|
+
|
|
346
|
+
// Handle pole case.
|
|
347
|
+
if (P == 0)
|
|
348
|
+
return result .set (Math .PI, 0, z - this .c);
|
|
349
|
+
|
|
350
|
+
let
|
|
351
|
+
latitude = 0,
|
|
352
|
+
longitude = Math .atan2 (y, x),
|
|
353
|
+
elevation = 0;
|
|
354
|
+
|
|
355
|
+
let
|
|
356
|
+
a = this .a,
|
|
357
|
+
N = a,
|
|
358
|
+
ecc2 = this .ecc2;
|
|
359
|
+
|
|
360
|
+
for (let i = 0; i < IMAX; ++ i)
|
|
361
|
+
{
|
|
362
|
+
const
|
|
363
|
+
h0 = elevation,
|
|
364
|
+
b0 = latitude;
|
|
365
|
+
|
|
366
|
+
latitude = Math .atan (z / P / (1 - ecc2 * N / (N + elevation)));
|
|
367
|
+
|
|
368
|
+
const sin_p = Math .sin (latitude);
|
|
369
|
+
|
|
370
|
+
N = a / Math .sqrt (1 - ecc2 * sin_p * sin_p);
|
|
371
|
+
elevation = P / Math .cos (latitude) - N;
|
|
372
|
+
|
|
373
|
+
if (Math .abs (elevation - h0) < EPS_H && Math .abs (latitude - b0) < EPS_P)
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
return result .set (latitude, longitude, elevation);
|
|
378
|
+
},
|
|
379
|
+
normal: function (geocentric, result)
|
|
380
|
+
{
|
|
381
|
+
const geodetic = this .applyRadians (geocentric, result);
|
|
382
|
+
|
|
383
|
+
const
|
|
384
|
+
latitude = geodetic .x,
|
|
385
|
+
longitude = geodetic .y;
|
|
386
|
+
|
|
387
|
+
const clat = Math .cos (latitude);
|
|
388
|
+
|
|
389
|
+
const
|
|
390
|
+
nx = Math .cos (longitude) * clat,
|
|
391
|
+
ny = Math .sin (longitude) * clat,
|
|
392
|
+
nz = Math .sin (latitude);
|
|
393
|
+
|
|
394
|
+
return result .set (nx, ny, nz);
|
|
395
|
+
},
|
|
396
|
+
/*
|
|
397
|
+
lerp: function (s, d, t)
|
|
398
|
+
{
|
|
399
|
+
var
|
|
400
|
+
source = this .source .assign (s),
|
|
401
|
+
destination = this .destination .assign (d);
|
|
402
|
+
|
|
403
|
+
var
|
|
404
|
+
RANGE = this .degrees ? 180 : M_PI,
|
|
405
|
+
RANGE1_2 = RANGE / 2,
|
|
406
|
+
RANGE2 = RANGE * 2;
|
|
407
|
+
|
|
408
|
+
var range = 0;
|
|
409
|
+
|
|
410
|
+
if (this .longitudeFirst)
|
|
411
|
+
{
|
|
412
|
+
source .x = Algorithm .interval (source .x, -RANGE, RANGE);
|
|
413
|
+
source .y = Algorithm .interval (source .y, -RANGE1_2, RANGE1_2);
|
|
414
|
+
|
|
415
|
+
destination .x = Algorithm .interval (destination .x, -RANGE, RANGE);
|
|
416
|
+
destination .y = Algorithm .interval (destination .y, -RANGE1_2, RANGE1_2);
|
|
417
|
+
|
|
418
|
+
range = Math .abs (destination .x - source .x);
|
|
419
|
+
}
|
|
420
|
+
else
|
|
421
|
+
{
|
|
422
|
+
source .x = Algorithm .interval (source .x, -RANGE1_2, RANGE1_2);
|
|
423
|
+
source .y = Algorithm .interval (source .y, -RANGE, RANGE);
|
|
424
|
+
|
|
425
|
+
destination .x = Algorithm .interval (destination .x, -RANGE1_2, RANGE1_2);
|
|
426
|
+
destination .y = Algorithm .interval (destination .y, -RANGE, RANGE);
|
|
427
|
+
|
|
428
|
+
range = Math .abs (destination .y - source .y);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (range <= RANGE)
|
|
432
|
+
return source .lerp (destination, t);
|
|
433
|
+
|
|
434
|
+
var step = (RANGE2 - range) * t;
|
|
435
|
+
|
|
436
|
+
if (this .longitudeFirst)
|
|
437
|
+
{
|
|
438
|
+
var longitude = source .x < destination .x ? source .x - step : source .x + step;
|
|
439
|
+
|
|
440
|
+
if (longitude < -RANGE)
|
|
441
|
+
longitude += RANGE2;
|
|
442
|
+
|
|
443
|
+
else if (longitude > RANGE)
|
|
444
|
+
longitude -= RANGE2;
|
|
445
|
+
|
|
446
|
+
return source .set (longitude,
|
|
447
|
+
source .y + t * (destination .y - source .y),
|
|
448
|
+
source .z + t * (destination .z - source .z));
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
var longitude = source .y < destination .y ? source .y - step : source .y + step;
|
|
452
|
+
|
|
453
|
+
if (longitude < -RANGE)
|
|
454
|
+
longitude += RANGE2;
|
|
455
|
+
|
|
456
|
+
else if (longitude > RANGE)
|
|
457
|
+
longitude -= RANGE2;
|
|
458
|
+
|
|
459
|
+
return source .set (source .x + t * (destination .x - source .x),
|
|
460
|
+
longitude,
|
|
461
|
+
source .z + t * (destination .z - source .z));
|
|
462
|
+
},
|
|
463
|
+
source: new Vector3 (0, 0, 0),
|
|
464
|
+
destination: new Vector3 (0, 0, 0),
|
|
465
|
+
*/
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
return Geodetic;
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
472
|
+
*******************************************************************************
|
|
473
|
+
*
|
|
474
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
475
|
+
*
|
|
476
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
477
|
+
*
|
|
478
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
479
|
+
*
|
|
480
|
+
* The copyright notice above does not evidence any actual of intended
|
|
481
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
482
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
483
|
+
* create3000.
|
|
484
|
+
*
|
|
485
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
486
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
487
|
+
* permission of create3000.
|
|
488
|
+
*
|
|
489
|
+
* NON-MILITARY USE ONLY
|
|
490
|
+
*
|
|
491
|
+
* All create3000 software are effectively free software with a non-military use
|
|
492
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
493
|
+
* source in any way you please with the exception anything that uses it must be
|
|
494
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
495
|
+
*
|
|
496
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
497
|
+
*
|
|
498
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
499
|
+
*
|
|
500
|
+
* This file is part of the X_ITE Project.
|
|
501
|
+
*
|
|
502
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
503
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
504
|
+
* Free Software Foundation.
|
|
505
|
+
*
|
|
506
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
507
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
508
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
509
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
510
|
+
*
|
|
511
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
512
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
513
|
+
* copy of the GPLv3 License.
|
|
514
|
+
*
|
|
515
|
+
* For Silvio, Joy and Adi.
|
|
516
|
+
*
|
|
517
|
+
******************************************************************************/
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
define ('standard/Geospatial/UniversalTransverseMercator',[
|
|
521
|
+
"standard/Geospatial/Geodetic",
|
|
522
|
+
"standard/Math/Numbers/Vector3",
|
|
523
|
+
"standard/Math/Algorithm",
|
|
524
|
+
],
|
|
525
|
+
function (Geodetic,
|
|
526
|
+
Vector3,
|
|
527
|
+
Algorithm)
|
|
528
|
+
{
|
|
529
|
+
"use strict";
|
|
530
|
+
|
|
531
|
+
const
|
|
532
|
+
N0 = 1.0e7,
|
|
533
|
+
E0 = 5.0e5,
|
|
534
|
+
k0 = 0.9996;
|
|
535
|
+
|
|
536
|
+
function UniversalTransverseMercator (spheroid, zone, northernHemisphere, northingFirst)
|
|
537
|
+
{
|
|
538
|
+
const
|
|
539
|
+
a = spheroid .getSemiMajorAxis (),
|
|
540
|
+
ecc2 = 1 - Math .pow (spheroid .getSemiMinorAxis () / a, 2),
|
|
541
|
+
EE = ecc2 / (1 - ecc2),
|
|
542
|
+
e1 = (1 - Math .sqrt (1 - ecc2)) / (1 + Math .sqrt (1 - ecc2));
|
|
543
|
+
|
|
544
|
+
this .southernHemisphere = ! northernHemisphere;
|
|
545
|
+
this .eastingFirst = ! northingFirst;
|
|
546
|
+
this .a = a;
|
|
547
|
+
this .ecc2 = ecc2;
|
|
548
|
+
this .EE = EE;
|
|
549
|
+
this .E8 = 8 * EE;
|
|
550
|
+
this .E9 = 9 * EE;
|
|
551
|
+
this .E252 = 252 * EE;
|
|
552
|
+
this .e1 = e1;
|
|
553
|
+
this .A = k0 * (a * (1 - ecc2 / 4 - 3 * ecc2 * ecc2 / 64 - 5 * ecc2 * ecc2 * ecc2 / 256));
|
|
554
|
+
this .B = 3 * e1 / 2 - 7 * e1 * e1 * e1 / 32;
|
|
555
|
+
this .C = 21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32;
|
|
556
|
+
this .D = 151 * e1 * e1 * e1 / 96;
|
|
557
|
+
this .E = a * (1 - ecc2);
|
|
558
|
+
this .W = 1 - ecc2 / 4 - 3 * ecc2 * ecc2 / 64 - 5 * ecc2 * ecc2 * ecc2 / 256;
|
|
559
|
+
this .X = 3 * ecc2 / 8 + 3 * ecc2 * ecc2 / 32 + 45 * ecc2 * ecc2 * ecc2 / 1024;
|
|
560
|
+
this .Y = 15 * ecc2 * ecc2 / 256 + 45 * ecc2 * ecc2 * ecc2 / 1024;
|
|
561
|
+
this .Z = 35 * ecc2 * ecc2 * ecc2 / 3072;
|
|
562
|
+
this .longitude0 = Algorithm .radians (zone * 6 - 183);
|
|
563
|
+
this .geodeticConverter = new Geodetic (spheroid, true, true);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
UniversalTransverseMercator .prototype =
|
|
567
|
+
{
|
|
568
|
+
constructor: UniversalTransverseMercator,
|
|
569
|
+
convert: function (utm, result)
|
|
570
|
+
{
|
|
571
|
+
// https://gist.github.com/duedal/840476
|
|
572
|
+
|
|
573
|
+
if (this .eastingFirst)
|
|
574
|
+
{
|
|
575
|
+
var
|
|
576
|
+
northing = utm .y,
|
|
577
|
+
easting = utm .x;
|
|
578
|
+
}
|
|
579
|
+
else
|
|
580
|
+
{
|
|
581
|
+
var
|
|
582
|
+
northing = utm .x,
|
|
583
|
+
easting = utm .y;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// Check for southern hemisphere and remove offset from easting.
|
|
587
|
+
|
|
588
|
+
let S = this .southernHemisphere;
|
|
589
|
+
|
|
590
|
+
if (northing < 0)
|
|
591
|
+
{
|
|
592
|
+
S = ! this .southernHemisphere;
|
|
593
|
+
northing = -northing;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
if (S)
|
|
597
|
+
northing -= N0;
|
|
598
|
+
|
|
599
|
+
easting -= E0;
|
|
600
|
+
|
|
601
|
+
// Begin calculation.
|
|
602
|
+
|
|
603
|
+
const
|
|
604
|
+
mu = northing / this .A,
|
|
605
|
+
phi1 = mu + this .B * Math .sin (2 * mu) + this .C * Math .sin (4 * mu) + this .D * Math .sin (6 * mu);
|
|
606
|
+
|
|
607
|
+
const
|
|
608
|
+
sinphi1 = Math .pow (Math .sin (phi1), 2),
|
|
609
|
+
cosphi1 = Math .cos (phi1),
|
|
610
|
+
tanphi1 = Math .tan (phi1);
|
|
611
|
+
|
|
612
|
+
const
|
|
613
|
+
N1 = this .a / Math .sqrt (1 - this .ecc2 * sinphi1),
|
|
614
|
+
T2 = Math .pow (tanphi1, 2),
|
|
615
|
+
T8 = Math .pow (tanphi1, 8),
|
|
616
|
+
C1 = this .EE * T2,
|
|
617
|
+
C2 = C1 * C1,
|
|
618
|
+
R1 = this .E / Math .pow (1 - this .ecc2 * sinphi1, 1.5),
|
|
619
|
+
I = easting / (N1 * k0);
|
|
620
|
+
|
|
621
|
+
const
|
|
622
|
+
J = (5 + 3 * T2 + 10 * C1 - 4 * C2 - this .E9) * Math .pow (I, 4) / 24,
|
|
623
|
+
K = (61 + 90 * T2 + 298 * C1 + 45 * T8 - this .E252 - 3 * C2) * Math .pow (I, 6) / 720,
|
|
624
|
+
L = (5 - 2 * C1 + 28 * T2 - 3 * C2 + this .E8 + 24 * T8) * Math .pow (I, 5) / 120;
|
|
625
|
+
|
|
626
|
+
const
|
|
627
|
+
latitude = phi1 - (N1 * tanphi1 / R1) * (I * I / 2 - J + K),
|
|
628
|
+
longitude = this .longitude0 + (I - (1 + 2 * T2 + C1) * Math .pow (I, 3) / 6 + L) / cosphi1;
|
|
629
|
+
|
|
630
|
+
return this .geodeticConverter .convertRadians (latitude, longitude, utm .z, result);
|
|
631
|
+
},
|
|
632
|
+
apply: function (geocentric, result)
|
|
633
|
+
{
|
|
634
|
+
// https://gist.github.com/duedal/840476
|
|
635
|
+
|
|
636
|
+
const
|
|
637
|
+
geodetic = this .geodeticConverter .applyRadians (geocentric, result),
|
|
638
|
+
latitude = geodetic .x,
|
|
639
|
+
longitude = geodetic .y;
|
|
640
|
+
|
|
641
|
+
const
|
|
642
|
+
tanlat = Math .tan (latitude),
|
|
643
|
+
coslat = Math .cos (latitude);
|
|
644
|
+
|
|
645
|
+
const
|
|
646
|
+
EE = this .EE,
|
|
647
|
+
N = this .a / Math .sqrt (1 - this .ecc2 * Math .pow (Math .sin (latitude), 2)),
|
|
648
|
+
T = tanlat * tanlat,
|
|
649
|
+
T6 = T * T * T,
|
|
650
|
+
C = EE * coslat * coslat,
|
|
651
|
+
A = coslat * (longitude - this .longitude0);
|
|
652
|
+
|
|
653
|
+
const M = this .a * (this .W * latitude
|
|
654
|
+
- this .X * Math .sin (2 * latitude)
|
|
655
|
+
+ this .Y * Math .sin (4 * latitude)
|
|
656
|
+
- this .Z * Math .sin (6 * latitude));
|
|
657
|
+
|
|
658
|
+
const easting = k0 * N * (A + (1 - T + C) * Math .pow (A, 3) / 6
|
|
659
|
+
+ (5 - 18 * T6 + 72 * C - 58 * EE) * Math .pow (A, 5) / 120)
|
|
660
|
+
+ E0;
|
|
661
|
+
|
|
662
|
+
let northing = k0 * (M + N * tanlat * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * Math .pow (A, 4) / 24
|
|
663
|
+
+ (61 - 58 * T6 + 600 * C - 330 * EE) * Math .pow (A, 6) / 720));
|
|
664
|
+
|
|
665
|
+
if (latitude < 0)
|
|
666
|
+
{
|
|
667
|
+
northing += N0;
|
|
668
|
+
|
|
669
|
+
if (! this .southernHemisphere)
|
|
670
|
+
northing = -northing;
|
|
671
|
+
}
|
|
672
|
+
else
|
|
673
|
+
{
|
|
674
|
+
if (this .southernHemisphere)
|
|
675
|
+
northing = -northing;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
if (this .eastingFirst)
|
|
679
|
+
return result .set (easting, northing, geodetic .z);
|
|
680
|
+
|
|
681
|
+
return result .set (northing, easting, geodetic .z);
|
|
682
|
+
},
|
|
683
|
+
//lerp: Vector3 .lerp,
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
return UniversalTransverseMercator;
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
690
|
+
*******************************************************************************
|
|
691
|
+
*
|
|
692
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
693
|
+
*
|
|
694
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
695
|
+
*
|
|
696
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
697
|
+
*
|
|
698
|
+
* The copyright notice above does not evidence any actual of intended
|
|
699
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
700
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
701
|
+
* create3000.
|
|
702
|
+
*
|
|
703
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
704
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
705
|
+
* permission of create3000.
|
|
706
|
+
*
|
|
707
|
+
* NON-MILITARY USE ONLY
|
|
708
|
+
*
|
|
709
|
+
* All create3000 software are effectively free software with a non-military use
|
|
710
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
711
|
+
* source in any way you please with the exception anything that uses it must be
|
|
712
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
713
|
+
*
|
|
714
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
715
|
+
*
|
|
716
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
717
|
+
*
|
|
718
|
+
* This file is part of the X_ITE Project.
|
|
719
|
+
*
|
|
720
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
721
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
722
|
+
* Free Software Foundation.
|
|
723
|
+
*
|
|
724
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
725
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
726
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
727
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
728
|
+
*
|
|
729
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
730
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
731
|
+
* copy of the GPLv3 License.
|
|
732
|
+
*
|
|
733
|
+
* For Silvio, Joy and Adi.
|
|
734
|
+
*
|
|
735
|
+
******************************************************************************/
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
define ('x_ite/Browser/Geospatial/Geocentric',[
|
|
739
|
+
"standard/Math/Numbers/Vector3",
|
|
740
|
+
"standard/Math/Algorithm",
|
|
741
|
+
],
|
|
742
|
+
function (Vector3,
|
|
743
|
+
Algorithm)
|
|
744
|
+
{
|
|
745
|
+
"use strict";
|
|
746
|
+
|
|
747
|
+
function Geocentric () { }
|
|
748
|
+
|
|
749
|
+
Geocentric .prototype =
|
|
750
|
+
{
|
|
751
|
+
constructor: Geocentric,
|
|
752
|
+
convert: function (geocentric, result)
|
|
753
|
+
{
|
|
754
|
+
return result .assign (geocentric);
|
|
755
|
+
},
|
|
756
|
+
apply: function (geocentric, result)
|
|
757
|
+
{
|
|
758
|
+
return result .assign (geocentric);
|
|
759
|
+
},
|
|
760
|
+
slerp: function (source, destination, t)
|
|
761
|
+
{
|
|
762
|
+
var
|
|
763
|
+
sourceLength = source .abs (),
|
|
764
|
+
destinationLength = destination .abs ();
|
|
765
|
+
|
|
766
|
+
source .normalize ();
|
|
767
|
+
destination .normalize ();
|
|
768
|
+
|
|
769
|
+
return Algorithm .simpleSlerp (source, destination, t) .multiply (Algorithm .lerp (sourceLength, destinationLength, t));
|
|
770
|
+
},
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
return Geocentric;
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
777
|
+
*******************************************************************************
|
|
778
|
+
*
|
|
779
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
780
|
+
*
|
|
781
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
782
|
+
*
|
|
783
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
784
|
+
*
|
|
785
|
+
* The copyright notice above does not evidence any actual of intended
|
|
786
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
787
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
788
|
+
* create3000.
|
|
789
|
+
*
|
|
790
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
791
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
792
|
+
* permission of create3000.
|
|
793
|
+
*
|
|
794
|
+
* NON-MILITARY USE ONLY
|
|
795
|
+
*
|
|
796
|
+
* All create3000 software are effectively free software with a non-military use
|
|
797
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
798
|
+
* source in any way you please with the exception anything that uses it must be
|
|
799
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
800
|
+
*
|
|
801
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
802
|
+
*
|
|
803
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
804
|
+
*
|
|
805
|
+
* This file is part of the X_ITE Project.
|
|
806
|
+
*
|
|
807
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
808
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
809
|
+
* Free Software Foundation.
|
|
810
|
+
*
|
|
811
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
812
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
813
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
814
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
815
|
+
*
|
|
816
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
817
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
818
|
+
* copy of the GPLv3 License.
|
|
819
|
+
*
|
|
820
|
+
* For Silvio, Joy and Adi.
|
|
821
|
+
*
|
|
822
|
+
******************************************************************************/
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
define ('x_ite/Browser/Geospatial/Geospatial',[
|
|
826
|
+
"standard/Geospatial/ReferenceEllipsoids",
|
|
827
|
+
"standard/Geospatial/Geodetic",
|
|
828
|
+
"standard/Geospatial/UniversalTransverseMercator",
|
|
829
|
+
"x_ite/Browser/Geospatial/Geocentric",
|
|
830
|
+
],
|
|
831
|
+
function (ReferenceEllipsoids,
|
|
832
|
+
Geodetic,
|
|
833
|
+
UniversalTransverseMercator,
|
|
834
|
+
Geocentric)
|
|
835
|
+
{
|
|
836
|
+
"use strict";
|
|
837
|
+
|
|
838
|
+
var
|
|
839
|
+
i = 0,
|
|
840
|
+
GD = i ++,
|
|
841
|
+
UTM = i ++,
|
|
842
|
+
GC = i ++;
|
|
843
|
+
|
|
844
|
+
var CoordinateSystems = {
|
|
845
|
+
GD: GD,
|
|
846
|
+
GDC: GD,
|
|
847
|
+
UTM: UTM,
|
|
848
|
+
GC: GC,
|
|
849
|
+
GCC: GC,
|
|
850
|
+
GS: GC,
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
var Zone = /^Z(\d+)$/;
|
|
854
|
+
|
|
855
|
+
var Geospatial =
|
|
856
|
+
{
|
|
857
|
+
GD: GD,
|
|
858
|
+
UTM: UTM,
|
|
859
|
+
GC: GC,
|
|
860
|
+
getReferenceFrame: function (geoSystem, radians)
|
|
861
|
+
{
|
|
862
|
+
switch (this .getCoordinateSystem (geoSystem))
|
|
863
|
+
{
|
|
864
|
+
case GD:
|
|
865
|
+
{
|
|
866
|
+
return new Geodetic (this .getEllipsoid (geoSystem),
|
|
867
|
+
this .getLatitudeFirst (geoSystem),
|
|
868
|
+
radians);
|
|
869
|
+
}
|
|
870
|
+
case UTM:
|
|
871
|
+
{
|
|
872
|
+
return new UniversalTransverseMercator (this .getEllipsoid (geoSystem),
|
|
873
|
+
this .getZone (geoSystem),
|
|
874
|
+
this .getNorthernHemisphere (geoSystem),
|
|
875
|
+
this .getNorthingFirst (geoSystem));
|
|
876
|
+
}
|
|
877
|
+
case GC:
|
|
878
|
+
{
|
|
879
|
+
return new Geocentric ();
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
return new Geodetic (ReferenceEllipsoids .WE, true, radians);
|
|
884
|
+
},
|
|
885
|
+
getElevationFrame: function (geoSystem, radians)
|
|
886
|
+
{
|
|
887
|
+
return new Geodetic (this .getEllipsoid (geoSystem), true, radians);
|
|
888
|
+
},
|
|
889
|
+
getCoordinateSystem: function (geoSystem)
|
|
890
|
+
{
|
|
891
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
892
|
+
{
|
|
893
|
+
var coordinateSystem = CoordinateSystems [geoSystem [i]];
|
|
894
|
+
|
|
895
|
+
if (coordinateSystem !== undefined)
|
|
896
|
+
return coordinateSystem;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
return GD;
|
|
900
|
+
},
|
|
901
|
+
getEllipsoid: function (geoSystem)
|
|
902
|
+
{
|
|
903
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
904
|
+
{
|
|
905
|
+
var ellipsoid = ReferenceEllipsoids [geoSystem [i]];
|
|
906
|
+
|
|
907
|
+
if (ellipsoid !== undefined)
|
|
908
|
+
return ellipsoid;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
return ReferenceEllipsoids .WE;
|
|
912
|
+
},
|
|
913
|
+
getEllipsoidString: function (geoSystem)
|
|
914
|
+
{
|
|
915
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
916
|
+
{
|
|
917
|
+
var ellipsoid = ReferenceEllipsoids [geoSystem [i]];
|
|
918
|
+
|
|
919
|
+
if (ellipsoid !== undefined)
|
|
920
|
+
return geoSystem [i];
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
return "WE";
|
|
924
|
+
},
|
|
925
|
+
isStandardOrder: function (geoSystem)
|
|
926
|
+
{
|
|
927
|
+
switch (this .getCoordinateSystem (geoSystem))
|
|
928
|
+
{
|
|
929
|
+
case GD:
|
|
930
|
+
{
|
|
931
|
+
return this .getLatitudeFirst (geoSystem);
|
|
932
|
+
}
|
|
933
|
+
case UTM:
|
|
934
|
+
{
|
|
935
|
+
return this .getNorthingFirst (geoSystem);
|
|
936
|
+
}
|
|
937
|
+
case GC:
|
|
938
|
+
{
|
|
939
|
+
return true;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
return this .getLatitudeFirst (geoSystem);
|
|
944
|
+
},
|
|
945
|
+
getLatitudeFirst: function (geoSystem)
|
|
946
|
+
{
|
|
947
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
948
|
+
{
|
|
949
|
+
if (geoSystem [i] === "longitude_first")
|
|
950
|
+
return false;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
return true;
|
|
954
|
+
},
|
|
955
|
+
getNorthingFirst: function (geoSystem)
|
|
956
|
+
{
|
|
957
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
958
|
+
{
|
|
959
|
+
if (geoSystem [i] === "easting_first")
|
|
960
|
+
return false;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
return true;
|
|
964
|
+
},
|
|
965
|
+
getZone: function (geoSystem)
|
|
966
|
+
{
|
|
967
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
968
|
+
{
|
|
969
|
+
var match = geoSystem [i] .match (Zone);
|
|
970
|
+
|
|
971
|
+
if (match)
|
|
972
|
+
return parseInt (match [1]);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
return 1;
|
|
976
|
+
},
|
|
977
|
+
getNorthernHemisphere: function (geoSystem)
|
|
978
|
+
{
|
|
979
|
+
for (var i = 0, length = geoSystem .length; i < length; ++ i)
|
|
980
|
+
{
|
|
981
|
+
if (geoSystem [i] === "S")
|
|
982
|
+
return false;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
return true;
|
|
986
|
+
},
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
return Geospatial;
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
993
|
+
*******************************************************************************
|
|
994
|
+
*
|
|
995
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
996
|
+
*
|
|
997
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
998
|
+
*
|
|
999
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1000
|
+
*
|
|
1001
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1002
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1003
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1004
|
+
* create3000.
|
|
1005
|
+
*
|
|
1006
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1007
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1008
|
+
* permission of create3000.
|
|
1009
|
+
*
|
|
1010
|
+
* NON-MILITARY USE ONLY
|
|
1011
|
+
*
|
|
1012
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1013
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1014
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1015
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1016
|
+
*
|
|
1017
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1018
|
+
*
|
|
1019
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1020
|
+
*
|
|
1021
|
+
* This file is part of the X_ITE Project.
|
|
1022
|
+
*
|
|
1023
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1024
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1025
|
+
* Free Software Foundation.
|
|
1026
|
+
*
|
|
1027
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1028
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1029
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1030
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1031
|
+
*
|
|
1032
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1033
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1034
|
+
* copy of the GPLv3 License.
|
|
1035
|
+
*
|
|
1036
|
+
* For Silvio, Joy and Adi.
|
|
1037
|
+
*
|
|
1038
|
+
******************************************************************************/
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
define ('x_ite/Components/Geospatial/X3DGeospatialObject',[
|
|
1042
|
+
"x_ite/Bits/X3DConstants",
|
|
1043
|
+
"x_ite/Browser/Geospatial/Geospatial",
|
|
1044
|
+
"x_ite/Bits/X3DCast",
|
|
1045
|
+
"standard/Math/Numbers/Vector3",
|
|
1046
|
+
"standard/Math/Numbers/Matrix4",
|
|
1047
|
+
],
|
|
1048
|
+
function (X3DConstants,
|
|
1049
|
+
Geospatial,
|
|
1050
|
+
X3DCast,
|
|
1051
|
+
Vector3,
|
|
1052
|
+
Matrix4)
|
|
1053
|
+
{
|
|
1054
|
+
"use strict";
|
|
1055
|
+
|
|
1056
|
+
var
|
|
1057
|
+
vector = new Vector3 (0, 0, 0),
|
|
1058
|
+
result = new Vector3 (0, 0, 0),
|
|
1059
|
+
t = new Vector3 (0, 0, 0),
|
|
1060
|
+
x = new Vector3 (0, 0, 0),
|
|
1061
|
+
y = new Vector3 (0, 0, 0),
|
|
1062
|
+
z = new Vector3 (0, 0, 0);
|
|
1063
|
+
|
|
1064
|
+
function X3DGeospatialObject (executionContext)
|
|
1065
|
+
{
|
|
1066
|
+
this .addType (X3DConstants .X3DGeospatialObject);
|
|
1067
|
+
|
|
1068
|
+
this .radians = false;
|
|
1069
|
+
this .origin = new Vector3 (0, 0, 0);
|
|
1070
|
+
this .originMatrix = new Matrix4 ();
|
|
1071
|
+
this .invOriginMatrix = new Matrix4 ();
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
X3DGeospatialObject .prototype =
|
|
1075
|
+
{
|
|
1076
|
+
constructor: X3DGeospatialObject,
|
|
1077
|
+
initialize: function ()
|
|
1078
|
+
{
|
|
1079
|
+
this .geoSystem_ .addInterest ("set_geoSystem__", this);
|
|
1080
|
+
this .geoOrigin_ .addInterest ("set_geoOrigin__", this);
|
|
1081
|
+
|
|
1082
|
+
this .set_geoSystem__ ();
|
|
1083
|
+
this .set_geoOrigin__ ();
|
|
1084
|
+
},
|
|
1085
|
+
set_geoSystem__: function ()
|
|
1086
|
+
{
|
|
1087
|
+
this .coordinateSystem = Geospatial .getCoordinateSystem (this .geoSystem_);
|
|
1088
|
+
this .referenceFrame = Geospatial .getReferenceFrame (this .geoSystem_, this .radians);
|
|
1089
|
+
this .elevationFrame = Geospatial .getElevationFrame (this .geoSystem_, this .radians);
|
|
1090
|
+
this .standardOrder = Geospatial .isStandardOrder (this .geoSystem_);
|
|
1091
|
+
},
|
|
1092
|
+
set_geoOrigin__: function ()
|
|
1093
|
+
{
|
|
1094
|
+
if (this .geoOriginNode)
|
|
1095
|
+
{
|
|
1096
|
+
this .geoOriginNode .removeInterest ("set_origin__", this);
|
|
1097
|
+
this .geoOriginNode .removeInterest ("set_rotateYUp__", this);
|
|
1098
|
+
this .geoOriginNode .removeInterest ("addNodeEvent", this);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
this .geoOriginNode = X3DCast (X3DConstants .GeoOrigin, this .geoOrigin_);
|
|
1102
|
+
|
|
1103
|
+
if (this .geoOriginNode)
|
|
1104
|
+
{
|
|
1105
|
+
this .geoOriginNode .addInterest ("set_origin__", this);
|
|
1106
|
+
this .geoOriginNode .addInterest ("set_rotateYUp__", this);
|
|
1107
|
+
this .geoOriginNode .addInterest ("addNodeEvent", this);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
this .set_origin__ ();
|
|
1111
|
+
this .set_rotateYUp__ ();
|
|
1112
|
+
},
|
|
1113
|
+
set_origin__: function ()
|
|
1114
|
+
{
|
|
1115
|
+
if (this .geoOriginNode)
|
|
1116
|
+
this .geoOriginNode .getOrigin (this .origin);
|
|
1117
|
+
else
|
|
1118
|
+
this .origin .set (0, 0, 0);
|
|
1119
|
+
|
|
1120
|
+
this .set_originMatrix__ ();
|
|
1121
|
+
},
|
|
1122
|
+
set_originMatrix__: function ()
|
|
1123
|
+
{
|
|
1124
|
+
try
|
|
1125
|
+
{
|
|
1126
|
+
if (this .geoOriginNode)
|
|
1127
|
+
{
|
|
1128
|
+
// Position
|
|
1129
|
+
var t = this .origin;
|
|
1130
|
+
|
|
1131
|
+
// Let's work out the orientation at that location in order
|
|
1132
|
+
// to maintain a view where +Y is in the direction of gravitional
|
|
1133
|
+
// up for that region of the planet's surface. This will be the
|
|
1134
|
+
// value of the rotation matrix for the transform.
|
|
1135
|
+
|
|
1136
|
+
this .elevationFrame .normal (t, y);
|
|
1137
|
+
|
|
1138
|
+
x .set (0, 0, 1) .cross (y);
|
|
1139
|
+
|
|
1140
|
+
// Handle pole cases.
|
|
1141
|
+
if (x .equals (Vector3 .Zero))
|
|
1142
|
+
x .set (1, 0, 0);
|
|
1143
|
+
|
|
1144
|
+
z .assign (x) .cross (y);
|
|
1145
|
+
|
|
1146
|
+
x .normalize ();
|
|
1147
|
+
z .normalize ();
|
|
1148
|
+
|
|
1149
|
+
this .originMatrix .set (x .x, x .y, x .z, 0,
|
|
1150
|
+
y .x, y .y, y .z, 0,
|
|
1151
|
+
z .x, z .y, z .z, 0,
|
|
1152
|
+
t .x, t .y, t .z, 1);
|
|
1153
|
+
|
|
1154
|
+
this .invOriginMatrix .assign (this .originMatrix) .inverse ();
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
catch (error)
|
|
1158
|
+
{
|
|
1159
|
+
/// ???
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
set_rotateYUp__: function ()
|
|
1163
|
+
{
|
|
1164
|
+
if (this .geoOriginNode && this .geoOriginNode .rotateYUp_ .getValue ())
|
|
1165
|
+
{
|
|
1166
|
+
this .getCoord = getCoordRotateYUp;
|
|
1167
|
+
this .getGeoCoord = getGeoCoordRotateYUp;
|
|
1168
|
+
this .getGeoUpVector = getGeoUpVectorRotateYUp;
|
|
1169
|
+
this .getLocationMatrix = getLocationMatrixRotateYUp;
|
|
1170
|
+
}
|
|
1171
|
+
else
|
|
1172
|
+
{
|
|
1173
|
+
delete this .getCoord;
|
|
1174
|
+
delete this .getGeoCoord;
|
|
1175
|
+
delete this .getGeoUpVector;
|
|
1176
|
+
delete this .getLocationMatrix;
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
getReferenceFrame: function ()
|
|
1180
|
+
{
|
|
1181
|
+
return this .referenceFrame;
|
|
1182
|
+
},
|
|
1183
|
+
getStandardOrder: function ()
|
|
1184
|
+
{
|
|
1185
|
+
return this .standardOrder;
|
|
1186
|
+
},
|
|
1187
|
+
getCoord: function (geoPoint, result)
|
|
1188
|
+
{
|
|
1189
|
+
return this .referenceFrame .convert (geoPoint, result) .subtract (this .origin);
|
|
1190
|
+
},
|
|
1191
|
+
getGeoCoord: function (point, result)
|
|
1192
|
+
{
|
|
1193
|
+
return this .referenceFrame .apply (vector .assign (point) .add (this .origin), result);
|
|
1194
|
+
},
|
|
1195
|
+
getGeoElevation: function (point)
|
|
1196
|
+
{
|
|
1197
|
+
return this .getGeoCoord (point, result) .z;
|
|
1198
|
+
},
|
|
1199
|
+
getGeoUpVector: function (point, result)
|
|
1200
|
+
{
|
|
1201
|
+
return this .elevationFrame .normal (vector .assign (point) .add (this .origin), result);
|
|
1202
|
+
},
|
|
1203
|
+
getLocationMatrix: function (geoPoint, result)
|
|
1204
|
+
{
|
|
1205
|
+
var
|
|
1206
|
+
origin = this .origin,
|
|
1207
|
+
locationMatrix = getStandardLocationMatrix .call (this, geoPoint, result);
|
|
1208
|
+
|
|
1209
|
+
// translateRight (-origin)
|
|
1210
|
+
locationMatrix [12] -= origin .x;
|
|
1211
|
+
locationMatrix [13] -= origin .y;
|
|
1212
|
+
locationMatrix [14] -= origin .z;
|
|
1213
|
+
|
|
1214
|
+
return locationMatrix;
|
|
1215
|
+
},
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
function getCoordRotateYUp (geoPoint, result)
|
|
1219
|
+
{
|
|
1220
|
+
return this .invOriginMatrix .multVecMatrix (this .referenceFrame .convert (geoPoint, result));
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
function getGeoCoordRotateYUp (point, result)
|
|
1224
|
+
{
|
|
1225
|
+
return this .referenceFrame .apply (this .originMatrix .multVecMatrix (vector .assign (point)), result);
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
function getGeoUpVectorRotateYUp (point, result)
|
|
1229
|
+
{
|
|
1230
|
+
return this .invOriginMatrix .multDirMatrix (this .elevationFrame .normal (this .originMatrix .multVecMatrix (vector .assign (point)), result));
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
function getLocationMatrixRotateYUp (geoPoint, result)
|
|
1234
|
+
{
|
|
1235
|
+
return getStandardLocationMatrix .call (this, geoPoint, result) .multRight (this .invOriginMatrix);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
function getStandardLocationMatrix (geoPoint, result)
|
|
1239
|
+
{
|
|
1240
|
+
// Position
|
|
1241
|
+
this .referenceFrame .convert (geoPoint, t);
|
|
1242
|
+
|
|
1243
|
+
// Let's work out the orientation at that location in order
|
|
1244
|
+
// to maintain a view where +Y is in the direction of gravitional
|
|
1245
|
+
// up for that region of the planet's surface. This will be the
|
|
1246
|
+
// value of the rotation matrix for the transform.
|
|
1247
|
+
|
|
1248
|
+
this .elevationFrame .normal (t, y);
|
|
1249
|
+
|
|
1250
|
+
x .set (0, 0, 1) .cross (y);
|
|
1251
|
+
|
|
1252
|
+
// Handle pole cases.
|
|
1253
|
+
if (x .equals (Vector3 .Zero))
|
|
1254
|
+
x .set (1, 0, 0);
|
|
1255
|
+
|
|
1256
|
+
z .assign (x) .cross (y);
|
|
1257
|
+
|
|
1258
|
+
x .normalize ();
|
|
1259
|
+
z .normalize ();
|
|
1260
|
+
|
|
1261
|
+
return result .set (x .x, x .y, x .z, 0,
|
|
1262
|
+
y .x, y .y, y .z, 0,
|
|
1263
|
+
z .x, z .y, z .z, 0,
|
|
1264
|
+
t .x, t .y, t .z, 1);
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
return X3DGeospatialObject;
|
|
1268
|
+
});
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1273
|
+
*******************************************************************************
|
|
1274
|
+
*
|
|
1275
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1276
|
+
*
|
|
1277
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1278
|
+
*
|
|
1279
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1280
|
+
*
|
|
1281
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1282
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1283
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1284
|
+
* create3000.
|
|
1285
|
+
*
|
|
1286
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1287
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1288
|
+
* permission of create3000.
|
|
1289
|
+
*
|
|
1290
|
+
* NON-MILITARY USE ONLY
|
|
1291
|
+
*
|
|
1292
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1293
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1294
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1295
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1296
|
+
*
|
|
1297
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1298
|
+
*
|
|
1299
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1300
|
+
*
|
|
1301
|
+
* This file is part of the X_ITE Project.
|
|
1302
|
+
*
|
|
1303
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1304
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1305
|
+
* Free Software Foundation.
|
|
1306
|
+
*
|
|
1307
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1308
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1309
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1310
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1311
|
+
*
|
|
1312
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1313
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1314
|
+
* copy of the GPLv3 License.
|
|
1315
|
+
*
|
|
1316
|
+
* For Silvio, Joy and Adi.
|
|
1317
|
+
*
|
|
1318
|
+
******************************************************************************/
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
define ('x_ite/Components/Geospatial/GeoCoordinate',[
|
|
1322
|
+
"x_ite/Fields",
|
|
1323
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1324
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1325
|
+
"x_ite/Components/Rendering/X3DCoordinateNode",
|
|
1326
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
1327
|
+
"x_ite/Bits/X3DConstants",
|
|
1328
|
+
"standard/Math/Geometry/Triangle3",
|
|
1329
|
+
"standard/Math/Numbers/Vector3",
|
|
1330
|
+
],
|
|
1331
|
+
function (Fields,
|
|
1332
|
+
X3DFieldDefinition,
|
|
1333
|
+
FieldDefinitionArray,
|
|
1334
|
+
X3DCoordinateNode,
|
|
1335
|
+
X3DGeospatialObject,
|
|
1336
|
+
X3DConstants,
|
|
1337
|
+
Triangle3,
|
|
1338
|
+
Vector3)
|
|
1339
|
+
{
|
|
1340
|
+
"use strict";
|
|
1341
|
+
|
|
1342
|
+
function GeoCoordinate (executionContext)
|
|
1343
|
+
{
|
|
1344
|
+
X3DCoordinateNode .call (this, executionContext);
|
|
1345
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
1346
|
+
|
|
1347
|
+
this .addType (X3DConstants .GeoCoordinate);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
GeoCoordinate .prototype = Object .assign (Object .create (X3DCoordinateNode .prototype),
|
|
1351
|
+
X3DGeospatialObject .prototype,
|
|
1352
|
+
{
|
|
1353
|
+
constructor: GeoCoordinate,
|
|
1354
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1355
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1356
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
1357
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
1358
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "point", new Fields .MFVec3d ()),
|
|
1359
|
+
]),
|
|
1360
|
+
getTypeName: function ()
|
|
1361
|
+
{
|
|
1362
|
+
return "GeoCoordinate";
|
|
1363
|
+
},
|
|
1364
|
+
getComponentName: function ()
|
|
1365
|
+
{
|
|
1366
|
+
return "Geospatial";
|
|
1367
|
+
},
|
|
1368
|
+
getContainerField: function ()
|
|
1369
|
+
{
|
|
1370
|
+
return "coord";
|
|
1371
|
+
},
|
|
1372
|
+
initialize: function ()
|
|
1373
|
+
{
|
|
1374
|
+
X3DCoordinateNode .prototype .initialize .call (this);
|
|
1375
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
1376
|
+
|
|
1377
|
+
this .point_ .addInterest ("set_point__", this);
|
|
1378
|
+
|
|
1379
|
+
this .set_point__ ();
|
|
1380
|
+
},
|
|
1381
|
+
set_point__: function ()
|
|
1382
|
+
{
|
|
1383
|
+
this .point = this .point_ .getValue ();
|
|
1384
|
+
this .length = this .point_ .length;
|
|
1385
|
+
},
|
|
1386
|
+
isEmpty: function ()
|
|
1387
|
+
{
|
|
1388
|
+
return this .length === 0;
|
|
1389
|
+
},
|
|
1390
|
+
getSize: function ()
|
|
1391
|
+
{
|
|
1392
|
+
return this .length;
|
|
1393
|
+
},
|
|
1394
|
+
set1Point: (function ()
|
|
1395
|
+
{
|
|
1396
|
+
var result = new Vector3 (0, 0, 0);
|
|
1397
|
+
|
|
1398
|
+
return function (index, point)
|
|
1399
|
+
{
|
|
1400
|
+
this .point_ [index] = this .getGeoCoord (point, result);
|
|
1401
|
+
};
|
|
1402
|
+
})(),
|
|
1403
|
+
get1Point: (function ()
|
|
1404
|
+
{
|
|
1405
|
+
var p = new Vector3 (0, 0, 0);
|
|
1406
|
+
|
|
1407
|
+
return function (index, result)
|
|
1408
|
+
{
|
|
1409
|
+
if (index < this .length)
|
|
1410
|
+
{
|
|
1411
|
+
const point = this .point;
|
|
1412
|
+
|
|
1413
|
+
index *= 3;
|
|
1414
|
+
|
|
1415
|
+
return this .getCoord (p .set (point [index], point [index + 1], point [index + 2]), result);
|
|
1416
|
+
}
|
|
1417
|
+
else
|
|
1418
|
+
{
|
|
1419
|
+
return result .set (0, 0, 0);
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
})(),
|
|
1423
|
+
addPoint: (function ()
|
|
1424
|
+
{
|
|
1425
|
+
var
|
|
1426
|
+
p = new Vector3 (0, 0, 0),
|
|
1427
|
+
g = new Vector3 (0, 0, 0);
|
|
1428
|
+
|
|
1429
|
+
return function (index, array)
|
|
1430
|
+
{
|
|
1431
|
+
if (index < this .length)
|
|
1432
|
+
{
|
|
1433
|
+
const point = this .point;
|
|
1434
|
+
|
|
1435
|
+
index *= 3;
|
|
1436
|
+
|
|
1437
|
+
this .getCoord (p .set (point [index], point [index + 1], point [index + 2]), g);
|
|
1438
|
+
|
|
1439
|
+
array .push (g [0], g [1], g [2], 1);
|
|
1440
|
+
}
|
|
1441
|
+
else
|
|
1442
|
+
{
|
|
1443
|
+
array .push (0, 0, 0, 1);
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
})(),
|
|
1447
|
+
addPoints: (function ()
|
|
1448
|
+
{
|
|
1449
|
+
var
|
|
1450
|
+
p = new Vector3 (0, 0, 0),
|
|
1451
|
+
g = new Vector3 (0, 0, 0);
|
|
1452
|
+
|
|
1453
|
+
return function (array, min)
|
|
1454
|
+
{
|
|
1455
|
+
const point = this .point;
|
|
1456
|
+
|
|
1457
|
+
for (var index = 0, length = this .length * 3; index < length; index += 3)
|
|
1458
|
+
{
|
|
1459
|
+
this .getCoord (p .set (point [index], point [index + 1], point [index + 2]), g);
|
|
1460
|
+
|
|
1461
|
+
array .push (g [0], g [1], g [2], 1);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
for (var index = length, length = min * 3; index < length; index += 3)
|
|
1465
|
+
array .push (0, 0, 0, 1);
|
|
1466
|
+
};
|
|
1467
|
+
})(),
|
|
1468
|
+
getNormal: (function ()
|
|
1469
|
+
{
|
|
1470
|
+
var
|
|
1471
|
+
point1 = new Vector3 (0, 0, 0),
|
|
1472
|
+
point2 = new Vector3 (0, 0, 0),
|
|
1473
|
+
point3 = new Vector3 (0, 0, 0);
|
|
1474
|
+
|
|
1475
|
+
return function (index1, index2, index3)
|
|
1476
|
+
{
|
|
1477
|
+
// The index[1,2,3] cannot be less than 0.
|
|
1478
|
+
|
|
1479
|
+
var length = this .length;
|
|
1480
|
+
|
|
1481
|
+
if (index1 < length && index2 < length && index3 < length)
|
|
1482
|
+
{
|
|
1483
|
+
return Triangle3 .normal (this .get1Point (index1, point1),
|
|
1484
|
+
this .get1Point (index2, point2),
|
|
1485
|
+
this .get1Point (index3, point3),
|
|
1486
|
+
new Vector3 (0, 0, 0));
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
return new Vector3 (0, 0, 0);
|
|
1490
|
+
};
|
|
1491
|
+
})(),
|
|
1492
|
+
getQuadNormal: (function ()
|
|
1493
|
+
{
|
|
1494
|
+
var
|
|
1495
|
+
point1 = new Vector3 (0, 0, 0),
|
|
1496
|
+
point2 = new Vector3 (0, 0, 0),
|
|
1497
|
+
point3 = new Vector3 (0, 0, 0),
|
|
1498
|
+
point4 = new Vector3 (0, 0, 0);
|
|
1499
|
+
|
|
1500
|
+
return function (index1, index2, index3, index4)
|
|
1501
|
+
{
|
|
1502
|
+
// The index[1,2,3,4] cannot be less than 0.
|
|
1503
|
+
|
|
1504
|
+
var length = this .length;
|
|
1505
|
+
|
|
1506
|
+
if (index1 < length && index2 < length && index3 < length && index4 < length)
|
|
1507
|
+
{
|
|
1508
|
+
return Triangle3 .quadNormal (this .get1Point (index1, point1),
|
|
1509
|
+
this .get1Point (index2, point2),
|
|
1510
|
+
this .get1Point (index3, point3),
|
|
1511
|
+
this .get1Point (index4, point4),
|
|
1512
|
+
new Vector3 (0, 0, 0));
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
return new Vector3 (0, 0, 0);
|
|
1516
|
+
};
|
|
1517
|
+
})(),
|
|
1518
|
+
});
|
|
1519
|
+
|
|
1520
|
+
return GeoCoordinate;
|
|
1521
|
+
});
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1526
|
+
*******************************************************************************
|
|
1527
|
+
*
|
|
1528
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1529
|
+
*
|
|
1530
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1531
|
+
*
|
|
1532
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1533
|
+
*
|
|
1534
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1535
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1536
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1537
|
+
* create3000.
|
|
1538
|
+
*
|
|
1539
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1540
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1541
|
+
* permission of create3000.
|
|
1542
|
+
*
|
|
1543
|
+
* NON-MILITARY USE ONLY
|
|
1544
|
+
*
|
|
1545
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1546
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1547
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1548
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1549
|
+
*
|
|
1550
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1551
|
+
*
|
|
1552
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
1553
|
+
*
|
|
1554
|
+
* This file is part of the X_ITE Project.
|
|
1555
|
+
*
|
|
1556
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
1557
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
1558
|
+
* Free Software Foundation.
|
|
1559
|
+
*
|
|
1560
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
1561
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
1562
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
1563
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
1564
|
+
*
|
|
1565
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
1566
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
1567
|
+
* copy of the GPLv3 License.
|
|
1568
|
+
*
|
|
1569
|
+
* For Silvio, Joy and Adi.
|
|
1570
|
+
*
|
|
1571
|
+
******************************************************************************/
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
define ('x_ite/Components/Geospatial/GeoElevationGrid',[
|
|
1575
|
+
"x_ite/Fields",
|
|
1576
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
1577
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
1578
|
+
"x_ite/Components/Rendering/X3DGeometryNode",
|
|
1579
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
1580
|
+
"x_ite/Bits/X3DConstants",
|
|
1581
|
+
"x_ite/Bits/X3DCast",
|
|
1582
|
+
"standard/Math/Geometry/Triangle3",
|
|
1583
|
+
"standard/Math/Numbers/Vector2",
|
|
1584
|
+
"standard/Math/Numbers/Vector3",
|
|
1585
|
+
],
|
|
1586
|
+
function (Fields,
|
|
1587
|
+
X3DFieldDefinition,
|
|
1588
|
+
FieldDefinitionArray,
|
|
1589
|
+
X3DGeometryNode,
|
|
1590
|
+
X3DGeospatialObject,
|
|
1591
|
+
X3DConstants,
|
|
1592
|
+
X3DCast,
|
|
1593
|
+
Triangle3,
|
|
1594
|
+
Vector2,
|
|
1595
|
+
Vector3)
|
|
1596
|
+
{
|
|
1597
|
+
"use strict";
|
|
1598
|
+
|
|
1599
|
+
function GeoElevationGrid (executionContext)
|
|
1600
|
+
{
|
|
1601
|
+
X3DGeometryNode .call (this, executionContext);
|
|
1602
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
1603
|
+
|
|
1604
|
+
this .addType (X3DConstants .GeoElevationGrid);
|
|
1605
|
+
|
|
1606
|
+
this .creaseAngle_ .setUnit ("angle");
|
|
1607
|
+
this .height_ .setUnit ("length");
|
|
1608
|
+
|
|
1609
|
+
this .colorNode = null;
|
|
1610
|
+
this .texCoordNode = null;
|
|
1611
|
+
this .normalNode = null;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
GeoElevationGrid .prototype = Object .assign (Object .create (X3DGeometryNode .prototype),
|
|
1615
|
+
X3DGeospatialObject .prototype,
|
|
1616
|
+
{
|
|
1617
|
+
constructor: GeoElevationGrid,
|
|
1618
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
1619
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
1620
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
1621
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
1622
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoGridOrigin", new Fields .SFVec3d ()),
|
|
1623
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "xDimension", new Fields .SFInt32 ()),
|
|
1624
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "zDimension", new Fields .SFInt32 ()),
|
|
1625
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "xSpacing", new Fields .SFDouble (1)),
|
|
1626
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "zSpacing", new Fields .SFDouble (1)),
|
|
1627
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "yScale", new Fields .SFFloat (1)),
|
|
1628
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "solid", new Fields .SFBool (true)),
|
|
1629
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "ccw", new Fields .SFBool (true)),
|
|
1630
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "creaseAngle", new Fields .SFDouble ()),
|
|
1631
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "colorPerVertex", new Fields .SFBool (true)),
|
|
1632
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "normalPerVertex", new Fields .SFBool (true)),
|
|
1633
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "color", new Fields .SFNode ()),
|
|
1634
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "texCoord", new Fields .SFNode ()),
|
|
1635
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "normal", new Fields .SFNode ()),
|
|
1636
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "height", new Fields .MFDouble (0, 0)),
|
|
1637
|
+
]),
|
|
1638
|
+
getTypeName: function ()
|
|
1639
|
+
{
|
|
1640
|
+
return "GeoElevationGrid";
|
|
1641
|
+
},
|
|
1642
|
+
getComponentName: function ()
|
|
1643
|
+
{
|
|
1644
|
+
return "Geospatial";
|
|
1645
|
+
},
|
|
1646
|
+
getContainerField: function ()
|
|
1647
|
+
{
|
|
1648
|
+
return "geometry";
|
|
1649
|
+
},
|
|
1650
|
+
initialize: function ()
|
|
1651
|
+
{
|
|
1652
|
+
X3DGeometryNode .prototype .initialize .call (this);
|
|
1653
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
1654
|
+
|
|
1655
|
+
this .color_ .addInterest ("set_color__", this);
|
|
1656
|
+
this .texCoord_ .addInterest ("set_texCoord__", this);
|
|
1657
|
+
this .normal_ .addInterest ("set_normal__", this);
|
|
1658
|
+
|
|
1659
|
+
this .set_color__ ();
|
|
1660
|
+
this .set_texCoord__ ();
|
|
1661
|
+
this .set_normal__ ();
|
|
1662
|
+
},
|
|
1663
|
+
set_color__: function ()
|
|
1664
|
+
{
|
|
1665
|
+
if (this .colorNode)
|
|
1666
|
+
{
|
|
1667
|
+
this .colorNode .removeInterest ("requestRebuild", this);
|
|
1668
|
+
this .colorNode .transparent_ .removeInterest ("set_transparent__", this);
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
this .colorNode = X3DCast (X3DConstants .X3DColorNode, this .color_);
|
|
1672
|
+
|
|
1673
|
+
if (this .colorNode)
|
|
1674
|
+
{
|
|
1675
|
+
this .colorNode .addInterest ("requestRebuild", this);
|
|
1676
|
+
this .colorNode .transparent_ .addInterest ("set_transparent__", this);
|
|
1677
|
+
|
|
1678
|
+
this .set_transparent__ ();
|
|
1679
|
+
}
|
|
1680
|
+
else
|
|
1681
|
+
this .setTransparent (false);
|
|
1682
|
+
},
|
|
1683
|
+
set_transparent__: function ()
|
|
1684
|
+
{
|
|
1685
|
+
this .setTransparent (this .colorNode .getTransparent ());
|
|
1686
|
+
},
|
|
1687
|
+
set_texCoord__: function ()
|
|
1688
|
+
{
|
|
1689
|
+
if (this .texCoordNode)
|
|
1690
|
+
this .texCoordNode .removeInterest ("requestRebuild", this);
|
|
1691
|
+
|
|
1692
|
+
this .texCoordNode = X3DCast (X3DConstants .X3DTextureCoordinateNode, this .texCoord_);
|
|
1693
|
+
|
|
1694
|
+
if (this .texCoordNode)
|
|
1695
|
+
this .texCoordNode .addInterest ("requestRebuild", this);
|
|
1696
|
+
|
|
1697
|
+
this .setTextureCoordinate (this .texCoordNode);
|
|
1698
|
+
},
|
|
1699
|
+
set_normal__: function ()
|
|
1700
|
+
{
|
|
1701
|
+
if (this .normalNode)
|
|
1702
|
+
this .normalNode .removeInterest ("requestRebuild", this);
|
|
1703
|
+
|
|
1704
|
+
this .normalNode = X3DCast (X3DConstants .X3DNormalNode, this .normal_);
|
|
1705
|
+
|
|
1706
|
+
if (this .normalNode)
|
|
1707
|
+
this .normalNode .addInterest ("requestRebuild", this);
|
|
1708
|
+
},
|
|
1709
|
+
getColor: function ()
|
|
1710
|
+
{
|
|
1711
|
+
return this .colorNode;
|
|
1712
|
+
},
|
|
1713
|
+
getTexCoord: function ()
|
|
1714
|
+
{
|
|
1715
|
+
return this .texCoordNode;
|
|
1716
|
+
},
|
|
1717
|
+
getNormal: function ()
|
|
1718
|
+
{
|
|
1719
|
+
return this .normalNode;
|
|
1720
|
+
},
|
|
1721
|
+
getHeight: function (index)
|
|
1722
|
+
{
|
|
1723
|
+
if (index < this .height_ .length)
|
|
1724
|
+
return this .height_ [index] * this .yScale_ .getValue ();
|
|
1725
|
+
|
|
1726
|
+
return 0;
|
|
1727
|
+
},
|
|
1728
|
+
createTexCoords: function ()
|
|
1729
|
+
{
|
|
1730
|
+
var
|
|
1731
|
+
texCoords = [ ],
|
|
1732
|
+
xDimension = this .xDimension_ .getValue (),
|
|
1733
|
+
zDimension = this .zDimension_ .getValue (),
|
|
1734
|
+
xSize = xDimension - 1,
|
|
1735
|
+
zSize = zDimension - 1;
|
|
1736
|
+
|
|
1737
|
+
for (var z = 0; z < zDimension; ++ z)
|
|
1738
|
+
{
|
|
1739
|
+
for (var x = 0; x < xDimension; ++ x)
|
|
1740
|
+
texCoords .push (new Vector2 (x / xSize, z / zSize));
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
return texCoords;
|
|
1744
|
+
},
|
|
1745
|
+
createNormals: function (points, coordIndex, creaseAngle)
|
|
1746
|
+
{
|
|
1747
|
+
var
|
|
1748
|
+
cw = ! this .ccw_ .getValue (),
|
|
1749
|
+
normalIndex = [ ],
|
|
1750
|
+
normals = [ ];
|
|
1751
|
+
|
|
1752
|
+
for (var p = 0; p < points .length; ++ p)
|
|
1753
|
+
normalIndex [p] = [ ];
|
|
1754
|
+
|
|
1755
|
+
for (var c = 0; c < coordIndex .length; c += 3)
|
|
1756
|
+
{
|
|
1757
|
+
var
|
|
1758
|
+
c0 = coordIndex [c],
|
|
1759
|
+
c1 = coordIndex [c + 1],
|
|
1760
|
+
c2 = coordIndex [c + 2];
|
|
1761
|
+
|
|
1762
|
+
normalIndex [c0] .push (normals .length);
|
|
1763
|
+
normalIndex [c1] .push (normals .length + 1);
|
|
1764
|
+
normalIndex [c2] .push (normals .length + 2);
|
|
1765
|
+
|
|
1766
|
+
var normal = Triangle3 .normal (points [c0], points [c1], points [c2], new Vector3 (0, 0, 0));
|
|
1767
|
+
|
|
1768
|
+
if (cw)
|
|
1769
|
+
normal .negate ();
|
|
1770
|
+
|
|
1771
|
+
normals .push (normal);
|
|
1772
|
+
normals .push (normal);
|
|
1773
|
+
normals .push (normal);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
return this .refineNormals (normalIndex, normals, this .creaseAngle_ .getValue ());
|
|
1777
|
+
},
|
|
1778
|
+
createCoordIndex: function ()
|
|
1779
|
+
{
|
|
1780
|
+
// p1 - p4
|
|
1781
|
+
// | \ |
|
|
1782
|
+
// p2 - p3
|
|
1783
|
+
|
|
1784
|
+
var
|
|
1785
|
+
coordIndex = [ ],
|
|
1786
|
+
xDimension = this .xDimension_ .getValue (),
|
|
1787
|
+
zDimension = this .zDimension_ .getValue (),
|
|
1788
|
+
xSize = xDimension - 1,
|
|
1789
|
+
zSize = zDimension - 1;
|
|
1790
|
+
|
|
1791
|
+
for (var z = 0; z < zSize; ++ z)
|
|
1792
|
+
{
|
|
1793
|
+
for (var x = 0; x < xSize; ++ x)
|
|
1794
|
+
{
|
|
1795
|
+
var
|
|
1796
|
+
i1 = z * xDimension + x,
|
|
1797
|
+
i2 = (z + 1) * xDimension + x,
|
|
1798
|
+
i3 = (z + 1) * xDimension + (x + 1),
|
|
1799
|
+
i4 = z * xDimension + (x + 1);
|
|
1800
|
+
|
|
1801
|
+
coordIndex .push (i1); // p1
|
|
1802
|
+
coordIndex .push (i3); // p3
|
|
1803
|
+
coordIndex .push (i2); // p2
|
|
1804
|
+
|
|
1805
|
+
coordIndex .push (i1); // p1
|
|
1806
|
+
coordIndex .push (i4); // p4
|
|
1807
|
+
coordIndex .push (i3); // p3
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
return coordIndex;
|
|
1812
|
+
},
|
|
1813
|
+
createPoints: function ()
|
|
1814
|
+
{
|
|
1815
|
+
var
|
|
1816
|
+
points = [ ],
|
|
1817
|
+
xDimension = this .xDimension_ .getValue (),
|
|
1818
|
+
zDimension = this .zDimension_ .getValue (),
|
|
1819
|
+
xSpacing = this .xSpacing_ .getValue (),
|
|
1820
|
+
zSpacing = this .zSpacing_ .getValue ();
|
|
1821
|
+
|
|
1822
|
+
// When the geoSystem is "GD", xSpacing refers to the number of units of longitude in angle base units between
|
|
1823
|
+
// adjacent height values and zSpacing refers to the number of units of latitude in angle base units between
|
|
1824
|
+
// vertical height values.
|
|
1825
|
+
|
|
1826
|
+
// When the geoSystem is "UTM", xSpacing refers to the number of eastings (length base units) between adjacent
|
|
1827
|
+
// height values and zSpacing refers to the number of northings (length base units) between vertical height values.
|
|
1828
|
+
|
|
1829
|
+
if (this .getStandardOrder ())
|
|
1830
|
+
{
|
|
1831
|
+
for (var z = 0; z < zDimension; ++ z)
|
|
1832
|
+
{
|
|
1833
|
+
for (var x = 0; x < xDimension; ++ x)
|
|
1834
|
+
{
|
|
1835
|
+
var point = new Vector3 (zSpacing * z, // latitude, northing
|
|
1836
|
+
xSpacing * x, // longitude, easting
|
|
1837
|
+
this .getHeight (x + z * xDimension));
|
|
1838
|
+
|
|
1839
|
+
point .add (this .geoGridOrigin_ .getValue ());
|
|
1840
|
+
|
|
1841
|
+
points .push (this .getCoord (point, point));
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
else
|
|
1846
|
+
{
|
|
1847
|
+
for (var z = 0; z < zDimension; ++ z)
|
|
1848
|
+
{
|
|
1849
|
+
for (var x = 0; x < xDimension; ++ x)
|
|
1850
|
+
{
|
|
1851
|
+
var point = new Vector3 (xSpacing * x, // longitude, easting
|
|
1852
|
+
zSpacing * z, // latitude, northing
|
|
1853
|
+
this .getHeight (x + z * xDimension));
|
|
1854
|
+
|
|
1855
|
+
point .add (this .geoGridOrigin_ .getValue ());
|
|
1856
|
+
|
|
1857
|
+
points .push (this .getCoord (point, point));
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
return points;
|
|
1863
|
+
},
|
|
1864
|
+
build: function ()
|
|
1865
|
+
{
|
|
1866
|
+
if (this .xDimension_ .getValue () < 2 || this .zDimension_ .getValue () < 2)
|
|
1867
|
+
return;
|
|
1868
|
+
|
|
1869
|
+
var
|
|
1870
|
+
colorPerVertex = this .colorPerVertex_ .getValue (),
|
|
1871
|
+
normalPerVertex = this .normalPerVertex_ .getValue (),
|
|
1872
|
+
coordIndex = this .createCoordIndex (),
|
|
1873
|
+
colorNode = this .getColor (),
|
|
1874
|
+
texCoordNode = this .getTexCoord (),
|
|
1875
|
+
normalNode = this .getNormal (),
|
|
1876
|
+
points = this .createPoints (),
|
|
1877
|
+
colorArray = this .getColors (),
|
|
1878
|
+
multiTexCoordArray = this .getMultiTexCoords (),
|
|
1879
|
+
normalArray = this .getNormals (),
|
|
1880
|
+
vertexArray = this .getVertices (),
|
|
1881
|
+
face = 0;
|
|
1882
|
+
|
|
1883
|
+
// Vertex attribute
|
|
1884
|
+
|
|
1885
|
+
//std::vector <std::vector <float>> attribArrays (attribNodes .size ());
|
|
1886
|
+
|
|
1887
|
+
//for (size_t a = 0, size = attribNodes .size (); a < size; ++ a)
|
|
1888
|
+
// attribArrays [a] .reserve (coordIndex .size ());
|
|
1889
|
+
|
|
1890
|
+
if (texCoordNode)
|
|
1891
|
+
{
|
|
1892
|
+
texCoordNode .init (multiTexCoordArray);
|
|
1893
|
+
}
|
|
1894
|
+
else
|
|
1895
|
+
{
|
|
1896
|
+
var
|
|
1897
|
+
texCoords = this .createTexCoords (),
|
|
1898
|
+
texCoordArray = this .getTexCoords ();
|
|
1899
|
+
|
|
1900
|
+
multiTexCoordArray .push (texCoordArray);
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
// Build geometry
|
|
1904
|
+
|
|
1905
|
+
for (var c = 0; c < coordIndex .length; ++ face)
|
|
1906
|
+
{
|
|
1907
|
+
for (var p = 0; p < 6; ++ p, ++ c)
|
|
1908
|
+
{
|
|
1909
|
+
var
|
|
1910
|
+
index = coordIndex [c],
|
|
1911
|
+
point = points [index];
|
|
1912
|
+
|
|
1913
|
+
//for (size_t a = 0, size = attribNodes .size (); a < size; ++ a)
|
|
1914
|
+
// attribNodes [a] -> addValue (attribArrays [a], i);
|
|
1915
|
+
|
|
1916
|
+
if (colorNode)
|
|
1917
|
+
{
|
|
1918
|
+
if (colorPerVertex)
|
|
1919
|
+
colorNode .addColor (index, colorArray);
|
|
1920
|
+
else
|
|
1921
|
+
colorNode .addColor (face, colorArray);
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
if (texCoordNode)
|
|
1925
|
+
{
|
|
1926
|
+
texCoordNode .addTexCoord (index, multiTexCoordArray);
|
|
1927
|
+
}
|
|
1928
|
+
else
|
|
1929
|
+
{
|
|
1930
|
+
var t = texCoords [index];
|
|
1931
|
+
|
|
1932
|
+
texCoordArray .push (t .x, t .y, 0, 1);
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
if (normalNode)
|
|
1936
|
+
{
|
|
1937
|
+
if (normalPerVertex)
|
|
1938
|
+
normalNode .addVector (index, normalArray);
|
|
1939
|
+
|
|
1940
|
+
else
|
|
1941
|
+
normalNode .addVector (face, normalArray);
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
vertexArray .push (point .x, point .y, point .z, 1);
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
// Add auto-generated normals if needed.
|
|
1949
|
+
|
|
1950
|
+
if (! normalNode)
|
|
1951
|
+
{
|
|
1952
|
+
var normals = this .createNormals (points, coordIndex);
|
|
1953
|
+
|
|
1954
|
+
for (var i = 0; i < normals .length; ++ i)
|
|
1955
|
+
{
|
|
1956
|
+
var normal = normals [i];
|
|
1957
|
+
|
|
1958
|
+
normalArray .push (normal .x, normal .y, normal .z);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
this .setSolid (this .solid_ .getValue ());
|
|
1963
|
+
this .setCCW (this .ccw_ .getValue ());
|
|
1964
|
+
},
|
|
1965
|
+
});
|
|
1966
|
+
|
|
1967
|
+
return GeoElevationGrid;
|
|
1968
|
+
});
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
|
|
1972
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
1973
|
+
*******************************************************************************
|
|
1974
|
+
*
|
|
1975
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1976
|
+
*
|
|
1977
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
1978
|
+
*
|
|
1979
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
1980
|
+
*
|
|
1981
|
+
* The copyright notice above does not evidence any actual of intended
|
|
1982
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
1983
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
1984
|
+
* create3000.
|
|
1985
|
+
*
|
|
1986
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
1987
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
1988
|
+
* permission of create3000.
|
|
1989
|
+
*
|
|
1990
|
+
* NON-MILITARY USE ONLY
|
|
1991
|
+
*
|
|
1992
|
+
* All create3000 software are effectively free software with a non-military use
|
|
1993
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
1994
|
+
* source in any way you please with the exception anything that uses it must be
|
|
1995
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
1996
|
+
*
|
|
1997
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
1998
|
+
*
|
|
1999
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2000
|
+
*
|
|
2001
|
+
* This file is part of the X_ITE Project.
|
|
2002
|
+
*
|
|
2003
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2004
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2005
|
+
* Free Software Foundation.
|
|
2006
|
+
*
|
|
2007
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2008
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2009
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2010
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2011
|
+
*
|
|
2012
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2013
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2014
|
+
* copy of the GPLv3 License.
|
|
2015
|
+
*
|
|
2016
|
+
* For Silvio, Joy and Adi.
|
|
2017
|
+
*
|
|
2018
|
+
******************************************************************************/
|
|
2019
|
+
|
|
2020
|
+
|
|
2021
|
+
define ('x_ite/Components/Geospatial/GeoLOD',[
|
|
2022
|
+
"x_ite/Fields",
|
|
2023
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2024
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2025
|
+
"x_ite/Components/Core/X3DChildNode",
|
|
2026
|
+
"x_ite/Components/Grouping/X3DBoundedObject",
|
|
2027
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
2028
|
+
"x_ite/Bits/X3DConstants",
|
|
2029
|
+
"x_ite/Bits/TraverseType",
|
|
2030
|
+
"x_ite/Components/Grouping/Group",
|
|
2031
|
+
"x_ite/Components/Networking/Inline",
|
|
2032
|
+
"standard/Math/Numbers/Vector3",
|
|
2033
|
+
"standard/Math/Numbers/Matrix4",
|
|
2034
|
+
"standard/Math/Geometry/Box3",
|
|
2035
|
+
],
|
|
2036
|
+
function (Fields,
|
|
2037
|
+
X3DFieldDefinition,
|
|
2038
|
+
FieldDefinitionArray,
|
|
2039
|
+
X3DChildNode,
|
|
2040
|
+
X3DBoundedObject,
|
|
2041
|
+
X3DGeospatialObject,
|
|
2042
|
+
X3DConstants,
|
|
2043
|
+
TraverseType,
|
|
2044
|
+
Group,
|
|
2045
|
+
Inline,
|
|
2046
|
+
Vector3,
|
|
2047
|
+
Matrix4,
|
|
2048
|
+
Box3)
|
|
2049
|
+
{
|
|
2050
|
+
"use strict";
|
|
2051
|
+
|
|
2052
|
+
var center = new Vector3 (0, 0, 0);
|
|
2053
|
+
|
|
2054
|
+
function GeoLOD (executionContext)
|
|
2055
|
+
{
|
|
2056
|
+
X3DChildNode .call (this, executionContext);
|
|
2057
|
+
X3DBoundedObject .call (this, executionContext);
|
|
2058
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
2059
|
+
|
|
2060
|
+
this .addType (X3DConstants .GeoLOD);
|
|
2061
|
+
|
|
2062
|
+
this .range_ .setUnit ("length");
|
|
2063
|
+
|
|
2064
|
+
this .unload = false;
|
|
2065
|
+
this .rootGroup = new Group (this .getBrowser () .getPrivateScene ());
|
|
2066
|
+
this .rootInline = new Inline (executionContext);
|
|
2067
|
+
this .child1Inline = new Inline (executionContext);
|
|
2068
|
+
this .child2Inline = new Inline (executionContext);
|
|
2069
|
+
this .child3Inline = new Inline (executionContext);
|
|
2070
|
+
this .child4Inline = new Inline (executionContext);
|
|
2071
|
+
this .childrenLoaded = false;
|
|
2072
|
+
this .childBBox = new Box3 ();
|
|
2073
|
+
this .keepCurrentLevel = false;
|
|
2074
|
+
this .modelViewMatrix = new Matrix4 ();
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
GeoLOD .prototype = Object .assign (Object .create (X3DChildNode .prototype),
|
|
2078
|
+
X3DBoundedObject .prototype,
|
|
2079
|
+
X3DGeospatialObject .prototype,
|
|
2080
|
+
{
|
|
2081
|
+
constructor: GeoLOD,
|
|
2082
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
2083
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2084
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
2085
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
2086
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "rootUrl", new Fields .MFString ()),
|
|
2087
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "child1Url", new Fields .MFString ()),
|
|
2088
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "child2Url", new Fields .MFString ()),
|
|
2089
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "child3Url", new Fields .MFString ()),
|
|
2090
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "child4Url", new Fields .MFString ()),
|
|
2091
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "center", new Fields .SFVec3d ()),
|
|
2092
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "range", new Fields .SFFloat (10)),
|
|
2093
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "level_changed", new Fields .SFInt32 (-1)),
|
|
2094
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
2095
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
2096
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
2097
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
2098
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "rootNode", new Fields .MFNode ()),
|
|
2099
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "children", new Fields .MFNode ()),
|
|
2100
|
+
]),
|
|
2101
|
+
getTypeName: function ()
|
|
2102
|
+
{
|
|
2103
|
+
return "GeoLOD";
|
|
2104
|
+
},
|
|
2105
|
+
getComponentName: function ()
|
|
2106
|
+
{
|
|
2107
|
+
return "Geospatial";
|
|
2108
|
+
},
|
|
2109
|
+
getContainerField: function ()
|
|
2110
|
+
{
|
|
2111
|
+
return "children";
|
|
2112
|
+
},
|
|
2113
|
+
initialize: function ()
|
|
2114
|
+
{
|
|
2115
|
+
X3DChildNode .prototype .initialize .call (this);
|
|
2116
|
+
X3DBoundedObject .prototype .initialize .call (this);
|
|
2117
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
2118
|
+
|
|
2119
|
+
this .rootNode_ .addFieldInterest (this .rootGroup .children_);
|
|
2120
|
+
|
|
2121
|
+
this .rootGroup .children_ = this .rootNode_;
|
|
2122
|
+
this .rootGroup .setPrivate (true);
|
|
2123
|
+
this .rootGroup .setup ();
|
|
2124
|
+
|
|
2125
|
+
this .rootInline .loadState_ .addInterest ("set_rootLoadState__", this);
|
|
2126
|
+
this .child1Inline .loadState_ .addInterest ("set_childLoadState__", this);
|
|
2127
|
+
this .child2Inline .loadState_ .addInterest ("set_childLoadState__", this);
|
|
2128
|
+
this .child3Inline .loadState_ .addInterest ("set_childLoadState__", this);
|
|
2129
|
+
this .child4Inline .loadState_ .addInterest ("set_childLoadState__", this);
|
|
2130
|
+
|
|
2131
|
+
this .rootUrl_ .addFieldInterest (this .rootInline .url_);
|
|
2132
|
+
this .child1Url_ .addFieldInterest (this .child1Inline .url_);
|
|
2133
|
+
this .child2Url_ .addFieldInterest (this .child2Inline .url_);
|
|
2134
|
+
this .child3Url_ .addFieldInterest (this .child3Inline .url_);
|
|
2135
|
+
this .child4Url_ .addFieldInterest (this .child4Inline .url_);
|
|
2136
|
+
|
|
2137
|
+
this .rootInline .load_ = true;
|
|
2138
|
+
this .child1Inline .load_ = false;
|
|
2139
|
+
this .child2Inline .load_ = false;
|
|
2140
|
+
this .child3Inline .load_ = false;
|
|
2141
|
+
this .child4Inline .load_ = false;
|
|
2142
|
+
|
|
2143
|
+
this .rootInline .url_ = this .rootUrl_;
|
|
2144
|
+
this .child1Inline .url_ = this .child1Url_;
|
|
2145
|
+
this .child2Inline .url_ = this .child2Url_;
|
|
2146
|
+
this .child3Inline .url_ = this .child3Url_;
|
|
2147
|
+
this .child4Inline .url_ = this .child4Url_;
|
|
2148
|
+
|
|
2149
|
+
this .rootInline .setup ();
|
|
2150
|
+
this .child1Inline .setup ();
|
|
2151
|
+
this .child2Inline .setup ();
|
|
2152
|
+
this .child3Inline .setup ();
|
|
2153
|
+
this .child4Inline .setup ();
|
|
2154
|
+
},
|
|
2155
|
+
getBBox: function (bbox, shadow)
|
|
2156
|
+
{
|
|
2157
|
+
if (this .bboxSize_ .getValue () .equals (this .getDefaultBBoxSize ()))
|
|
2158
|
+
{
|
|
2159
|
+
switch (this .childrenLoaded ? this .level_changed_ .getValue () : 0)
|
|
2160
|
+
{
|
|
2161
|
+
case 0:
|
|
2162
|
+
{
|
|
2163
|
+
if (this .rootNode_ .length)
|
|
2164
|
+
return this .rootGroup .getBBox (bbox, shadow);
|
|
2165
|
+
|
|
2166
|
+
return this .rootInline .getBBox (bbox, shadow);
|
|
2167
|
+
}
|
|
2168
|
+
case 1:
|
|
2169
|
+
{
|
|
2170
|
+
// Must be unique for each GeoLOD..
|
|
2171
|
+
const childBBox = this .childBBox;
|
|
2172
|
+
|
|
2173
|
+
bbox .set ();
|
|
2174
|
+
|
|
2175
|
+
bbox .add (this .child1Inline .getBBox (childBBox, shadow));
|
|
2176
|
+
bbox .add (this .child2Inline .getBBox (childBBox, shadow));
|
|
2177
|
+
bbox .add (this .child3Inline .getBBox (childBBox, shadow));
|
|
2178
|
+
bbox .add (this .child4Inline .getBBox (childBBox, shadow));
|
|
2179
|
+
|
|
2180
|
+
return bbox;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
return bbox .set ();
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
return bbox .set (this .bboxSize_ .getValue (), this .bboxCenter_ .getValue ());
|
|
2188
|
+
},
|
|
2189
|
+
set_rootLoadState__: function ()
|
|
2190
|
+
{
|
|
2191
|
+
if (this .level_changed_ .getValue () !== 0)
|
|
2192
|
+
return;
|
|
2193
|
+
|
|
2194
|
+
if (this .rootNode_ .length)
|
|
2195
|
+
return;
|
|
2196
|
+
|
|
2197
|
+
if (this .rootInline .checkLoadState () === X3DConstants .COMPLETE_STATE)
|
|
2198
|
+
{
|
|
2199
|
+
this .children_ = this .rootInline .getInternalScene () .getRootNodes ();
|
|
2200
|
+
this .childrenLoaded = false;
|
|
2201
|
+
}
|
|
2202
|
+
},
|
|
2203
|
+
set_childLoadState__: function ()
|
|
2204
|
+
{
|
|
2205
|
+
if (this .level_changed_ .getValue () !== 1)
|
|
2206
|
+
return;
|
|
2207
|
+
|
|
2208
|
+
var loaded = 0;
|
|
2209
|
+
|
|
2210
|
+
if (this .child1Inline .checkLoadState () === X3DConstants .COMPLETE_STATE ||
|
|
2211
|
+
this .child1Inline .checkLoadState () === X3DConstants .FAILED_STATE)
|
|
2212
|
+
++ loaded;
|
|
2213
|
+
|
|
2214
|
+
if (this .child2Inline .checkLoadState () === X3DConstants .COMPLETE_STATE ||
|
|
2215
|
+
this .child2Inline .checkLoadState () === X3DConstants .FAILED_STATE)
|
|
2216
|
+
++ loaded;
|
|
2217
|
+
|
|
2218
|
+
if (this .child3Inline .checkLoadState () === X3DConstants .COMPLETE_STATE ||
|
|
2219
|
+
this .child3Inline .checkLoadState () === X3DConstants .FAILED_STATE)
|
|
2220
|
+
++ loaded;
|
|
2221
|
+
|
|
2222
|
+
if (this .child4Inline .checkLoadState () === X3DConstants .COMPLETE_STATE ||
|
|
2223
|
+
this .child4Inline .checkLoadState () === X3DConstants .FAILED_STATE)
|
|
2224
|
+
++ loaded;
|
|
2225
|
+
|
|
2226
|
+
if (loaded === 4)
|
|
2227
|
+
{
|
|
2228
|
+
this .childrenLoaded = true;
|
|
2229
|
+
|
|
2230
|
+
var children = this .children_;
|
|
2231
|
+
|
|
2232
|
+
children .length = 0;
|
|
2233
|
+
|
|
2234
|
+
var rootNodes = this .child1Inline .getInternalScene () .getRootNodes ();
|
|
2235
|
+
|
|
2236
|
+
for (var i = 0, length = rootNodes .length; i < length; ++ i)
|
|
2237
|
+
children .push (rootNodes [i]);
|
|
2238
|
+
|
|
2239
|
+
var rootNodes = this .child2Inline .getInternalScene () .getRootNodes ();
|
|
2240
|
+
|
|
2241
|
+
for (var i = 0, length = rootNodes .length; i < length; ++ i)
|
|
2242
|
+
children .push (rootNodes [i]);
|
|
2243
|
+
|
|
2244
|
+
var rootNodes = this .child3Inline .getInternalScene () .getRootNodes ();
|
|
2245
|
+
|
|
2246
|
+
for (var i = 0, length = rootNodes .length; i < length; ++ i)
|
|
2247
|
+
children .push (rootNodes [i]);
|
|
2248
|
+
|
|
2249
|
+
var rootNodes = this .child4Inline .getInternalScene () .getRootNodes ();
|
|
2250
|
+
|
|
2251
|
+
for (var i = 0, length = rootNodes .length; i < length; ++ i)
|
|
2252
|
+
children .push (rootNodes [i]);
|
|
2253
|
+
}
|
|
2254
|
+
},
|
|
2255
|
+
set_childCameraObject__: function ()
|
|
2256
|
+
{
|
|
2257
|
+
this .setCameraObject (this .child1Inline .getCameraObject () ||
|
|
2258
|
+
this .child2Inline .getCameraObject () ||
|
|
2259
|
+
this .child3Inline .getCameraObject () ||
|
|
2260
|
+
this .child4Inline .getCameraObject ());
|
|
2261
|
+
},
|
|
2262
|
+
set_childPickableObject__: function ()
|
|
2263
|
+
{
|
|
2264
|
+
this .setPickableObject (this .child1Inline .getPickableObject () ||
|
|
2265
|
+
this .child2Inline .getPickableObject () ||
|
|
2266
|
+
this .child3Inline .getPickableObject () ||
|
|
2267
|
+
this .child4Inline .getPickableObject ());
|
|
2268
|
+
},
|
|
2269
|
+
getLevel: function (modelViewMatrix)
|
|
2270
|
+
{
|
|
2271
|
+
var distance = this .getDistance (modelViewMatrix);
|
|
2272
|
+
|
|
2273
|
+
if (distance < this .range_ .getValue ())
|
|
2274
|
+
return 1;
|
|
2275
|
+
|
|
2276
|
+
return 0;
|
|
2277
|
+
},
|
|
2278
|
+
getDistance: function (modelViewMatrix)
|
|
2279
|
+
{
|
|
2280
|
+
modelViewMatrix .translate (this .getCoord (this .center_ .getValue (), center));
|
|
2281
|
+
|
|
2282
|
+
return modelViewMatrix .origin .abs ();
|
|
2283
|
+
},
|
|
2284
|
+
traverse: function (type, renderObject)
|
|
2285
|
+
{
|
|
2286
|
+
switch (type)
|
|
2287
|
+
{
|
|
2288
|
+
case TraverseType .PICKING:
|
|
2289
|
+
{
|
|
2290
|
+
var
|
|
2291
|
+
browser = renderObject .getBrowser (),
|
|
2292
|
+
pickingHierarchy = browser .getPickingHierarchy ();
|
|
2293
|
+
|
|
2294
|
+
pickingHierarchy .push (this);
|
|
2295
|
+
|
|
2296
|
+
this .traverseChildren (type, renderObject);
|
|
2297
|
+
|
|
2298
|
+
pickingHierarchy .pop ();
|
|
2299
|
+
return;
|
|
2300
|
+
}
|
|
2301
|
+
case TraverseType .DISPLAY:
|
|
2302
|
+
{
|
|
2303
|
+
var level = this .getLevel (this .modelViewMatrix .assign (renderObject .getModelViewMatrix () .get ()));
|
|
2304
|
+
|
|
2305
|
+
if (level !== this .level_changed_ .getValue ())
|
|
2306
|
+
{
|
|
2307
|
+
this .level_changed_ = level;
|
|
2308
|
+
|
|
2309
|
+
switch (level)
|
|
2310
|
+
{
|
|
2311
|
+
case 0:
|
|
2312
|
+
{
|
|
2313
|
+
this .child1Inline .isCameraObject_ .removeInterest ("set_childCameraObject__", this);
|
|
2314
|
+
this .child2Inline .isCameraObject_ .removeInterest ("set_childCameraObject__", this);
|
|
2315
|
+
this .child3Inline .isCameraObject_ .removeInterest ("set_childCameraObject__", this);
|
|
2316
|
+
this .child4Inline .isCameraObject_ .removeInterest ("set_childCameraObject__", this);
|
|
2317
|
+
this .child1Inline .isPickableObject_ .removeInterest ("set_childPickableObject__", this);
|
|
2318
|
+
this .child2Inline .isPickableObject_ .removeInterest ("set_childPickableObject__", this);
|
|
2319
|
+
this .child3Inline .isPickableObject_ .removeInterest ("set_childPickableObject__", this);
|
|
2320
|
+
this .child4Inline .isPickableObject_ .removeInterest ("set_childPickableObject__", this);
|
|
2321
|
+
|
|
2322
|
+
if (this .rootNode_ .length)
|
|
2323
|
+
{
|
|
2324
|
+
this .rootGroup .isCameraObject_ .addFieldInterest (this .isCameraObject_);
|
|
2325
|
+
this .rootGroup .isPickableObject_ .addFieldInterest (this .isPickableObject_);
|
|
2326
|
+
|
|
2327
|
+
this .setCameraObject (this .rootGroup .getCameraObject ());
|
|
2328
|
+
this .setPickableObject (this .rootGroup .getPickableObject ());
|
|
2329
|
+
|
|
2330
|
+
this .children_ = this .rootNode_;
|
|
2331
|
+
this .childrenLoaded = false;
|
|
2332
|
+
}
|
|
2333
|
+
else
|
|
2334
|
+
{
|
|
2335
|
+
if (this .rootInline .checkLoadState () == X3DConstants .COMPLETE_STATE)
|
|
2336
|
+
{
|
|
2337
|
+
this .rootInline .isCameraObject_ .addFieldInterest (this .isCameraObject_);
|
|
2338
|
+
this .rootInline .isPickableObject_ .addFieldInterest (this .isPickableObject_);
|
|
2339
|
+
|
|
2340
|
+
this .setCameraObject (this .rootInline .getCameraObject ());
|
|
2341
|
+
this .setPickableObject (this .rootInline .getPickableObject ());
|
|
2342
|
+
|
|
2343
|
+
this .children_ = this .rootInline .getInternalScene () .getRootNodes ();
|
|
2344
|
+
this .childrenLoaded = false;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
if (this .unload)
|
|
2349
|
+
{
|
|
2350
|
+
this .child1Inline .load_ = false;
|
|
2351
|
+
this .child2Inline .load_ = false;
|
|
2352
|
+
this .child3Inline .load_ = false;
|
|
2353
|
+
this .child4Inline .load_ = false;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
break;
|
|
2357
|
+
}
|
|
2358
|
+
case 1:
|
|
2359
|
+
{
|
|
2360
|
+
if (this .rootNode_ .length)
|
|
2361
|
+
{
|
|
2362
|
+
this .rootGroup .isCameraObject_ .removeFieldInterest (this .isCameraObject_);
|
|
2363
|
+
this .rootGroup .isPickableObject_ .removeFieldInterest (this .isPickableObject_);
|
|
2364
|
+
}
|
|
2365
|
+
else
|
|
2366
|
+
{
|
|
2367
|
+
this .rootInline .isCameraObject_ .removeFieldInterest (this .isCameraObject_);
|
|
2368
|
+
this .rootInline .isPickableObject_ .removeFieldInterest (this .isPickableObject_);
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
this .child1Inline .isCameraObject_ .addInterest ("set_childCameraObject__", this);
|
|
2372
|
+
this .child2Inline .isCameraObject_ .addInterest ("set_childCameraObject__", this);
|
|
2373
|
+
this .child3Inline .isCameraObject_ .addInterest ("set_childCameraObject__", this);
|
|
2374
|
+
this .child4Inline .isCameraObject_ .addInterest ("set_childCameraObject__", this);
|
|
2375
|
+
this .child1Inline .isPickableObject_ .addInterest ("set_childPickableObject__", this);
|
|
2376
|
+
this .child2Inline .isPickableObject_ .addInterest ("set_childPickableObject__", this);
|
|
2377
|
+
this .child3Inline .isPickableObject_ .addInterest ("set_childPickableObject__", this);
|
|
2378
|
+
this .child4Inline .isPickableObject_ .addInterest ("set_childPickableObject__", this);
|
|
2379
|
+
|
|
2380
|
+
this .set_childCameraObject__ ();
|
|
2381
|
+
this .set_childPickableObject__ ();
|
|
2382
|
+
|
|
2383
|
+
if (this .child1Inline .load_ .getValue ())
|
|
2384
|
+
{
|
|
2385
|
+
this .set_childLoadState__ ();
|
|
2386
|
+
}
|
|
2387
|
+
else
|
|
2388
|
+
{
|
|
2389
|
+
this .child1Inline .load_ = true;
|
|
2390
|
+
this .child2Inline .load_ = true;
|
|
2391
|
+
this .child3Inline .load_ = true;
|
|
2392
|
+
this .child4Inline .load_ = true;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
break;
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
this .traverseChildren (type, renderObject);
|
|
2401
|
+
return;
|
|
2402
|
+
}
|
|
2403
|
+
default:
|
|
2404
|
+
{
|
|
2405
|
+
this .traverseChildren (type, renderObject);
|
|
2406
|
+
return;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
},
|
|
2410
|
+
traverseChildren: function (type, renderObject)
|
|
2411
|
+
{
|
|
2412
|
+
switch (this .childrenLoaded ? this .level_changed_ .getValue () : 0)
|
|
2413
|
+
{
|
|
2414
|
+
case 0:
|
|
2415
|
+
{
|
|
2416
|
+
if (this .rootNode_ .length)
|
|
2417
|
+
this .rootGroup .traverse (type, renderObject);
|
|
2418
|
+
else
|
|
2419
|
+
this .rootInline .traverse (type, renderObject);
|
|
2420
|
+
|
|
2421
|
+
break;
|
|
2422
|
+
}
|
|
2423
|
+
case 1:
|
|
2424
|
+
{
|
|
2425
|
+
this .child1Inline .traverse (type, renderObject);
|
|
2426
|
+
this .child2Inline .traverse (type, renderObject);
|
|
2427
|
+
this .child3Inline .traverse (type, renderObject);
|
|
2428
|
+
this .child4Inline .traverse (type, renderObject);
|
|
2429
|
+
break;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
},
|
|
2433
|
+
});
|
|
2434
|
+
|
|
2435
|
+
return GeoLOD;
|
|
2436
|
+
});
|
|
2437
|
+
|
|
2438
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2439
|
+
*******************************************************************************
|
|
2440
|
+
*
|
|
2441
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2442
|
+
*
|
|
2443
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2444
|
+
*
|
|
2445
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2446
|
+
*
|
|
2447
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2448
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2449
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2450
|
+
* create3000.
|
|
2451
|
+
*
|
|
2452
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2453
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2454
|
+
* permission of create3000.
|
|
2455
|
+
*
|
|
2456
|
+
* NON-MILITARY USE ONLY
|
|
2457
|
+
*
|
|
2458
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2459
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2460
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2461
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2462
|
+
*
|
|
2463
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2464
|
+
*
|
|
2465
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2466
|
+
*
|
|
2467
|
+
* This file is part of the X_ITE Project.
|
|
2468
|
+
*
|
|
2469
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2470
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2471
|
+
* Free Software Foundation.
|
|
2472
|
+
*
|
|
2473
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2474
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2475
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2476
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2477
|
+
*
|
|
2478
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2479
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2480
|
+
* copy of the GPLv3 License.
|
|
2481
|
+
*
|
|
2482
|
+
* For Silvio, Joy and Adi.
|
|
2483
|
+
*
|
|
2484
|
+
******************************************************************************/
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
define ('x_ite/Components/Geospatial/GeoLocation',[
|
|
2488
|
+
"x_ite/Fields",
|
|
2489
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2490
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2491
|
+
"x_ite/Components/Grouping/X3DTransformMatrix3DNode",
|
|
2492
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
2493
|
+
"x_ite/Bits/X3DConstants",
|
|
2494
|
+
"standard/Math/Numbers/Matrix4",
|
|
2495
|
+
],
|
|
2496
|
+
function (Fields,
|
|
2497
|
+
X3DFieldDefinition,
|
|
2498
|
+
FieldDefinitionArray,
|
|
2499
|
+
X3DTransformMatrix3DNode,
|
|
2500
|
+
X3DGeospatialObject,
|
|
2501
|
+
X3DConstants,
|
|
2502
|
+
Matrix4)
|
|
2503
|
+
{
|
|
2504
|
+
"use strict";
|
|
2505
|
+
|
|
2506
|
+
var locationMatrix = new Matrix4 ();
|
|
2507
|
+
|
|
2508
|
+
function GeoLocation (executionContext)
|
|
2509
|
+
{
|
|
2510
|
+
X3DTransformMatrix3DNode .call (this, executionContext);
|
|
2511
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
2512
|
+
|
|
2513
|
+
this .addType (X3DConstants .GeoLocation);
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
GeoLocation .prototype = Object .assign (Object .create (X3DTransformMatrix3DNode .prototype),
|
|
2517
|
+
X3DGeospatialObject .prototype,
|
|
2518
|
+
{
|
|
2519
|
+
constructor: GeoLocation,
|
|
2520
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
2521
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2522
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
2523
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "geoCoords", new Fields .SFVec3d ()),
|
|
2524
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
2525
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
2526
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
2527
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
2528
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
2529
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
2530
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
2531
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
2532
|
+
]),
|
|
2533
|
+
getTypeName: function ()
|
|
2534
|
+
{
|
|
2535
|
+
return "GeoLocation";
|
|
2536
|
+
},
|
|
2537
|
+
getComponentName: function ()
|
|
2538
|
+
{
|
|
2539
|
+
return "Geospatial";
|
|
2540
|
+
},
|
|
2541
|
+
getContainerField: function ()
|
|
2542
|
+
{
|
|
2543
|
+
return "children";
|
|
2544
|
+
},
|
|
2545
|
+
initialize: function ()
|
|
2546
|
+
{
|
|
2547
|
+
X3DTransformMatrix3DNode .prototype .initialize .call (this);
|
|
2548
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
2549
|
+
|
|
2550
|
+
this .addInterest ("eventsProcessed", this);
|
|
2551
|
+
|
|
2552
|
+
this .eventsProcessed ();
|
|
2553
|
+
},
|
|
2554
|
+
eventsProcessed: function ()
|
|
2555
|
+
{
|
|
2556
|
+
this .setMatrix (this .getLocationMatrix (this .geoCoords_ .getValue (), locationMatrix));
|
|
2557
|
+
},
|
|
2558
|
+
});
|
|
2559
|
+
|
|
2560
|
+
return GeoLocation;
|
|
2561
|
+
});
|
|
2562
|
+
|
|
2563
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2564
|
+
*******************************************************************************
|
|
2565
|
+
*
|
|
2566
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2567
|
+
*
|
|
2568
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2569
|
+
*
|
|
2570
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2571
|
+
*
|
|
2572
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2573
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2574
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2575
|
+
* create3000.
|
|
2576
|
+
*
|
|
2577
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2578
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2579
|
+
* permission of create3000.
|
|
2580
|
+
*
|
|
2581
|
+
* NON-MILITARY USE ONLY
|
|
2582
|
+
*
|
|
2583
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2584
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2585
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2586
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2587
|
+
*
|
|
2588
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2589
|
+
*
|
|
2590
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2591
|
+
*
|
|
2592
|
+
* This file is part of the X_ITE Project.
|
|
2593
|
+
*
|
|
2594
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2595
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2596
|
+
* Free Software Foundation.
|
|
2597
|
+
*
|
|
2598
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2599
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2600
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2601
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2602
|
+
*
|
|
2603
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2604
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2605
|
+
* copy of the GPLv3 License.
|
|
2606
|
+
*
|
|
2607
|
+
* For Silvio, Joy and Adi.
|
|
2608
|
+
*
|
|
2609
|
+
******************************************************************************/
|
|
2610
|
+
|
|
2611
|
+
|
|
2612
|
+
define ('x_ite/Components/Geospatial/GeoMetadata',[
|
|
2613
|
+
"x_ite/Fields",
|
|
2614
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2615
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2616
|
+
"x_ite/Components/Core/X3DInfoNode",
|
|
2617
|
+
"x_ite/Bits/X3DConstants",
|
|
2618
|
+
],
|
|
2619
|
+
function (Fields,
|
|
2620
|
+
X3DFieldDefinition,
|
|
2621
|
+
FieldDefinitionArray,
|
|
2622
|
+
X3DInfoNode,
|
|
2623
|
+
X3DConstants)
|
|
2624
|
+
{
|
|
2625
|
+
"use strict";
|
|
2626
|
+
|
|
2627
|
+
function GeoMetadata (executionContext)
|
|
2628
|
+
{
|
|
2629
|
+
X3DInfoNode .call (this, executionContext);
|
|
2630
|
+
|
|
2631
|
+
this .addType (X3DConstants .GeoMetadata);
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
GeoMetadata .prototype = Object .assign (Object .create (X3DInfoNode .prototype),
|
|
2635
|
+
{
|
|
2636
|
+
constructor: GeoMetadata,
|
|
2637
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
2638
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2639
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "url", new Fields .MFString ()),
|
|
2640
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "summary", new Fields .MFString ()),
|
|
2641
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "data", new Fields .MFNode ()),
|
|
2642
|
+
]),
|
|
2643
|
+
getTypeName: function ()
|
|
2644
|
+
{
|
|
2645
|
+
return "GeoMetadata";
|
|
2646
|
+
},
|
|
2647
|
+
getComponentName: function ()
|
|
2648
|
+
{
|
|
2649
|
+
return "Geospatial";
|
|
2650
|
+
},
|
|
2651
|
+
getContainerField: function ()
|
|
2652
|
+
{
|
|
2653
|
+
return "children";
|
|
2654
|
+
},
|
|
2655
|
+
});
|
|
2656
|
+
|
|
2657
|
+
return GeoMetadata;
|
|
2658
|
+
});
|
|
2659
|
+
|
|
2660
|
+
|
|
2661
|
+
|
|
2662
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2663
|
+
*******************************************************************************
|
|
2664
|
+
*
|
|
2665
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2666
|
+
*
|
|
2667
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2668
|
+
*
|
|
2669
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2670
|
+
*
|
|
2671
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2672
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2673
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2674
|
+
* create3000.
|
|
2675
|
+
*
|
|
2676
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2677
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2678
|
+
* permission of create3000.
|
|
2679
|
+
*
|
|
2680
|
+
* NON-MILITARY USE ONLY
|
|
2681
|
+
*
|
|
2682
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2683
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2684
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2685
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2686
|
+
*
|
|
2687
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2688
|
+
*
|
|
2689
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2690
|
+
*
|
|
2691
|
+
* This file is part of the X_ITE Project.
|
|
2692
|
+
*
|
|
2693
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2694
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2695
|
+
* Free Software Foundation.
|
|
2696
|
+
*
|
|
2697
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2698
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2699
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2700
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2701
|
+
*
|
|
2702
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2703
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2704
|
+
* copy of the GPLv3 License.
|
|
2705
|
+
*
|
|
2706
|
+
* For Silvio, Joy and Adi.
|
|
2707
|
+
*
|
|
2708
|
+
******************************************************************************/
|
|
2709
|
+
|
|
2710
|
+
|
|
2711
|
+
define ('x_ite/Components/Geospatial/GeoOrigin',[
|
|
2712
|
+
"x_ite/Fields",
|
|
2713
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2714
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2715
|
+
"x_ite/Components/Core/X3DNode",
|
|
2716
|
+
"x_ite/Bits/X3DConstants",
|
|
2717
|
+
"x_ite/Browser/Geospatial/Geospatial",
|
|
2718
|
+
],
|
|
2719
|
+
function (Fields,
|
|
2720
|
+
X3DFieldDefinition,
|
|
2721
|
+
FieldDefinitionArray,
|
|
2722
|
+
X3DNode,
|
|
2723
|
+
X3DConstants,
|
|
2724
|
+
Geospatial)
|
|
2725
|
+
{
|
|
2726
|
+
"use strict";
|
|
2727
|
+
|
|
2728
|
+
function GeoOrigin (executionContext)
|
|
2729
|
+
{
|
|
2730
|
+
X3DNode .call (this, executionContext);
|
|
2731
|
+
|
|
2732
|
+
this .addType (X3DConstants .GeoOrigin);
|
|
2733
|
+
|
|
2734
|
+
this .radians = false;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
GeoOrigin .prototype = Object .assign (Object .create (X3DNode .prototype),
|
|
2738
|
+
{
|
|
2739
|
+
constructor: GeoOrigin,
|
|
2740
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
2741
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2742
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
2743
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "geoCoords", new Fields .SFVec3d ()),
|
|
2744
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "rotateYUp", new Fields .SFBool ()),
|
|
2745
|
+
]),
|
|
2746
|
+
getTypeName: function ()
|
|
2747
|
+
{
|
|
2748
|
+
return "GeoOrigin";
|
|
2749
|
+
},
|
|
2750
|
+
getComponentName: function ()
|
|
2751
|
+
{
|
|
2752
|
+
return "Geospatial";
|
|
2753
|
+
},
|
|
2754
|
+
getContainerField: function ()
|
|
2755
|
+
{
|
|
2756
|
+
return "geoOrigin";
|
|
2757
|
+
},
|
|
2758
|
+
initialize: function ()
|
|
2759
|
+
{
|
|
2760
|
+
X3DNode .prototype .initialize .call (this);
|
|
2761
|
+
|
|
2762
|
+
this .geoSystem_ .addInterest ("set_geoSystem__", this);
|
|
2763
|
+
|
|
2764
|
+
this .set_geoSystem__ ();
|
|
2765
|
+
},
|
|
2766
|
+
set_geoSystem__: function ()
|
|
2767
|
+
{
|
|
2768
|
+
this .referenceFrame = Geospatial .getReferenceFrame (this .geoSystem_, this .radians);
|
|
2769
|
+
},
|
|
2770
|
+
getOrigin: function (result)
|
|
2771
|
+
{
|
|
2772
|
+
return this .referenceFrame .convert (this .geoCoords_ .getValue (), result);
|
|
2773
|
+
},
|
|
2774
|
+
});
|
|
2775
|
+
|
|
2776
|
+
return GeoOrigin;
|
|
2777
|
+
});
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
|
|
2781
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2782
|
+
*******************************************************************************
|
|
2783
|
+
*
|
|
2784
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2785
|
+
*
|
|
2786
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2787
|
+
*
|
|
2788
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2789
|
+
*
|
|
2790
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2791
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2792
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2793
|
+
* create3000.
|
|
2794
|
+
*
|
|
2795
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2796
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2797
|
+
* permission of create3000.
|
|
2798
|
+
*
|
|
2799
|
+
* NON-MILITARY USE ONLY
|
|
2800
|
+
*
|
|
2801
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2802
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2803
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2804
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2805
|
+
*
|
|
2806
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2807
|
+
*
|
|
2808
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2809
|
+
*
|
|
2810
|
+
* This file is part of the X_ITE Project.
|
|
2811
|
+
*
|
|
2812
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2813
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2814
|
+
* Free Software Foundation.
|
|
2815
|
+
*
|
|
2816
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2817
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2818
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2819
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2820
|
+
*
|
|
2821
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2822
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2823
|
+
* copy of the GPLv3 License.
|
|
2824
|
+
*
|
|
2825
|
+
* For Silvio, Joy and Adi.
|
|
2826
|
+
*
|
|
2827
|
+
******************************************************************************/
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
define ('x_ite/Components/Geospatial/GeoPositionInterpolator',[
|
|
2831
|
+
"x_ite/Fields",
|
|
2832
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2833
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2834
|
+
"x_ite/Components/Interpolation/X3DInterpolatorNode",
|
|
2835
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
2836
|
+
"x_ite/Browser/Geospatial/Geocentric",
|
|
2837
|
+
"x_ite/Bits/X3DConstants",
|
|
2838
|
+
"standard/Math/Numbers/Vector3",
|
|
2839
|
+
],
|
|
2840
|
+
function (Fields,
|
|
2841
|
+
X3DFieldDefinition,
|
|
2842
|
+
FieldDefinitionArray,
|
|
2843
|
+
X3DInterpolatorNode,
|
|
2844
|
+
X3DGeospatialObject,
|
|
2845
|
+
Geocentric,
|
|
2846
|
+
X3DConstants,
|
|
2847
|
+
Vector3)
|
|
2848
|
+
{
|
|
2849
|
+
"use strict";
|
|
2850
|
+
|
|
2851
|
+
function GeoPositionInterpolator (executionContext)
|
|
2852
|
+
{
|
|
2853
|
+
X3DInterpolatorNode .call (this, executionContext);
|
|
2854
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
2855
|
+
|
|
2856
|
+
this .addType (X3DConstants .GeoPositionInterpolator);
|
|
2857
|
+
|
|
2858
|
+
this .value_changed_ .setUnit ("length");
|
|
2859
|
+
|
|
2860
|
+
this .geocentric = new Geocentric ();
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
GeoPositionInterpolator .prototype = Object .assign (Object .create (X3DInterpolatorNode .prototype),
|
|
2864
|
+
X3DGeospatialObject .prototype,
|
|
2865
|
+
{
|
|
2866
|
+
constructor: GeoPositionInterpolator,
|
|
2867
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
2868
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
2869
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
2870
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
2871
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "set_fraction", new Fields .SFFloat ()),
|
|
2872
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "key", new Fields .MFFloat ()),
|
|
2873
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "keyValue", new Fields .MFVec3d ()),
|
|
2874
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "value_changed", new Fields .SFVec3d ()),
|
|
2875
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "geovalue_changed", new Fields .SFVec3d ()),
|
|
2876
|
+
]),
|
|
2877
|
+
keyValue0: new Vector3 (0, 0, 0),
|
|
2878
|
+
keyValue1: new Vector3 (0, 0, 0),
|
|
2879
|
+
geovalue: new Vector3 (0, 0, 0),
|
|
2880
|
+
value: new Vector3 (0, 0, 0),
|
|
2881
|
+
getTypeName: function ()
|
|
2882
|
+
{
|
|
2883
|
+
return "GeoPositionInterpolator";
|
|
2884
|
+
},
|
|
2885
|
+
getComponentName: function ()
|
|
2886
|
+
{
|
|
2887
|
+
return "Geospatial";
|
|
2888
|
+
},
|
|
2889
|
+
getContainerField: function ()
|
|
2890
|
+
{
|
|
2891
|
+
return "children";
|
|
2892
|
+
},
|
|
2893
|
+
setup: function ()
|
|
2894
|
+
{
|
|
2895
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
2896
|
+
|
|
2897
|
+
X3DInterpolatorNode .prototype .setup .call (this);
|
|
2898
|
+
},
|
|
2899
|
+
initialize: function ()
|
|
2900
|
+
{
|
|
2901
|
+
X3DInterpolatorNode .prototype .initialize .call (this);
|
|
2902
|
+
|
|
2903
|
+
this .keyValue_ .addInterest ("set_keyValue__", this);
|
|
2904
|
+
},
|
|
2905
|
+
set_keyValue__: function ()
|
|
2906
|
+
{
|
|
2907
|
+
var
|
|
2908
|
+
key = this .key_,
|
|
2909
|
+
keyValue = this .keyValue_;
|
|
2910
|
+
|
|
2911
|
+
if (keyValue .length < key .length)
|
|
2912
|
+
keyValue .resize (key .length, keyValue .length ? keyValue [keyValue .length - 1] : new Fields .SFVec3f ());
|
|
2913
|
+
},
|
|
2914
|
+
interpolate: function (index0, index1, weight)
|
|
2915
|
+
{
|
|
2916
|
+
try
|
|
2917
|
+
{
|
|
2918
|
+
this .getCoord (this .keyValue_ [index0] .getValue (), this .keyValue0);
|
|
2919
|
+
this .getCoord (this .keyValue_ [index1] .getValue (), this .keyValue1);
|
|
2920
|
+
|
|
2921
|
+
var coord = this .geocentric .slerp (this .keyValue0, this .keyValue1, weight);
|
|
2922
|
+
|
|
2923
|
+
this .geovalue_changed_ = this .getGeoCoord (coord, this .geovalue);
|
|
2924
|
+
this .value_changed_ = coord;
|
|
2925
|
+
}
|
|
2926
|
+
catch (error)
|
|
2927
|
+
{ }
|
|
2928
|
+
},
|
|
2929
|
+
});
|
|
2930
|
+
|
|
2931
|
+
return GeoPositionInterpolator;
|
|
2932
|
+
});
|
|
2933
|
+
|
|
2934
|
+
|
|
2935
|
+
|
|
2936
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
2937
|
+
*******************************************************************************
|
|
2938
|
+
*
|
|
2939
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2940
|
+
*
|
|
2941
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
2942
|
+
*
|
|
2943
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
2944
|
+
*
|
|
2945
|
+
* The copyright notice above does not evidence any actual of intended
|
|
2946
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
2947
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
2948
|
+
* create3000.
|
|
2949
|
+
*
|
|
2950
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
2951
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
2952
|
+
* permission of create3000.
|
|
2953
|
+
*
|
|
2954
|
+
* NON-MILITARY USE ONLY
|
|
2955
|
+
*
|
|
2956
|
+
* All create3000 software are effectively free software with a non-military use
|
|
2957
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
2958
|
+
* source in any way you please with the exception anything that uses it must be
|
|
2959
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
2960
|
+
*
|
|
2961
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
2962
|
+
*
|
|
2963
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
2964
|
+
*
|
|
2965
|
+
* This file is part of the X_ITE Project.
|
|
2966
|
+
*
|
|
2967
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
2968
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
2969
|
+
* Free Software Foundation.
|
|
2970
|
+
*
|
|
2971
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
2972
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
2973
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
2974
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
2975
|
+
*
|
|
2976
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
2977
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
2978
|
+
* copy of the GPLv3 License.
|
|
2979
|
+
*
|
|
2980
|
+
* For Silvio, Joy and Adi.
|
|
2981
|
+
*
|
|
2982
|
+
******************************************************************************/
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
define ('x_ite/Components/Geospatial/GeoProximitySensor',[
|
|
2986
|
+
"x_ite/Fields",
|
|
2987
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
2988
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
2989
|
+
"x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode",
|
|
2990
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
2991
|
+
"x_ite/Components/EnvironmentalSensor/ProximitySensor",
|
|
2992
|
+
"x_ite/Bits/X3DConstants",
|
|
2993
|
+
"standard/Math/Numbers/Vector3",
|
|
2994
|
+
],
|
|
2995
|
+
function (Fields,
|
|
2996
|
+
X3DFieldDefinition,
|
|
2997
|
+
FieldDefinitionArray,
|
|
2998
|
+
X3DEnvironmentalSensorNode,
|
|
2999
|
+
X3DGeospatialObject,
|
|
3000
|
+
ProximitySensor,
|
|
3001
|
+
X3DConstants,
|
|
3002
|
+
Vector3)
|
|
3003
|
+
{
|
|
3004
|
+
"use strict";
|
|
3005
|
+
|
|
3006
|
+
var geoCoord = new Vector3 (0, 0, 0);
|
|
3007
|
+
|
|
3008
|
+
function GeoProximitySensor (executionContext)
|
|
3009
|
+
{
|
|
3010
|
+
X3DEnvironmentalSensorNode .call (this, executionContext);
|
|
3011
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
3012
|
+
|
|
3013
|
+
this .addType (X3DConstants .GeoProximitySensor);
|
|
3014
|
+
|
|
3015
|
+
this .position_changed_ .setUnit ("length");
|
|
3016
|
+
this .centerOfRotation_changed_ .setUnit ("length");
|
|
3017
|
+
|
|
3018
|
+
this .proximitySensor = new ProximitySensor (executionContext);
|
|
3019
|
+
|
|
3020
|
+
this .setCameraObject (this .proximitySensor .getCameraObject ());
|
|
3021
|
+
this .setPickableObject (this .proximitySensor .getPickableObject ());
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
GeoProximitySensor .prototype = Object .assign (Object .create (X3DEnvironmentalSensorNode .prototype),
|
|
3025
|
+
X3DGeospatialObject .prototype,
|
|
3026
|
+
{
|
|
3027
|
+
constructor: GeoProximitySensor,
|
|
3028
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
3029
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
3030
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
3031
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
3032
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
3033
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "size", new Fields .SFVec3f ()),
|
|
3034
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "center", new Fields .SFVec3f ()),
|
|
3035
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
3036
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "enterTime", new Fields .SFTime ()),
|
|
3037
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "exitTime", new Fields .SFTime ()),
|
|
3038
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "geoCoord_changed", new Fields .SFVec3d ()),
|
|
3039
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "position_changed", new Fields .SFVec3f ()),
|
|
3040
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "orientation_changed", new Fields .SFRotation ()),
|
|
3041
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "centerOfRotation_changed", new Fields .SFVec3f ()),
|
|
3042
|
+
]),
|
|
3043
|
+
getTypeName: function ()
|
|
3044
|
+
{
|
|
3045
|
+
return "GeoProximitySensor";
|
|
3046
|
+
},
|
|
3047
|
+
getComponentName: function ()
|
|
3048
|
+
{
|
|
3049
|
+
return "Geospatial";
|
|
3050
|
+
},
|
|
3051
|
+
getContainerField: function ()
|
|
3052
|
+
{
|
|
3053
|
+
return "children";
|
|
3054
|
+
},
|
|
3055
|
+
initialize: function ()
|
|
3056
|
+
{
|
|
3057
|
+
X3DEnvironmentalSensorNode .prototype .initialize .call (this);
|
|
3058
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
3059
|
+
|
|
3060
|
+
this .enabled_ .addFieldInterest (this .proximitySensor .enabled_);
|
|
3061
|
+
this .size_ .addFieldInterest (this .proximitySensor .size_);
|
|
3062
|
+
this .center_ .addFieldInterest (this .proximitySensor .center_);
|
|
3063
|
+
|
|
3064
|
+
this .proximitySensor .isCameraObject_ .addFieldInterest (this .isCameraObject_);
|
|
3065
|
+
this .proximitySensor .isPickableObject_ .addFieldInterest (this .isPickableObject_);
|
|
3066
|
+
|
|
3067
|
+
this .proximitySensor .isActive_ .addFieldInterest (this .isActive_);
|
|
3068
|
+
this .proximitySensor .enterTime_ .addFieldInterest (this .enterTime_);
|
|
3069
|
+
this .proximitySensor .exitTime_ .addFieldInterest (this .exitTime_);
|
|
3070
|
+
this .proximitySensor .position_changed_ .addFieldInterest (this .position_changed_);
|
|
3071
|
+
this .proximitySensor .orientation_changed_ .addFieldInterest (this .orientation_changed_);
|
|
3072
|
+
this .proximitySensor .centerOfRotation_changed_ .addFieldInterest (this .centerOfRotation_changed_);
|
|
3073
|
+
|
|
3074
|
+
this .proximitySensor .position_changed_ .addInterest ("set_position__", this);
|
|
3075
|
+
|
|
3076
|
+
this .proximitySensor .enabled_ = this .enabled_;
|
|
3077
|
+
this .proximitySensor .size_ = this .size_;
|
|
3078
|
+
this .proximitySensor .center_ = this .center_;
|
|
3079
|
+
|
|
3080
|
+
this .proximitySensor .setup ();
|
|
3081
|
+
},
|
|
3082
|
+
set_position__: function (position)
|
|
3083
|
+
{
|
|
3084
|
+
this .geoCoord_changed_ = this .getGeoCoord (this .proximitySensor .position_changed_ .getValue (), geoCoord);
|
|
3085
|
+
},
|
|
3086
|
+
traverse: function (type, renderObject)
|
|
3087
|
+
{
|
|
3088
|
+
this .proximitySensor .traverse (type, renderObject);
|
|
3089
|
+
},
|
|
3090
|
+
});
|
|
3091
|
+
|
|
3092
|
+
return GeoProximitySensor;
|
|
3093
|
+
});
|
|
3094
|
+
|
|
3095
|
+
|
|
3096
|
+
|
|
3097
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3098
|
+
*******************************************************************************
|
|
3099
|
+
*
|
|
3100
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3101
|
+
*
|
|
3102
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
3103
|
+
*
|
|
3104
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
3105
|
+
*
|
|
3106
|
+
* The copyright notice above does not evidence any actual of intended
|
|
3107
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
3108
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
3109
|
+
* create3000.
|
|
3110
|
+
*
|
|
3111
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
3112
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
3113
|
+
* permission of create3000.
|
|
3114
|
+
*
|
|
3115
|
+
* NON-MILITARY USE ONLY
|
|
3116
|
+
*
|
|
3117
|
+
* All create3000 software are effectively free software with a non-military use
|
|
3118
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
3119
|
+
* source in any way you please with the exception anything that uses it must be
|
|
3120
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
3121
|
+
*
|
|
3122
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3123
|
+
*
|
|
3124
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
3125
|
+
*
|
|
3126
|
+
* This file is part of the X_ITE Project.
|
|
3127
|
+
*
|
|
3128
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
3129
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
3130
|
+
* Free Software Foundation.
|
|
3131
|
+
*
|
|
3132
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
3133
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
3134
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
3135
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
3136
|
+
*
|
|
3137
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
3138
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
3139
|
+
* copy of the GPLv3 License.
|
|
3140
|
+
*
|
|
3141
|
+
* For Silvio, Joy and Adi.
|
|
3142
|
+
*
|
|
3143
|
+
******************************************************************************/
|
|
3144
|
+
|
|
3145
|
+
|
|
3146
|
+
define ('x_ite/Components/Geospatial/GeoTouchSensor',[
|
|
3147
|
+
"x_ite/Fields",
|
|
3148
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
3149
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
3150
|
+
"x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode",
|
|
3151
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
3152
|
+
"x_ite/Bits/X3DConstants",
|
|
3153
|
+
"standard/Math/Numbers/Vector3",
|
|
3154
|
+
"standard/Math/Numbers/Matrix4",
|
|
3155
|
+
],
|
|
3156
|
+
function (Fields,
|
|
3157
|
+
X3DFieldDefinition,
|
|
3158
|
+
FieldDefinitionArray,
|
|
3159
|
+
X3DTouchSensorNode,
|
|
3160
|
+
X3DGeospatialObject,
|
|
3161
|
+
X3DConstants,
|
|
3162
|
+
Vector3,
|
|
3163
|
+
Matrix4)
|
|
3164
|
+
{
|
|
3165
|
+
"use strict";
|
|
3166
|
+
|
|
3167
|
+
var
|
|
3168
|
+
invModelViewMatrix = new Matrix4 (),
|
|
3169
|
+
geoCoords = new Vector3 (0, 0, 0);
|
|
3170
|
+
|
|
3171
|
+
function GeoTouchSensor (executionContext)
|
|
3172
|
+
{
|
|
3173
|
+
X3DTouchSensorNode .call (this, executionContext);
|
|
3174
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
3175
|
+
|
|
3176
|
+
this .addType (X3DConstants .GeoTouchSensor);
|
|
3177
|
+
|
|
3178
|
+
this .hitPoint_changed_ .setUnit ("length");
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
GeoTouchSensor .prototype = Object .assign (Object .create (X3DTouchSensorNode .prototype),
|
|
3182
|
+
X3DGeospatialObject .prototype,
|
|
3183
|
+
{
|
|
3184
|
+
constructor: GeoTouchSensor,
|
|
3185
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
3186
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
3187
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
3188
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
3189
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
|
|
3190
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "description", new Fields .SFString ()),
|
|
3191
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "hitTexCoord_changed", new Fields .SFVec2f ()),
|
|
3192
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "hitNormal_changed", new Fields .SFVec3f ()),
|
|
3193
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "hitPoint_changed", new Fields .SFVec3f ()),
|
|
3194
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "hitGeoCoord_changed", new Fields .SFVec3d ()),
|
|
3195
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isOver", new Fields .SFBool ()),
|
|
3196
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
3197
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "touchTime", new Fields .SFTime ()),
|
|
3198
|
+
]),
|
|
3199
|
+
getTypeName: function ()
|
|
3200
|
+
{
|
|
3201
|
+
return "GeoTouchSensor";
|
|
3202
|
+
},
|
|
3203
|
+
getComponentName: function ()
|
|
3204
|
+
{
|
|
3205
|
+
return "Geospatial";
|
|
3206
|
+
},
|
|
3207
|
+
getContainerField: function ()
|
|
3208
|
+
{
|
|
3209
|
+
return "children";
|
|
3210
|
+
},
|
|
3211
|
+
initialize: function ()
|
|
3212
|
+
{
|
|
3213
|
+
X3DTouchSensorNode .prototype .initialize .call (this);
|
|
3214
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
3215
|
+
},
|
|
3216
|
+
set_over__: function (over, hit, modelViewMatrix, projectionMatrix, viewport)
|
|
3217
|
+
{
|
|
3218
|
+
try
|
|
3219
|
+
{
|
|
3220
|
+
X3DTouchSensorNode .prototype .set_over__ .call (this, over, hit, modelViewMatrix, projectionMatrix, viewport);
|
|
3221
|
+
|
|
3222
|
+
if (this .isOver_ .getValue ())
|
|
3223
|
+
{
|
|
3224
|
+
var intersection = hit .intersection;
|
|
3225
|
+
|
|
3226
|
+
invModelViewMatrix .assign (modelViewMatrix) .inverse ();
|
|
3227
|
+
|
|
3228
|
+
this .hitTexCoord_changed_ = intersection .texCoord;
|
|
3229
|
+
this .hitNormal_changed_ = modelViewMatrix .multMatrixDir (intersection .normal .copy ()) .normalize ();
|
|
3230
|
+
this .hitPoint_changed_ = invModelViewMatrix .multVecMatrix (intersection .point .copy ());
|
|
3231
|
+
this .hitGeoCoord_changed_ = this .getGeoCoord (this .hitPoint_changed_ .getValue (), geoCoords);
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
catch (error)
|
|
3235
|
+
{
|
|
3236
|
+
console .log (error);
|
|
3237
|
+
}
|
|
3238
|
+
},
|
|
3239
|
+
});
|
|
3240
|
+
|
|
3241
|
+
return GeoTouchSensor;
|
|
3242
|
+
});
|
|
3243
|
+
|
|
3244
|
+
|
|
3245
|
+
|
|
3246
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3247
|
+
*******************************************************************************
|
|
3248
|
+
*
|
|
3249
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3250
|
+
*
|
|
3251
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
3252
|
+
*
|
|
3253
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
3254
|
+
*
|
|
3255
|
+
* The copyright notice above does not evidence any actual of intended
|
|
3256
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
3257
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
3258
|
+
* create3000.
|
|
3259
|
+
*
|
|
3260
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
3261
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
3262
|
+
* permission of create3000.
|
|
3263
|
+
*
|
|
3264
|
+
* NON-MILITARY USE ONLY
|
|
3265
|
+
*
|
|
3266
|
+
* All create3000 software are effectively free software with a non-military use
|
|
3267
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
3268
|
+
* source in any way you please with the exception anything that uses it must be
|
|
3269
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
3270
|
+
*
|
|
3271
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3272
|
+
*
|
|
3273
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
3274
|
+
*
|
|
3275
|
+
* This file is part of the X_ITE Project.
|
|
3276
|
+
*
|
|
3277
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
3278
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
3279
|
+
* Free Software Foundation.
|
|
3280
|
+
*
|
|
3281
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
3282
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
3283
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
3284
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
3285
|
+
*
|
|
3286
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
3287
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
3288
|
+
* copy of the GPLv3 License.
|
|
3289
|
+
*
|
|
3290
|
+
* For Silvio, Joy and Adi.
|
|
3291
|
+
*
|
|
3292
|
+
******************************************************************************/
|
|
3293
|
+
|
|
3294
|
+
|
|
3295
|
+
define ('x_ite/Components/Geospatial/GeoTransform',[
|
|
3296
|
+
"x_ite/Fields",
|
|
3297
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
3298
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
3299
|
+
"x_ite/Components/Grouping/X3DTransformMatrix3DNode",
|
|
3300
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
3301
|
+
"x_ite/Bits/X3DConstants",
|
|
3302
|
+
"standard/Math/Numbers/Matrix4",
|
|
3303
|
+
],
|
|
3304
|
+
function (Fields,
|
|
3305
|
+
X3DFieldDefinition,
|
|
3306
|
+
FieldDefinitionArray,
|
|
3307
|
+
X3DTransformMatrix3DNode,
|
|
3308
|
+
X3DGeospatialObject,
|
|
3309
|
+
X3DConstants,
|
|
3310
|
+
Matrix4)
|
|
3311
|
+
{
|
|
3312
|
+
"use strict";
|
|
3313
|
+
|
|
3314
|
+
var
|
|
3315
|
+
matrix = new Matrix4 (),
|
|
3316
|
+
locationMatrix = new Matrix4 ();
|
|
3317
|
+
|
|
3318
|
+
function GeoTransform (executionContext)
|
|
3319
|
+
{
|
|
3320
|
+
X3DTransformMatrix3DNode .call (this, executionContext);
|
|
3321
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
3322
|
+
|
|
3323
|
+
this .addType (X3DConstants .GeoTransform);
|
|
3324
|
+
|
|
3325
|
+
this .translation_ .setUnit ("length");
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
GeoTransform .prototype = Object .assign (Object .create (X3DTransformMatrix3DNode .prototype),
|
|
3329
|
+
X3DGeospatialObject .prototype,
|
|
3330
|
+
{
|
|
3331
|
+
constructor: GeoTransform,
|
|
3332
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
3333
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
3334
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "translation", new Fields .SFVec3f ()),
|
|
3335
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "rotation", new Fields .SFRotation ()),
|
|
3336
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "scale", new Fields .SFVec3f (1, 1, 1)),
|
|
3337
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "scaleOrientation", new Fields .SFRotation ()),
|
|
3338
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
3339
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
3340
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "geoCenter", new Fields .SFVec3d ()),
|
|
3341
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
3342
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
3343
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
3344
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
3345
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
|
|
3346
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
|
|
3347
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
|
|
3348
|
+
]),
|
|
3349
|
+
getTypeName: function ()
|
|
3350
|
+
{
|
|
3351
|
+
return "GeoTransform";
|
|
3352
|
+
},
|
|
3353
|
+
getComponentName: function ()
|
|
3354
|
+
{
|
|
3355
|
+
return "Geospatial";
|
|
3356
|
+
},
|
|
3357
|
+
getContainerField: function ()
|
|
3358
|
+
{
|
|
3359
|
+
return "children";
|
|
3360
|
+
},
|
|
3361
|
+
initialize: function ()
|
|
3362
|
+
{
|
|
3363
|
+
X3DTransformMatrix3DNode .prototype .initialize .call (this);
|
|
3364
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
3365
|
+
|
|
3366
|
+
this .addInterest ("eventsProcessed", this);
|
|
3367
|
+
|
|
3368
|
+
this .eventsProcessed ();
|
|
3369
|
+
},
|
|
3370
|
+
eventsProcessed: function ()
|
|
3371
|
+
{
|
|
3372
|
+
try
|
|
3373
|
+
{
|
|
3374
|
+
this .setHidden (this .scale_ .x === 0 ||
|
|
3375
|
+
this .scale_ .y === 0 ||
|
|
3376
|
+
this .scale_ .z === 0);
|
|
3377
|
+
|
|
3378
|
+
this .getLocationMatrix (this .geoCenter_ .getValue (), locationMatrix);
|
|
3379
|
+
|
|
3380
|
+
matrix .set (this .translation_ .getValue (),
|
|
3381
|
+
this .rotation_ .getValue (),
|
|
3382
|
+
this .scale_ .getValue (),
|
|
3383
|
+
this .scaleOrientation_ .getValue ());
|
|
3384
|
+
|
|
3385
|
+
this .setMatrix (matrix .multRight (locationMatrix) .multLeft (locationMatrix .inverse ()));
|
|
3386
|
+
}
|
|
3387
|
+
catch (error)
|
|
3388
|
+
{
|
|
3389
|
+
// Should normally not happen.
|
|
3390
|
+
this .setHidden (true);
|
|
3391
|
+
}
|
|
3392
|
+
},
|
|
3393
|
+
});
|
|
3394
|
+
|
|
3395
|
+
return GeoTransform;
|
|
3396
|
+
});
|
|
3397
|
+
|
|
3398
|
+
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3399
|
+
*******************************************************************************
|
|
3400
|
+
*
|
|
3401
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3402
|
+
*
|
|
3403
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
3404
|
+
*
|
|
3405
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
3406
|
+
*
|
|
3407
|
+
* The copyright notice above does not evidence any actual of intended
|
|
3408
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
3409
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
3410
|
+
* create3000.
|
|
3411
|
+
*
|
|
3412
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
3413
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
3414
|
+
* permission of create3000.
|
|
3415
|
+
*
|
|
3416
|
+
* NON-MILITARY USE ONLY
|
|
3417
|
+
*
|
|
3418
|
+
* All create3000 software are effectively free software with a non-military use
|
|
3419
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
3420
|
+
* source in any way you please with the exception anything that uses it must be
|
|
3421
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
3422
|
+
*
|
|
3423
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3424
|
+
*
|
|
3425
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
3426
|
+
*
|
|
3427
|
+
* This file is part of the X_ITE Project.
|
|
3428
|
+
*
|
|
3429
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
3430
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
3431
|
+
* Free Software Foundation.
|
|
3432
|
+
*
|
|
3433
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
3434
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
3435
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
3436
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
3437
|
+
*
|
|
3438
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
3439
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
3440
|
+
* copy of the GPLv3 License.
|
|
3441
|
+
*
|
|
3442
|
+
* For Silvio, Joy and Adi.
|
|
3443
|
+
*
|
|
3444
|
+
******************************************************************************/
|
|
3445
|
+
|
|
3446
|
+
|
|
3447
|
+
define ('x_ite/Components/Geospatial/GeoViewpoint',[
|
|
3448
|
+
"x_ite/Fields",
|
|
3449
|
+
"x_ite/Basic/X3DFieldDefinition",
|
|
3450
|
+
"x_ite/Basic/FieldDefinitionArray",
|
|
3451
|
+
"x_ite/Components/Navigation/X3DViewpointNode",
|
|
3452
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
3453
|
+
"x_ite/Components/Interpolation/ScalarInterpolator",
|
|
3454
|
+
"x_ite/Components/Navigation/NavigationInfo",
|
|
3455
|
+
"x_ite/Bits/X3DConstants",
|
|
3456
|
+
"standard/Math/Geometry/Camera",
|
|
3457
|
+
"standard/Math/Numbers/Vector2",
|
|
3458
|
+
"standard/Math/Numbers/Vector3",
|
|
3459
|
+
"standard/Math/Numbers/Rotation4",
|
|
3460
|
+
"standard/Math/Numbers/Matrix4",
|
|
3461
|
+
"standard/Math/Algorithm",
|
|
3462
|
+
],
|
|
3463
|
+
function (Fields,
|
|
3464
|
+
X3DFieldDefinition,
|
|
3465
|
+
FieldDefinitionArray,
|
|
3466
|
+
X3DViewpointNode,
|
|
3467
|
+
X3DGeospatialObject,
|
|
3468
|
+
ScalarInterpolator,
|
|
3469
|
+
NavigationInfo,
|
|
3470
|
+
X3DConstants,
|
|
3471
|
+
Camera,
|
|
3472
|
+
Vector2,
|
|
3473
|
+
Vector3,
|
|
3474
|
+
Rotation4,
|
|
3475
|
+
Matrix4,
|
|
3476
|
+
Algorithm)
|
|
3477
|
+
{
|
|
3478
|
+
"use strict";
|
|
3479
|
+
|
|
3480
|
+
function traverse (type, renderObject)
|
|
3481
|
+
{
|
|
3482
|
+
X3DViewpointNode .prototype .traverse .call (this, type, renderObject);
|
|
3483
|
+
|
|
3484
|
+
this .navigationInfoNode .traverse (type, renderObject);
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
function GeoViewpoint (executionContext)
|
|
3488
|
+
{
|
|
3489
|
+
X3DViewpointNode .call (this, executionContext);
|
|
3490
|
+
X3DGeospatialObject .call (this, executionContext);
|
|
3491
|
+
|
|
3492
|
+
this .addType (X3DConstants .GeoViewpoint);
|
|
3493
|
+
|
|
3494
|
+
this .centerOfRotation_ .setUnit ("length");
|
|
3495
|
+
this .fieldOfView_ .setUnit ("angle");
|
|
3496
|
+
|
|
3497
|
+
this .navigationInfoNode = new NavigationInfo (executionContext);
|
|
3498
|
+
this .fieldOfViewInterpolator = new ScalarInterpolator (this .getBrowser () .getPrivateScene ());
|
|
3499
|
+
this .projectionMatrix = new Matrix4 ();
|
|
3500
|
+
this .elevation = 0;
|
|
3501
|
+
|
|
3502
|
+
switch (executionContext .specificationVersion)
|
|
3503
|
+
{
|
|
3504
|
+
case "2.0":
|
|
3505
|
+
case "3.0":
|
|
3506
|
+
case "3.1":
|
|
3507
|
+
case "3.2":
|
|
3508
|
+
this .traverse = traverse;
|
|
3509
|
+
break;
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
GeoViewpoint .prototype = Object .assign (Object .create (X3DViewpointNode .prototype),
|
|
3514
|
+
X3DGeospatialObject .prototype,
|
|
3515
|
+
{
|
|
3516
|
+
constructor: GeoViewpoint,
|
|
3517
|
+
fieldDefinitions: new FieldDefinitionArray ([
|
|
3518
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
|
|
3519
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoOrigin", new Fields .SFNode ()),
|
|
3520
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "geoSystem", new Fields .MFString ("GD", "WE")),
|
|
3521
|
+
new X3DFieldDefinition (X3DConstants .inputOnly, "set_bind", new Fields .SFBool ()),
|
|
3522
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "description", new Fields .SFString ()),
|
|
3523
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "position", new Fields .SFVec3d (0, 0, 100000)),
|
|
3524
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "orientation", new Fields .SFRotation ()),
|
|
3525
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "centerOfRotation", new Fields .SFVec3d ()),
|
|
3526
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "fieldOfView", new Fields .SFFloat (0.7854)),
|
|
3527
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "jump", new Fields .SFBool (true)),
|
|
3528
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "retainUserOffsets", new Fields .SFBool ()),
|
|
3529
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "navType", new Fields .MFString ("EXAMINE", "ANY")),
|
|
3530
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "headlight", new Fields .SFBool (true)),
|
|
3531
|
+
new X3DFieldDefinition (X3DConstants .initializeOnly, "speedFactor", new Fields .SFFloat (1)),
|
|
3532
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "isBound", new Fields .SFBool ()),
|
|
3533
|
+
new X3DFieldDefinition (X3DConstants .outputOnly, "bindTime", new Fields .SFTime ()),
|
|
3534
|
+
]),
|
|
3535
|
+
getTypeName: function ()
|
|
3536
|
+
{
|
|
3537
|
+
return "GeoViewpoint";
|
|
3538
|
+
},
|
|
3539
|
+
getComponentName: function ()
|
|
3540
|
+
{
|
|
3541
|
+
return "Geospatial";
|
|
3542
|
+
},
|
|
3543
|
+
getContainerField: function ()
|
|
3544
|
+
{
|
|
3545
|
+
return "children";
|
|
3546
|
+
},
|
|
3547
|
+
initialize: function ()
|
|
3548
|
+
{
|
|
3549
|
+
X3DViewpointNode .prototype .initialize .call (this);
|
|
3550
|
+
X3DGeospatialObject .prototype .initialize .call (this);
|
|
3551
|
+
|
|
3552
|
+
this .position_ .addInterest ("set_position__", this);
|
|
3553
|
+
this .positionOffset_ .addInterest ("set_position__", this);
|
|
3554
|
+
this .navType_ .addFieldInterest (this .navigationInfoNode .type_);
|
|
3555
|
+
this .headlight_ .addFieldInterest (this .navigationInfoNode .headlight_);
|
|
3556
|
+
|
|
3557
|
+
this .navigationInfoNode .setup ();
|
|
3558
|
+
|
|
3559
|
+
this .set_position__ ();
|
|
3560
|
+
|
|
3561
|
+
// Setup interpolators
|
|
3562
|
+
|
|
3563
|
+
this .fieldOfViewInterpolator .key_ = [ 0, 1 ];
|
|
3564
|
+
this .fieldOfViewInterpolator .setup ();
|
|
3565
|
+
|
|
3566
|
+
this .getEaseInEaseOut () .modifiedFraction_changed_ .addFieldInterest (this .fieldOfViewInterpolator .set_fraction_);
|
|
3567
|
+
this .fieldOfViewInterpolator .value_changed_ .addFieldInterest (this .fieldOfViewScale_);
|
|
3568
|
+
},
|
|
3569
|
+
setInterpolators: function (fromViewpointNode, toViewpointNode)
|
|
3570
|
+
{
|
|
3571
|
+
if (fromViewpointNode .getType () .indexOf (X3DConstants .Viewpoint) >= 0)
|
|
3572
|
+
{
|
|
3573
|
+
const scale = fromViewpointNode .getFieldOfView () / toViewpointNode .getFieldOfView ();
|
|
3574
|
+
|
|
3575
|
+
this .fieldOfViewInterpolator .keyValue_ = new Fields .MFFloat (scale, toViewpointNode .fieldOfViewScale_ .getValue ());
|
|
3576
|
+
|
|
3577
|
+
this .fieldOfViewScale_ = scale;
|
|
3578
|
+
}
|
|
3579
|
+
else
|
|
3580
|
+
{
|
|
3581
|
+
this .fieldOfViewInterpolator .keyValue_ = new Fields .MFFloat (toViewpointNode .fieldOfViewScale_ .getValue (), toViewpointNode .fieldOfViewScale_ .getValue ());
|
|
3582
|
+
|
|
3583
|
+
this .fieldOfViewScale_ = toViewpointNode .fieldOfViewScale_ .getValue ();
|
|
3584
|
+
}
|
|
3585
|
+
},
|
|
3586
|
+
setPosition: (function ()
|
|
3587
|
+
{
|
|
3588
|
+
var geoPosition = new Vector3 (0, 0, 0);
|
|
3589
|
+
|
|
3590
|
+
return function (value)
|
|
3591
|
+
{
|
|
3592
|
+
this .position_ .setValue (this .getGeoCoord (value, geoPosition));
|
|
3593
|
+
};
|
|
3594
|
+
})(),
|
|
3595
|
+
getPosition: (function ()
|
|
3596
|
+
{
|
|
3597
|
+
var position = new Vector3 (0, 0, 0);
|
|
3598
|
+
|
|
3599
|
+
return function ()
|
|
3600
|
+
{
|
|
3601
|
+
return this .getCoord (this .position_ .getValue (), position);
|
|
3602
|
+
};
|
|
3603
|
+
})(),
|
|
3604
|
+
set_position__: (function ()
|
|
3605
|
+
{
|
|
3606
|
+
var position = new Vector3 (0, 0, 0);
|
|
3607
|
+
|
|
3608
|
+
return function ()
|
|
3609
|
+
{
|
|
3610
|
+
this .getCoord (this .position_ .getValue (), position);
|
|
3611
|
+
|
|
3612
|
+
this .elevation = this .getGeoElevation (position .add (this .positionOffset_ .getValue ()));
|
|
3613
|
+
};
|
|
3614
|
+
})(),
|
|
3615
|
+
setOrientation: (function ()
|
|
3616
|
+
{
|
|
3617
|
+
var
|
|
3618
|
+
locationMatrix = new Matrix4 (),
|
|
3619
|
+
geoOrientation = new Rotation4 (0, 0, 1, 0);
|
|
3620
|
+
|
|
3621
|
+
return function (value)
|
|
3622
|
+
{
|
|
3623
|
+
/// Returns the resulting orientation for this viewpoint.
|
|
3624
|
+
|
|
3625
|
+
var rotationMatrix = this .getLocationMatrix (this .position_ .getValue (), locationMatrix) .submatrix;
|
|
3626
|
+
|
|
3627
|
+
geoOrientation .setMatrix (rotationMatrix);
|
|
3628
|
+
|
|
3629
|
+
this .orientation_ .setValue (geoOrientation .inverse () .multLeft (value));
|
|
3630
|
+
};
|
|
3631
|
+
})(),
|
|
3632
|
+
getOrientation: (function ()
|
|
3633
|
+
{
|
|
3634
|
+
var
|
|
3635
|
+
locationMatrix = new Matrix4 (),
|
|
3636
|
+
orientation = new Rotation4 (0, 0, 1, 0);
|
|
3637
|
+
|
|
3638
|
+
return function ()
|
|
3639
|
+
{
|
|
3640
|
+
/// Returns the resulting orientation for this viewpoint.
|
|
3641
|
+
|
|
3642
|
+
var rotationMatrix = this .getLocationMatrix (this .position_ .getValue (), locationMatrix) .submatrix;
|
|
3643
|
+
|
|
3644
|
+
orientation .setMatrix (rotationMatrix);
|
|
3645
|
+
|
|
3646
|
+
return orientation .multLeft (this .orientation_ .getValue ());
|
|
3647
|
+
};
|
|
3648
|
+
})(),
|
|
3649
|
+
getCenterOfRotation: (function ()
|
|
3650
|
+
{
|
|
3651
|
+
var centerOfRotation = new Vector3 (0, 0, 0);
|
|
3652
|
+
|
|
3653
|
+
return function ()
|
|
3654
|
+
{
|
|
3655
|
+
return this .getCoord (this .centerOfRotation_ .getValue (), centerOfRotation);
|
|
3656
|
+
};
|
|
3657
|
+
})(),
|
|
3658
|
+
getFieldOfView: function ()
|
|
3659
|
+
{
|
|
3660
|
+
var fov = this .fieldOfView_ * this .fieldOfViewScale_;
|
|
3661
|
+
|
|
3662
|
+
return fov > 0 && fov < Math .PI ? fov : Math .PI / 4;
|
|
3663
|
+
},
|
|
3664
|
+
getMaxFarValue: function ()
|
|
3665
|
+
{
|
|
3666
|
+
return this .getBrowser () .getRenderingProperty ("LogarithmicDepthBuffer") ? 1e10 : 1e9;
|
|
3667
|
+
},
|
|
3668
|
+
getUpVector: (function ()
|
|
3669
|
+
{
|
|
3670
|
+
var
|
|
3671
|
+
position = new Vector3 (0, 0, 0),
|
|
3672
|
+
upVector = new Vector3 (0, 0, 0);
|
|
3673
|
+
|
|
3674
|
+
return function ()
|
|
3675
|
+
{
|
|
3676
|
+
this .getCoord (this .position_ .getValue (), position);
|
|
3677
|
+
|
|
3678
|
+
return this .getGeoUpVector .call (this, position .add (this .positionOffset_ .getValue ()), upVector);
|
|
3679
|
+
};
|
|
3680
|
+
})(),
|
|
3681
|
+
getSpeedFactor: function ()
|
|
3682
|
+
{
|
|
3683
|
+
return (Math .max (this .elevation, 0.0) + 10) / 10 * this .speedFactor_ .getValue ();
|
|
3684
|
+
},
|
|
3685
|
+
getScreenScale: (function ()
|
|
3686
|
+
{
|
|
3687
|
+
var screenScale = new Vector3 (0, 0, 0);
|
|
3688
|
+
|
|
3689
|
+
return function (point, viewport)
|
|
3690
|
+
{
|
|
3691
|
+
// Returns the screen scale in meter/pixel for on pixel.
|
|
3692
|
+
|
|
3693
|
+
var
|
|
3694
|
+
width = viewport [2],
|
|
3695
|
+
height = viewport [3],
|
|
3696
|
+
size = Math .abs (point .z) * Math .tan (this .getFieldOfView () / 2) * 2;
|
|
3697
|
+
|
|
3698
|
+
if (width > height)
|
|
3699
|
+
size /= height;
|
|
3700
|
+
else
|
|
3701
|
+
size /= width;
|
|
3702
|
+
|
|
3703
|
+
return screenScale .set (size, size, size);
|
|
3704
|
+
};
|
|
3705
|
+
})(),
|
|
3706
|
+
getViewportSize: (function ()
|
|
3707
|
+
{
|
|
3708
|
+
var viewportSize = new Vector2 (0, 0);
|
|
3709
|
+
|
|
3710
|
+
return function (viewport, nearValue)
|
|
3711
|
+
{
|
|
3712
|
+
var
|
|
3713
|
+
width = viewport [2],
|
|
3714
|
+
height = viewport [3],
|
|
3715
|
+
size = nearValue * Math .tan (this .getFieldOfView () / 2) * 2,
|
|
3716
|
+
aspect = width / height;
|
|
3717
|
+
|
|
3718
|
+
if (aspect > 1)
|
|
3719
|
+
return viewportSize .set (size * aspect, size);
|
|
3720
|
+
|
|
3721
|
+
return viewportSize .set (size, size / aspect);
|
|
3722
|
+
};
|
|
3723
|
+
})(),
|
|
3724
|
+
getLookAtDistance: function (bbox)
|
|
3725
|
+
{
|
|
3726
|
+
return (bbox .size .abs () / 2) / Math .tan (this .getFieldOfView () / 2);
|
|
3727
|
+
},
|
|
3728
|
+
getProjectionMatrixWithLimits: function (nearValue, farValue, viewport, limit)
|
|
3729
|
+
{
|
|
3730
|
+
if (limit || this .getBrowser () .getRenderingProperty ("LogarithmicDepthBuffer"))
|
|
3731
|
+
return Camera .perspective (this .getFieldOfView (), nearValue, farValue, viewport [2], viewport [3], this .projectionMatrix);
|
|
3732
|
+
|
|
3733
|
+
// Linear interpolate nearValue and farValue
|
|
3734
|
+
|
|
3735
|
+
var
|
|
3736
|
+
geoZNear = Math .max (Algorithm .lerp (Math .min (nearValue, 1e4), 1e4, this .elevation / 1e7), 1),
|
|
3737
|
+
geoZFar = Math .max (Algorithm .lerp (1e6, Math .max (farValue, 1e6), this .elevation / 1e7), 1e6);
|
|
3738
|
+
|
|
3739
|
+
return Camera .perspective (this .getFieldOfView (), geoZNear, geoZFar, viewport [2], viewport [3], this .projectionMatrix);
|
|
3740
|
+
},
|
|
3741
|
+
});
|
|
3742
|
+
|
|
3743
|
+
return GeoViewpoint;
|
|
3744
|
+
});
|
|
3745
|
+
|
|
3746
|
+
/*******************************************************************************
|
|
3747
|
+
*
|
|
3748
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3749
|
+
*
|
|
3750
|
+
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
|
|
3751
|
+
*
|
|
3752
|
+
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
3753
|
+
*
|
|
3754
|
+
* The copyright notice above does not evidence any actual of intended
|
|
3755
|
+
* publication of such source code, and is an unpublished work by create3000.
|
|
3756
|
+
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
3757
|
+
* create3000.
|
|
3758
|
+
*
|
|
3759
|
+
* No permission is granted to copy, distribute, or create derivative works from
|
|
3760
|
+
* the contents of this software, in whole or in part, without the prior written
|
|
3761
|
+
* permission of create3000.
|
|
3762
|
+
*
|
|
3763
|
+
* NON-MILITARY USE ONLY
|
|
3764
|
+
*
|
|
3765
|
+
* All create3000 software are effectively free software with a non-military use
|
|
3766
|
+
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
3767
|
+
* source in any way you please with the exception anything that uses it must be
|
|
3768
|
+
* marked to indicate is contains 'non-military use only' components.
|
|
3769
|
+
*
|
|
3770
|
+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3771
|
+
*
|
|
3772
|
+
* Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
|
|
3773
|
+
*
|
|
3774
|
+
* This file is part of the X_ITE Project.
|
|
3775
|
+
*
|
|
3776
|
+
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
3777
|
+
* terms of the GNU General Public License version 3 only, as published by the
|
|
3778
|
+
* Free Software Foundation.
|
|
3779
|
+
*
|
|
3780
|
+
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
3781
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
3782
|
+
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
3783
|
+
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
3784
|
+
*
|
|
3785
|
+
* You should have received a copy of the GNU General Public License version 3
|
|
3786
|
+
* along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
|
|
3787
|
+
* copy of the GPLv3 License.
|
|
3788
|
+
*
|
|
3789
|
+
* For Silvio, Joy and Adi.
|
|
3790
|
+
*
|
|
3791
|
+
******************************************************************************/
|
|
3792
|
+
|
|
3793
|
+
|
|
3794
|
+
define ([
|
|
3795
|
+
"x_ite/Components",
|
|
3796
|
+
"x_ite/Components/Geospatial/GeoCoordinate",
|
|
3797
|
+
"x_ite/Components/Geospatial/GeoElevationGrid",
|
|
3798
|
+
"x_ite/Components/Geospatial/GeoLOD",
|
|
3799
|
+
"x_ite/Components/Geospatial/GeoLocation",
|
|
3800
|
+
"x_ite/Components/Geospatial/GeoMetadata",
|
|
3801
|
+
"x_ite/Components/Geospatial/GeoOrigin",
|
|
3802
|
+
"x_ite/Components/Geospatial/GeoPositionInterpolator",
|
|
3803
|
+
"x_ite/Components/Geospatial/GeoProximitySensor",
|
|
3804
|
+
"x_ite/Components/Geospatial/GeoTouchSensor",
|
|
3805
|
+
"x_ite/Components/Geospatial/GeoTransform",
|
|
3806
|
+
"x_ite/Components/Geospatial/GeoViewpoint",
|
|
3807
|
+
"x_ite/Components/Geospatial/X3DGeospatialObject",
|
|
3808
|
+
],
|
|
3809
|
+
function (Components,
|
|
3810
|
+
GeoCoordinate,
|
|
3811
|
+
GeoElevationGrid,
|
|
3812
|
+
GeoLOD,
|
|
3813
|
+
GeoLocation,
|
|
3814
|
+
GeoMetadata,
|
|
3815
|
+
GeoOrigin,
|
|
3816
|
+
GeoPositionInterpolator,
|
|
3817
|
+
GeoProximitySensor,
|
|
3818
|
+
GeoTouchSensor,
|
|
3819
|
+
GeoTransform,
|
|
3820
|
+
GeoViewpoint,
|
|
3821
|
+
X3DGeospatialObject)
|
|
3822
|
+
{
|
|
3823
|
+
"use strict";
|
|
3824
|
+
|
|
3825
|
+
Components .addComponent ({
|
|
3826
|
+
name: "Geospatial",
|
|
3827
|
+
types:
|
|
3828
|
+
{
|
|
3829
|
+
GeoCoordinate: GeoCoordinate,
|
|
3830
|
+
GeoElevationGrid: GeoElevationGrid,
|
|
3831
|
+
GeoLOD: GeoLOD,
|
|
3832
|
+
GeoLocation: GeoLocation,
|
|
3833
|
+
GeoMetadata: GeoMetadata,
|
|
3834
|
+
GeoOrigin: GeoOrigin,
|
|
3835
|
+
GeoPositionInterpolator: GeoPositionInterpolator,
|
|
3836
|
+
GeoProximitySensor: GeoProximitySensor,
|
|
3837
|
+
GeoTouchSensor: GeoTouchSensor,
|
|
3838
|
+
GeoTransform: GeoTransform,
|
|
3839
|
+
GeoViewpoint: GeoViewpoint,
|
|
3840
|
+
},
|
|
3841
|
+
abstractTypes:
|
|
3842
|
+
{
|
|
3843
|
+
X3DGeospatialObject: X3DGeospatialObject,
|
|
3844
|
+
},
|
|
3845
|
+
});
|
|
3846
|
+
});
|
|
3847
|
+
|
|
3848
|
+
|
|
3849
|
+
|
|
3850
|
+
}());
|