x_ite 4.2.17 → 4.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +25 -0
- package/Makefile +27 -10
- package/README.md +13 -145
- package/build/bin/dist.pl +65 -8
- package/build/bin/version-number.pl +25 -0
- package/build/bin/version.pl +54 -14
- package/build/components/annotation.build.js +15 -0
- package/build/components/cad-geometry.build.js +15 -0
- package/build/components/cube-map-texturing.build.js +15 -0
- package/build/components/dis.build.js +15 -0
- package/build/components/event-utilities.build.js +15 -0
- package/build/components/geometry2d.build.js +15 -0
- package/build/components/geospatial.build.js +15 -0
- package/build/components/h-anim.build.js +15 -0
- package/build/components/key-device-sensor.build.js +15 -0
- package/build/components/layout.build.js +15 -0
- package/build/components/nurbs.build.js +15 -0
- package/build/components/particle-systems.build.js +15 -0
- package/build/components/picking.build.js +15 -0
- package/build/components/projective-texture-mapping.build.js +15 -0
- package/build/components/rigid-body-physics.build.js +15 -0
- package/build/components/scripting.build.js +15 -0
- package/build/components/texturing-3d.build.js +15 -0
- package/build/components/volume-rendering.build.js +15 -0
- package/build/components/x_ite.build.js +15 -0
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/x_ite.end.frag.js +25 -0
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +5 -2
- package/dist/{components/texturing-3d.js → assets/components/annotation.js} +341 -263
- package/dist/assets/components/annotation.min.js +1 -0
- package/dist/{components → assets/components}/cad-geometry.js +180 -76
- package/dist/assets/components/cad-geometry.min.js +1 -0
- package/dist/assets/components/cube-map-texturing.js +1222 -0
- package/dist/assets/components/cube-map-texturing.min.js +1 -0
- package/dist/assets/components/dis.js +918 -0
- package/dist/assets/components/dis.min.js +1 -0
- package/dist/assets/components/event-utilities.js +1124 -0
- package/dist/assets/components/event-utilities.min.js +1 -0
- package/dist/assets/components/geometry2d.js +2200 -0
- package/dist/assets/components/geometry2d.min.js +1 -0
- package/dist/{components → assets/components}/geospatial.js +364 -269
- package/dist/assets/components/geospatial.min.js +2 -0
- package/dist/{components → assets/components}/h-anim.js +224 -62
- package/dist/assets/components/h-anim.min.js +1 -0
- package/dist/assets/components/key-device-sensor.js +860 -0
- package/dist/assets/components/key-device-sensor.min.js +1 -0
- package/dist/assets/components/layout.js +2018 -0
- package/dist/assets/components/layout.min.js +1 -0
- package/dist/{components → assets/components}/nurbs.js +632 -348
- package/dist/assets/components/nurbs.min.js +2 -0
- package/dist/{components → assets/components}/particle-systems.js +514 -476
- package/dist/assets/components/particle-systems.min.js +2 -0
- package/dist/assets/components/picking.js +2491 -0
- package/dist/assets/components/picking.min.js +1 -0
- package/dist/assets/components/projective-texture-mapping.js +823 -0
- package/dist/assets/components/projective-texture-mapping.min.js +1 -0
- package/dist/assets/components/rigid-body-physics.js +4579 -0
- package/dist/assets/components/rigid-body-physics.min.js +59 -0
- package/dist/assets/components/scripting.js +816 -0
- package/dist/assets/components/scripting.min.js +1 -0
- package/dist/assets/components/texturing-3d.js +10064 -0
- package/dist/assets/components/texturing-3d.min.js +48 -0
- package/dist/assets/components/volume-rendering.js +3976 -0
- package/dist/assets/components/volume-rendering.min.js +3 -0
- package/dist/assets/components/x_ite.js +295 -0
- package/dist/assets/components/x_ite.min.js +1 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Bold.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-BoldItalic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Italic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Regular.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-RI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-RI.ttf +0 -0
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/hatching/1.png +0 -0
- package/dist/assets/hatching/10.png +0 -0
- package/dist/assets/hatching/11.png +0 -0
- package/dist/assets/hatching/12.png +0 -0
- package/dist/assets/hatching/13.png +0 -0
- package/dist/assets/hatching/14.png +0 -0
- package/dist/assets/hatching/15.png +0 -0
- package/dist/assets/hatching/16.png +0 -0
- package/dist/assets/hatching/17.png +0 -0
- package/dist/assets/hatching/18.png +0 -0
- package/dist/assets/hatching/19.png +0 -0
- package/dist/assets/hatching/2.png +0 -0
- package/dist/assets/hatching/3.png +0 -0
- package/dist/assets/hatching/4.png +0 -0
- package/dist/assets/hatching/5.png +0 -0
- package/dist/assets/hatching/6.png +0 -0
- package/dist/assets/hatching/7.png +0 -0
- package/dist/assets/hatching/8.png +0 -0
- package/dist/assets/hatching/9.png +0 -0
- package/dist/{images → assets/images}/ExamineViewer.png +0 -0
- package/dist/{images → assets/images}/FlyViewer.png +0 -0
- package/dist/{images → assets/images}/NoneViewer.png +0 -0
- package/dist/{images → assets/images}/PlaneViewer.png +0 -0
- package/dist/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/dist/{images → assets/images}/TextureQuality.png +0 -0
- package/dist/{images → assets/images}/Time.png +0 -0
- package/dist/{images → assets/images}/Viewpoint.png +0 -0
- package/dist/{images → assets/images}/WalkViewer.png +0 -0
- package/dist/assets/images/go-next.png +0 -0
- package/dist/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/dist/{images → assets/images}/help-about.png +0 -0
- package/dist/{images → assets/images}/icon.bw.png +0 -0
- package/dist/{images → assets/images}/icon.png +0 -0
- package/dist/assets/images/logo.128.png +0 -0
- package/dist/{images → assets/images}/logo.bw.png +0 -0
- package/dist/{images → assets/images}/logo.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Background.fs +23 -0
- package/dist/assets/shaders/webgl1/Background.vs +16 -0
- package/dist/assets/shaders/webgl1/Depth.fs +60 -0
- package/dist/assets/shaders/webgl1/Depth.vs +13 -0
- package/dist/assets/shaders/webgl1/Fallback.fs +28 -0
- package/dist/assets/shaders/webgl1/Fallback.vs +24 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +15 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.vs +18 -0
- package/dist/assets/shaders/webgl1/Gouraud.fs +529 -0
- package/dist/assets/shaders/webgl1/Gouraud.vs +107 -0
- package/dist/assets/shaders/webgl1/Phong.fs +837 -0
- package/dist/assets/shaders/webgl1/Phong.vs +52 -0
- package/dist/assets/shaders/webgl1/PointSet.fs +541 -0
- package/dist/assets/shaders/webgl1/PointSet.vs +48 -0
- package/dist/assets/shaders/webgl1/Unlit.fs +538 -0
- package/dist/assets/shaders/webgl1/Unlit.vs +52 -0
- package/dist/assets/shaders/webgl1/Wireframe.fs +93 -0
- package/dist/assets/shaders/webgl1/Wireframe.vs +47 -0
- package/dist/assets/shaders/webgl2/Background.fs +25 -0
- package/dist/assets/shaders/webgl2/Background.vs +17 -0
- package/dist/assets/shaders/webgl2/Depth.fs +62 -0
- package/dist/assets/shaders/webgl2/Depth.vs +14 -0
- package/dist/assets/shaders/webgl2/Gouraud.fs +684 -0
- package/dist/assets/shaders/webgl2/Gouraud.vs +108 -0
- package/dist/assets/shaders/webgl2/Phong.fs +1013 -0
- package/dist/assets/shaders/webgl2/Phong.vs +53 -0
- package/dist/assets/shaders/webgl2/PointSet.fs +696 -0
- package/dist/assets/shaders/webgl2/PointSet.vs +49 -0
- package/dist/assets/shaders/webgl2/Unlit.fs +693 -0
- package/dist/assets/shaders/webgl2/Unlit.vs +53 -0
- package/dist/assets/shaders/webgl2/Wireframe.fs +102 -0
- package/dist/assets/shaders/webgl2/Wireframe.vs +48 -0
- package/dist/example.html +8 -7
- package/dist/x_ite.css +167 -49
- package/dist/x_ite.js +66263 -60020
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +5 -0
- package/docs/Accessing-the-External-Browser.md +319 -0
- package/docs/Browser-Support.md +47 -0
- package/docs/Custom-Shaders.md +896 -0
- package/docs/Features.md +49 -0
- package/docs/Glossary.md +339 -0
- package/docs/How-To-Configure-Your-Web-Server.md +56 -0
- package/docs/Supported-Nodes.md +370 -0
- package/docs/What's-New.md +1295 -0
- package/docs/XHTML-DOM-Integration.md +82 -0
- package/docs/_config.yml +140 -0
- package/docs/_data/navigation.yml +137 -0
- package/docs/assets/css/main.scss +100 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/google3696ee938394d7b6.html +1 -0
- package/docs/index.md +1033 -0
- package/docs/reference/Browser-Services.md +361 -0
- package/docs/reference/Constants-Services.md +376 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +128 -0
- package/docs/reference/Field-Services-and-Objects.md +1006 -0
- package/docs/reference/Prototype-Services.md +121 -0
- package/docs/reference/Route-Services.md +49 -0
- package/docs/reference/Scene-Services.md +360 -0
- package/docs/reference/Script-Node-Authoring-Interface.md +342 -0
- package/docs/tutorials/Adding-backgrounds.md +268 -0
- package/docs/tutorials/Adding-fog.md +67 -0
- package/docs/tutorials/Adding-sound.md +326 -0
- package/docs/tutorials/Animating-transforms.md +385 -0
- package/docs/tutorials/Basic-Nodes.md +317 -0
- package/docs/tutorials/Building-a-X3D-world.md +152 -0
- package/docs/tutorials/Building-elevation-grids.md +170 -0
- package/docs/tutorials/Building-extruded-shapes.md +145 -0
- package/docs/tutorials/Building-primitive-shapes.md +204 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +311 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +186 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +208 -0
- package/docs/tutorials/Controlling-detail.md +130 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +277 -0
- package/docs/tutorials/Controlling-navigation.md +70 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +180 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +49 -0
- package/docs/tutorials/Creating-new-node-types.md +313 -0
- package/docs/tutorials/Grouping-nodes.md +237 -0
- package/docs/tutorials/Hello,-World!.md +204 -0
- package/docs/tutorials/Improving-Performance.md +227 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +110 -0
- package/docs/tutorials/Introducing-X3D.md +94 -0
- package/docs/tutorials/Introducing-animation.md +211 -0
- package/docs/tutorials/Introducing-script-use.md +127 -0
- package/docs/tutorials/Lighting-your-world.md +139 -0
- package/docs/tutorials/Mapping-textures.md +212 -0
- package/docs/tutorials/Naming-nodes.md +161 -0
- package/docs/tutorials/Providing-information-about-your-world.md +30 -0
- package/docs/tutorials/Sensing-the-viewer.md +205 -0
- package/docs/tutorials/Sensing-viewer-actions.md +214 -0
- package/docs/tutorials/Transforming-Shapes.md +270 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +631 -0
- package/docs/tutorials/index.md +78 -0
- package/meta/logo/logo.png +0 -0
- package/meta/logo/logo.svg +216 -217
- package/meta/web3d.html +3 -3
- package/package.json +43 -28
- package/src/assets/components/annotation.js +87 -0
- package/src/{components → assets/components}/cad-geometry.js +0 -0
- package/src/{x_ite/Components/CubeMapTexturing.js → assets/components/cube-map-texturing.js} +15 -21
- package/src/assets/components/dis.js +84 -0
- package/src/{x_ite/Components/EventUtilities.js → assets/components/event-utilities.js} +20 -26
- package/src/{x_ite/Components/Geometry2D.js → assets/components/geometry2d.js} +22 -25
- package/src/{components → assets/components}/geospatial.js +0 -0
- package/src/{components → assets/components}/h-anim.js +9 -7
- package/src/{x_ite/Components/KeyDeviceSensor.js → assets/components/key-device-sensor.js} +17 -20
- package/src/{x_ite/Components/Layout.js → assets/components/layout.js} +20 -23
- package/src/{components → assets/components}/nurbs.js +0 -0
- package/src/{components → assets/components}/particle-systems.js +1 -1
- package/src/assets/components/picking.js +87 -0
- package/src/assets/components/projective-texture-mapping.js +75 -0
- package/src/{components → assets/components}/rigid-body-physics.js +7 -2
- package/src/{x_ite/Components/Scripting.js → assets/components/scripting.js} +13 -19
- package/src/{components → assets/components}/texturing-3d.js +12 -13
- package/src/assets/components/volume-rendering.js +118 -0
- package/src/{x_ite/Components/X_ITE.js → assets/components/x_ite.js} +12 -30
- package/src/assets/fonts/DroidSerif-Bold.ttf +0 -0
- package/src/assets/fonts/DroidSerif-BoldItalic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Italic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Regular.ttf +0 -0
- package/src/assets/fonts/Ubuntu-B.ttf +0 -0
- package/src/assets/fonts/Ubuntu-BI.ttf +0 -0
- package/src/assets/fonts/Ubuntu-R.ttf +0 -0
- package/src/assets/fonts/Ubuntu-RI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-B.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-BI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-R.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-RI.ttf +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/hatching/1.png +0 -0
- package/src/assets/hatching/10.png +0 -0
- package/src/assets/hatching/11.png +0 -0
- package/src/assets/hatching/12.png +0 -0
- package/src/assets/hatching/13.png +0 -0
- package/src/assets/hatching/14.png +0 -0
- package/src/assets/hatching/15.png +0 -0
- package/src/assets/hatching/16.png +0 -0
- package/src/assets/hatching/17.png +0 -0
- package/src/assets/hatching/18.png +0 -0
- package/src/assets/hatching/19.png +0 -0
- package/src/assets/hatching/2.png +0 -0
- package/src/assets/hatching/3.png +0 -0
- package/src/assets/hatching/4.png +0 -0
- package/src/assets/hatching/5.png +0 -0
- package/src/assets/hatching/6.png +0 -0
- package/src/assets/hatching/7.png +0 -0
- package/src/assets/hatching/8.png +0 -0
- package/src/assets/hatching/9.png +0 -0
- package/src/{images → assets/images}/ExamineViewer.png +0 -0
- package/src/{images → assets/images}/FlyViewer.png +0 -0
- package/src/{images → assets/images}/NoneViewer.png +0 -0
- package/src/{images → assets/images}/PlaneViewer.png +0 -0
- package/src/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/src/{images → assets/images}/TextureQuality.png +0 -0
- package/src/{images → assets/images}/Time.png +0 -0
- package/src/{images → assets/images}/Viewpoint.png +0 -0
- package/src/{images → assets/images}/WalkViewer.png +0 -0
- package/src/assets/images/go-next.png +0 -0
- package/src/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/src/{images → assets/images}/help-about.png +0 -0
- package/src/{images → assets/images}/icon.bw.png +0 -0
- package/src/{images → assets/images}/icon.png +0 -0
- package/src/assets/images/logo.128.png +0 -0
- package/src/{images → assets/images}/logo.bw.png +0 -0
- package/src/{images → assets/images}/logo.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +102 -0
- package/src/assets/shaders/webgl1/Background.fs +16 -0
- package/src/assets/shaders/webgl1/Background.vs +22 -0
- package/src/assets/shaders/webgl1/Depth.fs +16 -0
- package/src/assets/shaders/webgl1/Depth.vs +20 -0
- package/src/assets/shaders/webgl1/Fallback.fs +38 -0
- package/src/assets/shaders/webgl1/Fallback.vs +30 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +21 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +24 -0
- package/src/assets/shaders/webgl1/Gouraud.fs +66 -0
- package/src/assets/shaders/webgl1/Gouraud.vs +147 -0
- package/src/assets/shaders/webgl1/Phong.fs +172 -0
- package/src/assets/shaders/webgl1/Phong.vs +67 -0
- package/src/assets/shaders/webgl1/PointSet.fs +100 -0
- package/src/assets/shaders/webgl1/PointSet.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +86 -0
- package/src/assets/shaders/webgl1/Unlit.vs +67 -0
- package/src/assets/shaders/webgl1/Wireframe.fs +74 -0
- package/src/assets/shaders/webgl1/Wireframe.vs +63 -0
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +38 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl +18 -0
- package/src/{x_ite/Browser/Shaders/Include/Pack.h → assets/shaders/webgl1/include/Pack.glsl} +0 -1
- package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
- package/src/{x_ite/Browser/Shaders/Include/Shadow.h → assets/shaders/webgl1/include/Shadow.glsl} +33 -33
- package/src/assets/shaders/webgl1/include/Texture.glsl +488 -0
- package/src/assets/shaders/webgl2/Background.fs +19 -0
- package/src/assets/shaders/webgl2/Background.vs +23 -0
- package/src/assets/shaders/webgl2/Depth.fs +19 -0
- package/src/assets/shaders/webgl2/Depth.vs +21 -0
- package/src/assets/shaders/webgl2/Gouraud.fs +64 -0
- package/src/assets/shaders/webgl2/Gouraud.vs +148 -0
- package/src/assets/shaders/webgl2/Phong.fs +170 -0
- package/src/assets/shaders/webgl2/Phong.vs +68 -0
- package/src/assets/shaders/webgl2/PointSet.fs +99 -0
- package/src/assets/shaders/webgl2/PointSet.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +85 -0
- package/src/assets/shaders/webgl2/Unlit.vs +68 -0
- package/src/assets/shaders/webgl2/Wireframe.fs +73 -0
- package/src/assets/shaders/webgl2/Wireframe.vs +64 -0
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Hatch.glsl +18 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +51 -0
- package/src/assets/shaders/webgl2/include/Perlin.glsl +40 -0
- package/src/assets/shaders/webgl2/include/Shadow.glsl +324 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +623 -0
- package/src/bookmarks.js +33 -12
- package/src/dummy.js +1 -0
- package/src/example.html +8 -7
- package/src/examples.js +21 -3
- package/src/lib/ammojs/AmmoJS.js +58 -0
- package/src/lib/ammojs/Makefile +4 -0
- package/src/lib/ammojs/ammo.idl +72 -1
- package/src/lib/ammojs/ammo.js +25 -21
- package/src/lib/jpeg/jpeg.js +1019 -0
- package/src/lib/nurbs/extras/sample.js +137 -80
- package/src/locale/de.po +18 -73
- package/src/locale/fr.po +18 -74
- package/src/spinner.css +18 -6
- package/src/standard/Geospatial/Geodetic.js +43 -43
- package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
- package/src/standard/Geospatial/UniversalTransverseMercator.js +42 -42
- package/src/standard/Math/Algorithm.js +22 -39
- package/src/standard/Math/Algorithms/Bezier.js +147 -0
- package/src/standard/Math/Algorithms/MergeSort.js +2 -2
- package/src/standard/Math/Algorithms/PartialSort.js +6 -6
- package/src/standard/Math/Algorithms/QuickSort.js +8 -6
- package/src/standard/Math/Algorithms/SAT.js +4 -8
- package/src/standard/Math/Algorithms/eigendecomposition.js +37 -33
- package/src/standard/Math/Geometry/Box2.js +84 -56
- package/src/standard/Math/Geometry/Box3.js +400 -358
- package/src/standard/Math/Geometry/Camera.js +19 -16
- package/src/standard/Math/Geometry/Cylinder3.js +13 -13
- package/src/standard/Math/Geometry/Line3.js +34 -34
- package/src/standard/Math/Geometry/Plane3.js +15 -15
- package/src/standard/Math/Geometry/Sphere3.js +122 -105
- package/src/standard/Math/Geometry/Spheroid3.js +1 -1
- package/src/standard/Math/Geometry/Triangle2.js +5 -5
- package/src/standard/Math/Geometry/Triangle3.js +12 -14
- package/src/standard/Math/Geometry/ViewVolume.js +303 -106
- package/src/standard/Math/Numbers/Color3.js +26 -23
- package/src/standard/Math/Numbers/Color4.js +9 -9
- package/src/standard/Math/Numbers/Complex.js +13 -17
- package/src/standard/Math/Numbers/Matrix2.js +20 -13
- package/src/standard/Math/Numbers/Matrix3.js +129 -205
- package/src/standard/Math/Numbers/Matrix4.js +136 -257
- package/src/standard/Math/Numbers/Quaternion.js +49 -138
- package/src/standard/Math/Numbers/Rotation4.js +42 -55
- package/src/standard/Math/Numbers/Vector2.js +32 -115
- package/src/standard/Math/Numbers/Vector3.js +46 -151
- package/src/standard/Math/Numbers/Vector4.js +44 -163
- package/src/standard/Math/Utility/BVH.js +21 -20
- package/src/standard/Math/Utility/MatrixStack.js +4 -4
- package/src/standard/Networking/BinaryTransport.js +8 -8
- package/src/standard/Time/MicroTime.js +81 -0
- package/src/standard/Utility/DataStorage.js +11 -14
- package/src/standard/Utility/MapUtilities.js +69 -0
- package/src/standard/Utility/ObjectCache.js +2 -3
- package/src/standard/Utility/Shuffle.js +5 -6
- package/src/tests.js +84 -5
- package/src/x_ite/Base/Events.js +9 -10
- package/src/x_ite/Base/X3DChildObject.js +20 -16
- package/src/x_ite/Base/X3DEventObject.js +3 -7
- package/src/x_ite/Base/X3DObject.js +44 -27
- package/src/x_ite/Basic/FieldDefinitionArray.js +11 -4
- package/src/x_ite/Basic/X3DBaseNode.js +427 -246
- package/src/x_ite/Basic/X3DField.js +48 -69
- package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
- package/src/x_ite/Basic/X3DObjectArrayField.js +102 -108
- package/src/x_ite/Basic/X3DTypedArrayField.js +194 -163
- package/src/x_ite/Bits/TraverseType.js +2 -5
- package/src/x_ite/Bits/X3DConstants.js +11 -2
- package/src/x_ite/Browser/Core/BrowserOptions.js +89 -68
- package/src/x_ite/Browser/Core/BrowserTimings.js +21 -29
- package/src/x_ite/Browser/Core/ContextMenu.js +139 -60
- package/src/x_ite/Browser/Core/Notification.js +3 -3
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
- package/src/x_ite/Browser/Core/Shading.js +3 -7
- package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
- package/src/x_ite/Browser/Core/X3DCoreContext.js +398 -58
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -28
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +5 -14
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +81 -28
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +53 -44
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +8 -9
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +98 -0
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +14 -206
- package/src/x_ite/Browser/Layout/ScreenText.js +226 -254
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +13 -11
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +15 -9
- package/src/x_ite/Browser/NURBS/NURBS.js +84 -72
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +125 -83
- package/src/x_ite/Browser/Navigation/FlyViewer.js +14 -9
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +60 -40
- package/src/x_ite/Browser/Navigation/NoneViewer.js +12 -1
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +39 -20
- package/src/x_ite/Browser/Navigation/WalkViewer.js +21 -6
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +110 -85
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +11 -6
- package/src/x_ite/Browser/Navigation/X3DViewer.js +73 -48
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -24
- package/src/x_ite/Browser/Networking/urls.js +31 -16
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +5 -6
- package/src/x_ite/Browser/Picking/IntersectionType.js +63 -0
- package/src/x_ite/Browser/Picking/MatchCriterion.js +64 -0
- package/src/x_ite/Browser/Picking/SortOrder.js +65 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +197 -0
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +130 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +26 -20
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -10
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +38 -27
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
- package/src/x_ite/Browser/Shaders/Shader.js +112 -92
- package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +92 -77
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +134 -74
- package/src/x_ite/Browser/Shape/AlphaMode.js +65 -0
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +108 -4
- package/src/x_ite/Browser/Text/PolygonText.js +153 -170
- package/src/x_ite/Browser/Text/TextAlignment.js +3 -7
- package/src/x_ite/Browser/Text/X3DTextContext.js +38 -30
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +49 -74
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +64 -0
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +81 -0
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +65 -0
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +73 -0
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +147 -45
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1126 -0
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +686 -0
- package/src/x_ite/Browser/Time/X3DTimeContext.js +20 -17
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +120 -0
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +28 -0
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +114 -0
- package/src/x_ite/Browser/X3DBrowser.js +282 -224
- package/src/x_ite/Browser/X3DBrowserContext.js +60 -27
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +108 -0
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +101 -0
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +112 -0
- package/src/x_ite/Components/Annotation/IconAnnotation.js +110 -0
- package/src/x_ite/Components/Annotation/TextAnnotation.js +102 -0
- package/src/x_ite/Components/Annotation/URLAnnotation.js +101 -0
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +76 -0
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +4 -4
- package/src/x_ite/Components/CADGeometry/CADFace.js +135 -30
- package/src/x_ite/Components/CADGeometry/CADLayer.js +3 -18
- package/src/x_ite/Components/CADGeometry/CADPart.js +4 -8
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +18 -10
- package/src/x_ite/Components/Core/WorldInfo.js +16 -6
- package/src/x_ite/Components/Core/X3DBindableNode.js +4 -33
- package/src/x_ite/Components/Core/X3DChildNode.js +14 -1
- package/src/x_ite/Components/Core/X3DNode.js +0 -63
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +128 -168
- package/src/x_ite/Components/Core.js +6 -9
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +38 -46
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +31 -30
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +42 -57
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +36 -48
- package/src/x_ite/Components/DIS/EspduTransform.js +12 -6
- package/src/x_ite/Components/DIS/ReceiverPdu.js +12 -6
- package/src/x_ite/Components/DIS/SignalPdu.js +12 -6
- package/src/x_ite/Components/DIS/TransmitterPdu.js +12 -6
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +5 -16
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +55 -3
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +3 -5
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +116 -116
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +5 -6
- package/src/x_ite/Components/EnvironmentalEffects.js +6 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +116 -117
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +169 -49
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +31 -27
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +12 -5
- package/src/x_ite/Components/EnvironmentalSensor.js +6 -9
- package/src/x_ite/Components/Followers/ColorChaser.js +1 -3
- package/src/x_ite/Components/Followers/ColorDamper.js +1 -3
- package/src/x_ite/Components/Followers/CoordinateChaser.js +1 -7
- package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -6
- package/src/x_ite/Components/Followers/OrientationChaser.js +7 -3
- package/src/x_ite/Components/Followers/OrientationDamper.js +7 -3
- package/src/x_ite/Components/Followers/PositionChaser.js +1 -3
- package/src/x_ite/Components/Followers/PositionChaser2D.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper2D.js +1 -3
- package/src/x_ite/Components/Followers/ScalarChaser.js +1 -3
- package/src/x_ite/Components/Followers/ScalarDamper.js +1 -3
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +1 -7
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +1 -7
- package/src/x_ite/Components/Followers/X3DChaserNode.js +20 -18
- package/src/x_ite/Components/Followers/X3DDamperNode.js +5 -7
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +5 -7
- package/src/x_ite/Components/Followers.js +6 -9
- package/src/x_ite/Components/Geometry2D/Arc2D.js +10 -14
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +87 -86
- package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -3
- package/src/x_ite/Components/Geometry2D/Disk2D.js +43 -58
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +4 -8
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +3 -5
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +20 -16
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -3
- package/src/x_ite/Components/Geometry3D/Cylinder.js +3 -5
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +35 -17
- package/src/x_ite/Components/Geometry3D/Extrusion.js +125 -107
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +164 -142
- package/src/x_ite/Components/Geometry3D/Sphere.js +3 -5
- package/src/x_ite/Components/Geometry3D.js +6 -9
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
- package/src/x_ite/Components/Geospatial/GeoLOD.js +207 -124
- package/src/x_ite/Components/Geospatial/GeoLocation.js +6 -6
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +5 -3
- package/src/x_ite/Components/Geospatial/GeoTransform.js +9 -9
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +27 -27
- package/src/x_ite/Components/Grouping/Group.js +3 -3
- package/src/x_ite/Components/Grouping/StaticGroup.js +49 -56
- package/src/x_ite/Components/Grouping/Switch.js +171 -21
- package/src/x_ite/Components/Grouping/Transform.js +3 -3
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +68 -15
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +339 -180
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +51 -25
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +2 -4
- package/src/x_ite/Components/Grouping.js +6 -9
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +4 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimHumanoid.js +24 -14
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +44 -20
- package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +6 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +4 -4
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +8 -7
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +4 -3
- package/src/x_ite/Components/Interpolation.js +6 -9
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +1 -3
- package/src/x_ite/Components/Layering/Layer.js +12 -2
- package/src/x_ite/Components/Layering/LayerSet.js +4 -6
- package/src/x_ite/Components/Layering/Viewport.js +8 -8
- package/src/x_ite/Components/Layering/X3DLayerNode.js +67 -62
- package/src/x_ite/Components/Layering.js +6 -9
- package/src/x_ite/Components/Layout/LayoutGroup.js +18 -15
- package/src/x_ite/Components/Layout/LayoutLayer.js +10 -5
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +12 -14
- package/src/x_ite/Components/Layout/ScreenGroup.js +25 -31
- package/src/x_ite/Components/Lighting/DirectionalLight.js +27 -22
- package/src/x_ite/Components/Lighting/PointLight.js +26 -29
- package/src/x_ite/Components/Lighting/SpotLight.js +29 -24
- package/src/x_ite/Components/Lighting/X3DLightNode.js +85 -66
- package/src/x_ite/Components/Lighting.js +6 -9
- package/src/x_ite/Components/NURBS/Contour2D.js +45 -1
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +53 -25
- package/src/x_ite/Components/NURBS/NurbsCurve.js +21 -24
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +44 -25
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +19 -21
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +18 -20
- package/src/x_ite/Components/NURBS/NurbsSet.js +17 -6
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +15 -16
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +38 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +116 -43
- package/src/x_ite/Components/Navigation/Billboard.js +12 -11
- package/src/x_ite/Components/Navigation/Collision.js +10 -8
- package/src/x_ite/Components/Navigation/LOD.js +207 -59
- package/src/x_ite/Components/Navigation/NavigationInfo.js +29 -43
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +99 -18
- package/src/x_ite/Components/Navigation/Viewpoint.js +15 -15
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +12 -5
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +137 -148
- package/src/x_ite/Components/Navigation.js +6 -9
- package/src/x_ite/Components/Networking/Anchor.js +22 -24
- package/src/x_ite/Components/Networking/Inline.js +63 -44
- package/src/x_ite/Components/Networking/X3DUrlObject.js +88 -8
- package/src/x_ite/Components/Networking.js +6 -9
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +2 -2
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +215 -199
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +44 -39
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +48 -46
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +121 -117
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +21 -18
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +20 -22
- package/src/x_ite/Components/Picking/LinePickSensor.js +251 -6
- package/src/x_ite/Components/Picking/PickableGroup.js +120 -7
- package/src/x_ite/Components/Picking/PointPickSensor.js +260 -8
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +174 -4
- package/src/x_ite/Components/Picking/VolumePickSensor.js +150 -4
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +377 -4
- package/src/x_ite/Components/Picking/X3DPickableObject.js +21 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +26 -11
- package/src/x_ite/Components/PointingDeviceSensor.js +6 -9
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +282 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +227 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +217 -0
- package/src/x_ite/Components/Rendering/ClipPlane.js +8 -10
- package/src/x_ite/Components/Rendering/Color.js +22 -13
- package/src/x_ite/Components/Rendering/ColorRGBA.js +28 -16
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +52 -33
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +17 -14
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +9 -4
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +17 -17
- package/src/x_ite/Components/Rendering/LineSet.js +44 -27
- package/src/x_ite/Components/Rendering/Normal.js +20 -4
- package/src/x_ite/Components/Rendering/PointSet.js +38 -16
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +7 -9
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +6 -8
- package/src/x_ite/Components/Rendering/X3DColorNode.js +16 -1
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +80 -55
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +11 -13
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +622 -477
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +159 -90
- package/src/x_ite/Components/Rendering.js +6 -9
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +142 -26
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +312 -128
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +91 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +189 -4
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +82 -4
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +49 -37
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +45 -39
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +41 -34
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +25 -20
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +15 -16
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +2 -4
- package/src/x_ite/Components/Scripting/Script.js +147 -101
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +2 -4
- package/src/x_ite/Components/Shaders/ComposedShader.js +17 -19
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +9 -3
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/PackagedShader.js +18 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +30 -18
- package/src/x_ite/Components/Shaders/ShaderProgram.js +15 -11
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +681 -558
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +48 -12
- package/src/x_ite/Components/Shaders.js +15 -18
- package/src/x_ite/Components/Shape/Appearance.js +153 -77
- package/src/x_ite/Components/Shape/FillProperties.js +63 -4
- package/src/x_ite/Components/Shape/LineProperties.js +27 -5
- package/src/x_ite/Components/Shape/Material.js +48 -62
- package/src/x_ite/Components/Shape/PointProperties.js +162 -0
- package/src/x_ite/Components/Shape/Shape.js +86 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +53 -59
- package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +9 -6
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +16 -3
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
- package/src/x_ite/Components/Shape/X3DShapeNode.js +41 -17
- package/src/x_ite/Components/Shape.js +22 -16
- package/src/x_ite/Components/Sound/AudioClip.js +36 -50
- package/src/x_ite/Components/Sound/Sound.js +36 -36
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +18 -6
- package/src/x_ite/Components/Sound.js +6 -9
- package/src/x_ite/Components/Text/FontStyle.js +10 -12
- package/src/x_ite/Components/Text/Text.js +6 -6
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +56 -87
- package/src/x_ite/Components/Text.js +6 -9
- package/src/x_ite/Components/Texturing/ImageTexture.js +48 -63
- package/src/x_ite/Components/Texturing/MovieTexture.js +42 -56
- package/src/x_ite/Components/Texturing/MultiTexture.js +236 -11
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +73 -6
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +45 -4
- package/src/x_ite/Components/Texturing/PixelTexture.js +45 -11
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +32 -17
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +68 -8
- package/src/x_ite/Components/Texturing/TextureProperties.js +96 -65
- package/src/x_ite/Components/Texturing/TextureTransform.js +55 -47
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +91 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +183 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +77 -0
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +42 -95
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +3 -17
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +6 -67
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +4 -11
- package/src/x_ite/Components/Texturing.js +31 -25
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +88 -4
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +105 -13
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +124 -4
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +41 -31
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +18 -11
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -6
- package/src/x_ite/Components/Time/TimeSensor.js +23 -19
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +11 -7
- package/src/x_ite/Components/Time.js +6 -9
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +309 -8
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +58 -4
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +217 -6
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +132 -3
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +86 -5
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +309 -11
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +85 -3
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +134 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +222 -9
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +191 -8
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +85 -6
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +95 -5
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +153 -8
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -3
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +62 -0
- package/src/x_ite/Components/X_ITE/BlendMode.js +51 -51
- package/src/x_ite/Components.js +11 -16
- package/src/x_ite/Configuration/ComponentInfo.js +12 -6
- package/src/x_ite/Configuration/ComponentInfoArray.js +4 -7
- package/src/x_ite/Configuration/ProfileInfo.js +10 -6
- package/src/x_ite/Configuration/SupportedComponents.js +66 -40
- package/src/x_ite/Configuration/SupportedNodes.js +22 -6
- package/src/x_ite/Configuration/SupportedProfiles.js +91 -89
- package/src/x_ite/Configuration/UnitInfo.js +12 -2
- package/src/x_ite/Configuration/X3DInfoArray.js +37 -18
- package/src/x_ite/Execution/BindableList.js +63 -38
- package/src/x_ite/Execution/BindableStack.js +63 -71
- package/src/x_ite/Execution/ExportedNode.js +25 -2
- package/src/x_ite/Execution/ImportedNode.js +122 -39
- package/src/x_ite/Execution/Scene.js +22 -14
- package/src/x_ite/Execution/World.js +22 -19
- package/src/x_ite/Execution/X3DExecutionContext.js +381 -221
- package/src/x_ite/Execution/X3DScene.js +213 -53
- package/src/x_ite/{Error.js → Fallback.js} +26 -29
- package/src/x_ite/Fields/ArrayFields.js +176 -57
- package/src/x_ite/Fields/SFBool.js +6 -5
- package/src/x_ite/Fields/SFColor.js +24 -21
- package/src/x_ite/Fields/SFColorRGBA.js +23 -23
- package/src/x_ite/Fields/SFDouble.js +6 -5
- package/src/x_ite/Fields/SFFloat.js +7 -6
- package/src/x_ite/Fields/SFImage.js +37 -36
- package/src/x_ite/Fields/SFInt32.js +5 -4
- package/src/x_ite/Fields/SFMatrix3.js +19 -15
- package/src/x_ite/Fields/SFMatrix4.js +19 -15
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +10 -2
- package/src/x_ite/Fields/SFNode.js +105 -53
- package/src/x_ite/Fields/SFNodeCache.js +93 -0
- package/src/x_ite/Fields/SFRotation.js +31 -27
- package/src/x_ite/Fields/SFString.js +9 -8
- package/src/x_ite/Fields/SFTime.js +6 -5
- package/src/x_ite/Fields/SFVec2.js +17 -13
- package/src/x_ite/Fields/SFVec3.js +21 -17
- package/src/x_ite/Fields/SFVec4.js +24 -20
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +8 -4
- package/src/x_ite/Fields.js +2 -6
- package/src/x_ite/InputOutput/FileLoader.js +174 -190
- package/src/x_ite/InputOutput/Generator.js +133 -104
- package/src/x_ite/Parser/HTMLSupport.js +3 -596
- package/src/x_ite/Parser/JSONParser.js +348 -245
- package/src/x_ite/Parser/Parser.js +314 -303
- package/src/x_ite/Parser/X3DParser.js +41 -20
- package/src/x_ite/Parser/XMLParser.js +178 -60
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +104 -44
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +111 -42
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -14
- package/src/x_ite/Rendering/DependentRenderer.js +7 -9
- package/src/x_ite/Rendering/TextureBuffer.js +24 -19
- package/src/x_ite/Rendering/X3DRenderObject.js +455 -428
- package/src/x_ite/Routing/RouteArray.js +34 -11
- package/src/x_ite/Routing/X3DRoute.js +60 -60
- package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
- package/src/x_ite/X3D.js +30 -37
- package/src/x_ite.config.js +40 -5
- package/src/x_ite.css +165 -45
- package/src/x_ite.html +49 -29
- package/src/x_ite.js +86 -25
- package/x_ite.min.html +49 -22
- package/.bzrignore +0 -3
- package/AUTHORS.md +0 -6
- package/STYLE_GUIDE.md +0 -51
- package/X_ITE.sln +0 -54
- package/X_ITE.userprefs +0 -14
- package/build/build.mdproj +0 -47
- package/build/cad-geometry.build.js +0 -15
- package/build/geospatial.build.js +0 -15
- package/build/h-anim.build.js +0 -15
- package/build/nurbs.build.js +0 -15
- package/build/particle-systems.build.js +0 -15
- package/build/parts/cad-geometry.end.frag +0 -2
- package/build/parts/cad-geometry.start.frag +0 -6
- package/build/parts/geospatial.end.frag +0 -2
- package/build/parts/geospatial.start.frag +0 -6
- package/build/parts/h-anim.end.frag +0 -2
- package/build/parts/h-anim.start.frag +0 -6
- package/build/parts/nurbs.end.frag +0 -2
- package/build/parts/nurbs.start.frag +0 -6
- package/build/parts/particle-systems.end.frag +0 -2
- package/build/parts/particle-systems.start.frag +0 -6
- package/build/parts/rigid-body-physics.end.frag +0 -2
- package/build/parts/rigid-body-physics.start.frag +0 -6
- package/build/parts/texturing-3d.end.frag +0 -2
- package/build/parts/texturing-3d.start.frag +0 -6
- package/build/parts/x_ite.end.frag +0 -9
- package/build/parts/x_ite.start.frag +0 -6
- package/build/rigid-body-physics.build.js +0 -15
- package/build/texturing-3d.build.js +0 -15
- package/dist/components/README +0 -3
- package/dist/components/cad-geometry.min.js +0 -1
- package/dist/components/geospatial.min.js +0 -2
- package/dist/components/h-anim.min.js +0 -1
- package/dist/components/nurbs.min.js +0 -2
- package/dist/components/particle-systems.min.js +0 -2
- package/dist/components/rigid-body-physics.js +0 -3761
- package/dist/components/rigid-body-physics.min.js +0 -56
- package/dist/components/texturing-3d.min.js +0 -1
- package/dist/dist.mdproj +0 -61
- package/dist/images/logo.128.png +0 -0
- package/fonts/fonts.mdproj +0 -29
- package/meta/meta.mdproj +0 -35
- package/src/components/cad-geometry.config.js +0 -56
- package/src/components/geospatial.config.js +0 -56
- package/src/components/h-anim.config.js +0 -56
- package/src/components/nurbs.config.js +0 -61
- package/src/components/particle-systems.config.js +0 -56
- package/src/components/rigid-body-physics.config.js +0 -61
- package/src/components/texturing-3d.config.js +0 -56
- package/src/images/logo.128.png +0 -0
- package/src/locale/de.mo +0 -0
- package/src/locale/fr.mo +0 -0
- package/src/src.mdproj +0 -698
- package/src/standard/Networking/URI.js +0 -785
- package/src/test.x3d +0 -225
- package/src/x_ite/Browser/Shaders/Background.fs +0 -31
- package/src/x_ite/Browser/Shaders/Background.vs +0 -23
- package/src/x_ite/Browser/Shaders/Depth.fs +0 -32
- package/src/x_ite/Browser/Shaders/Depth.vs +0 -21
- package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -135
- package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -145
- package/src/x_ite/Browser/Shaders/Phong.fs +0 -269
- package/src/x_ite/Browser/Shaders/Phong.vs +0 -47
- package/src/x_ite/Browser/Shaders/PointSet.fs +0 -86
- package/src/x_ite/Browser/Shaders/Types.h +0 -55
- package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -82
- package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -61
- package/src/x_ite/Components/DIS.js +0 -91
- package/src/x_ite/Components/Picking.js +0 -94
- package/src/x_ite/Components/VolumeRendering.js +0 -121
|
@@ -78,7 +78,7 @@ function ($,
|
|
|
78
78
|
{
|
|
79
79
|
"use strict";
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
const
|
|
82
82
|
DEPTH_BUFFER_WIDTH = 16,
|
|
83
83
|
DEPTH_BUFFER_HEIGHT = DEPTH_BUFFER_WIDTH;
|
|
84
84
|
|
|
@@ -87,18 +87,19 @@ function ($,
|
|
|
87
87
|
function X3DRenderObject (executionContext)
|
|
88
88
|
{
|
|
89
89
|
this .cameraSpaceMatrix = new MatrixStack (Matrix4);
|
|
90
|
-
this .
|
|
90
|
+
this .viewMatrix = new MatrixStack (Matrix4);
|
|
91
91
|
this .projectionMatrix = new MatrixStack (Matrix4);
|
|
92
92
|
this .modelViewMatrix = new MatrixStack (Matrix4);
|
|
93
93
|
this .viewVolumes = [ ];
|
|
94
|
-
this .
|
|
95
|
-
this .
|
|
94
|
+
this .globalObjects = [ ];
|
|
95
|
+
this .localObjects = [ ];
|
|
96
96
|
this .lights = [ ];
|
|
97
97
|
this .shadow = [ false ];
|
|
98
98
|
this .localFogs = [ ];
|
|
99
99
|
this .layouts = [ ];
|
|
100
|
+
this .textureProjectors = [ ];
|
|
100
101
|
this .generatedCubeMapTextures = [ ];
|
|
101
|
-
this .shaders = new
|
|
102
|
+
this .shaders = new Set ();
|
|
102
103
|
this .collisions = [ ];
|
|
103
104
|
this .numOpaqueShapes = 0;
|
|
104
105
|
this .numTransparentShapes = 0;
|
|
@@ -127,9 +128,6 @@ function ($,
|
|
|
127
128
|
X3DRenderObject .prototype =
|
|
128
129
|
{
|
|
129
130
|
constructor: X3DRenderObject,
|
|
130
|
-
bboxSize: new Vector3 (0, 0, 0),
|
|
131
|
-
bboxCenter: new Vector3 (0, 0, 0),
|
|
132
|
-
translation: new Vector3 (0, 0, 0),
|
|
133
131
|
initialize: function ()
|
|
134
132
|
{ },
|
|
135
133
|
isIndependent: function ()
|
|
@@ -140,9 +138,9 @@ function ($,
|
|
|
140
138
|
{
|
|
141
139
|
return this .cameraSpaceMatrix;
|
|
142
140
|
},
|
|
143
|
-
|
|
141
|
+
getViewMatrix: function ()
|
|
144
142
|
{
|
|
145
|
-
return this .
|
|
143
|
+
return this .viewMatrix;
|
|
146
144
|
},
|
|
147
145
|
getProjectionMatrix: function ()
|
|
148
146
|
{
|
|
@@ -158,15 +156,15 @@ function ($,
|
|
|
158
156
|
},
|
|
159
157
|
getViewVolume: function ()
|
|
160
158
|
{
|
|
161
|
-
return this .viewVolumes
|
|
159
|
+
return this .viewVolumes .at (-1);
|
|
162
160
|
},
|
|
163
|
-
|
|
161
|
+
getGlobalObjects: function ()
|
|
164
162
|
{
|
|
165
|
-
return this .
|
|
163
|
+
return this .globalObjects;
|
|
166
164
|
},
|
|
167
|
-
|
|
165
|
+
getLocalObjects: function ()
|
|
168
166
|
{
|
|
169
|
-
return this .
|
|
167
|
+
return this .localObjects;
|
|
170
168
|
},
|
|
171
169
|
getLights: function ()
|
|
172
170
|
{
|
|
@@ -174,21 +172,21 @@ function ($,
|
|
|
174
172
|
},
|
|
175
173
|
pushShadow: function (value)
|
|
176
174
|
{
|
|
177
|
-
this .shadow .
|
|
175
|
+
this .shadow .push (value || this .shadow .at (-1));
|
|
178
176
|
},
|
|
179
|
-
popShadow: function (
|
|
177
|
+
popShadow: function ()
|
|
180
178
|
{
|
|
181
179
|
this .shadow .pop ();
|
|
182
180
|
},
|
|
183
181
|
setGlobalFog: (function ()
|
|
184
182
|
{
|
|
185
|
-
|
|
183
|
+
const modelViewMatrix = new Matrix4 ();
|
|
186
184
|
|
|
187
185
|
return function (fog)
|
|
188
186
|
{
|
|
189
|
-
|
|
187
|
+
const fogContainer = this .localFogs [0] || fog .getFogs () .pop ();
|
|
190
188
|
|
|
191
|
-
modelViewMatrix .assign (fog .getModelMatrix ()) .multRight (this .
|
|
189
|
+
modelViewMatrix .assign (fog .getModelMatrix ()) .multRight (this .getViewMatrix () .get ());
|
|
192
190
|
fogContainer .set (fog, modelViewMatrix);
|
|
193
191
|
|
|
194
192
|
this .localFog = this .localFogs [0] = fogContainer;
|
|
@@ -202,9 +200,9 @@ function ($,
|
|
|
202
200
|
},
|
|
203
201
|
popLocalFog: function ()
|
|
204
202
|
{
|
|
205
|
-
|
|
203
|
+
const localFog = this .localFogs .pop ();
|
|
206
204
|
|
|
207
|
-
this .localFog = this .localFogs
|
|
205
|
+
this .localFog = this .localFogs .at (-1);
|
|
208
206
|
|
|
209
207
|
return localFog;
|
|
210
208
|
},
|
|
@@ -214,7 +212,11 @@ function ($,
|
|
|
214
212
|
},
|
|
215
213
|
getParentLayout: function ()
|
|
216
214
|
{
|
|
217
|
-
return this .layouts .
|
|
215
|
+
return this .layouts .at (-1);
|
|
216
|
+
},
|
|
217
|
+
getTextureProjectors: function ()
|
|
218
|
+
{
|
|
219
|
+
return this .textureProjectors;
|
|
218
220
|
},
|
|
219
221
|
getGeneratedCubeMapTextures: function ()
|
|
220
222
|
{
|
|
@@ -282,22 +284,20 @@ function ($,
|
|
|
282
284
|
/// and obstacle and @a stepBack is true a translation in the opposite directiion is returned. Future implementation will
|
|
283
285
|
/// will then return a value where the avatar slides along the wall. Modifies translation in place.
|
|
284
286
|
|
|
285
|
-
var distance = this .getDistance (translation);
|
|
286
|
-
|
|
287
287
|
// Constrain translation when the viewer collides with an obstacle.
|
|
288
288
|
|
|
289
|
-
distance
|
|
289
|
+
const distance = this .getDistance (translation) - this .getNavigationInfo () .getCollisionRadius ();
|
|
290
290
|
|
|
291
291
|
if (distance > 0)
|
|
292
292
|
{
|
|
293
293
|
// Move.
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
|
|
295
|
+
const length = translation .abs ();
|
|
296
296
|
|
|
297
297
|
if (length > distance)
|
|
298
298
|
{
|
|
299
299
|
// Collision, the avatar would intersect with the obstacle.
|
|
300
|
-
|
|
300
|
+
|
|
301
301
|
return translation .normalize () .multiply (distance);
|
|
302
302
|
}
|
|
303
303
|
|
|
@@ -315,7 +315,7 @@ function ($,
|
|
|
315
315
|
},
|
|
316
316
|
getDistance: (function ()
|
|
317
317
|
{
|
|
318
|
-
|
|
318
|
+
const
|
|
319
319
|
projectionMatrix = new Matrix4 (),
|
|
320
320
|
cameraSpaceProjectionMatrix = new Matrix4 (),
|
|
321
321
|
localOrientation = new Rotation4 (0, 0, 1, 0),
|
|
@@ -325,23 +325,23 @@ function ($,
|
|
|
325
325
|
return function (direction)
|
|
326
326
|
{
|
|
327
327
|
/// Returns the distance to the closest object in @a direction. The maximum determinable value is avatarHeight * 2.
|
|
328
|
-
|
|
328
|
+
|
|
329
329
|
try
|
|
330
330
|
{
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
const t0 = performance .now ();
|
|
332
|
+
|
|
333
|
+
const
|
|
334
334
|
viewpoint = this .getViewpoint (),
|
|
335
335
|
navigationInfo = this .getNavigationInfo (),
|
|
336
336
|
collisionRadius = navigationInfo .getCollisionRadius (),
|
|
337
337
|
bottom = navigationInfo .getStepHeight () - navigationInfo .getAvatarHeight (),
|
|
338
338
|
nearValue = navigationInfo .getNearValue (),
|
|
339
339
|
avatarHeight = navigationInfo .getAvatarHeight ();
|
|
340
|
-
|
|
340
|
+
|
|
341
341
|
// Determine width and height of camera
|
|
342
|
-
|
|
342
|
+
|
|
343
343
|
// Reshape camera
|
|
344
|
-
|
|
344
|
+
|
|
345
345
|
Camera .ortho (-collisionRadius,
|
|
346
346
|
collisionRadius,
|
|
347
347
|
Math .min (bottom, -collisionRadius), /// TODO: bottom could be a positive value if stepHeight > avatarHeight.
|
|
@@ -349,27 +349,27 @@ function ($,
|
|
|
349
349
|
nearValue,
|
|
350
350
|
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
351
351
|
projectionMatrix);
|
|
352
|
-
|
|
352
|
+
|
|
353
353
|
// Translate camera to user position and to look in the direction of the direction.
|
|
354
|
-
|
|
354
|
+
|
|
355
355
|
localOrientation .assign (viewpoint .orientation_ .getValue ()) .inverse () .multRight (viewpoint .getOrientation ());
|
|
356
356
|
rotation .setFromToVec (Vector3 .zAxis, vector .assign (direction) .negate ()) .multRight (localOrientation);
|
|
357
357
|
viewpoint .straightenHorizon (rotation);
|
|
358
|
-
|
|
358
|
+
|
|
359
359
|
cameraSpaceProjectionMatrix .assign (viewpoint .getModelMatrix ());
|
|
360
360
|
cameraSpaceProjectionMatrix .translate (viewpoint .getUserPosition ());
|
|
361
361
|
cameraSpaceProjectionMatrix .rotate (rotation);
|
|
362
362
|
cameraSpaceProjectionMatrix .inverse ();
|
|
363
|
-
|
|
363
|
+
|
|
364
364
|
cameraSpaceProjectionMatrix .multRight (projectionMatrix);
|
|
365
365
|
cameraSpaceProjectionMatrix .multLeft (viewpoint .getCameraSpaceMatrix ());
|
|
366
|
-
|
|
366
|
+
|
|
367
367
|
this .getProjectionMatrix () .pushMatrix (cameraSpaceProjectionMatrix);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
|
|
369
|
+
const depth = this .getDepth (projectionMatrix);
|
|
370
|
+
|
|
371
371
|
this .getProjectionMatrix () .pop ();
|
|
372
|
-
|
|
372
|
+
|
|
373
373
|
this .collisionTime += performance .now () - t0;
|
|
374
374
|
return -depth;
|
|
375
375
|
}
|
|
@@ -381,7 +381,7 @@ function ($,
|
|
|
381
381
|
})(),
|
|
382
382
|
getDepth: (function ()
|
|
383
383
|
{
|
|
384
|
-
|
|
384
|
+
const
|
|
385
385
|
depthBufferViewport = new Vector4 (0, 0, DEPTH_BUFFER_WIDTH, DEPTH_BUFFER_HEIGHT),
|
|
386
386
|
depthBufferViewVolume = new ViewVolume ();
|
|
387
387
|
|
|
@@ -390,21 +390,21 @@ function ($,
|
|
|
390
390
|
return function (projectionMatrix)
|
|
391
391
|
{
|
|
392
392
|
/// Returns the depth value to the closest object. The maximum determinable value is avatarHeight * 2.
|
|
393
|
-
|
|
393
|
+
|
|
394
394
|
this .depthBuffer .bind ();
|
|
395
|
-
|
|
395
|
+
|
|
396
396
|
this .viewVolumes .push (depthBufferViewVolume);
|
|
397
397
|
this .depth (this .collisionShapes, this .numCollisionShapes);
|
|
398
|
-
this .viewVolumes .pop ();
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
398
|
+
this .viewVolumes .pop ();
|
|
399
|
+
|
|
400
|
+
const depth = this .depthBuffer .getDepth (projectionMatrix, depthBufferViewport);
|
|
401
|
+
|
|
402
402
|
this .depthBuffer .unbind ();
|
|
403
|
-
|
|
403
|
+
|
|
404
404
|
return depth;
|
|
405
405
|
};
|
|
406
406
|
})(),
|
|
407
|
-
render: function (type, group)
|
|
407
|
+
render: function (type, callback, group)
|
|
408
408
|
{
|
|
409
409
|
switch (type)
|
|
410
410
|
{
|
|
@@ -413,16 +413,16 @@ function ($,
|
|
|
413
413
|
// Collect for collide and gravite
|
|
414
414
|
this .numCollisionShapes = 0;
|
|
415
415
|
|
|
416
|
-
|
|
416
|
+
callback .call (group, type, this);
|
|
417
417
|
this .collide ();
|
|
418
418
|
this .gravite ();
|
|
419
419
|
break;
|
|
420
420
|
}
|
|
421
|
-
case TraverseType .
|
|
421
|
+
case TraverseType .SHADOW:
|
|
422
422
|
{
|
|
423
423
|
this .numDepthShapes = 0;
|
|
424
424
|
|
|
425
|
-
|
|
425
|
+
callback .call (group, type, this);
|
|
426
426
|
this .depth (this .depthShapes, this .numDepthShapes);
|
|
427
427
|
break;
|
|
428
428
|
}
|
|
@@ -434,161 +434,170 @@ function ($,
|
|
|
434
434
|
|
|
435
435
|
this .setGlobalFog (this .getFog ());
|
|
436
436
|
|
|
437
|
-
|
|
438
|
-
this .draw (
|
|
437
|
+
callback .call (group, type, this);
|
|
438
|
+
this .draw ();
|
|
439
439
|
break;
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
|
-
addCollisionShape: function (
|
|
443
|
+
addCollisionShape: (function ()
|
|
444
444
|
{
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
bboxCenter = modelViewMatrix .multVecMatrix (this .bboxCenter .assign (shapeNode .getBBoxCenter ())),
|
|
449
|
-
radius = bboxSize .abs () / 2,
|
|
450
|
-
viewVolume = this .viewVolumes [this .viewVolumes .length - 1];
|
|
445
|
+
const
|
|
446
|
+
bboxSize = new Vector3 (0, 0, 0),
|
|
447
|
+
bboxCenter = new Vector3 (0, 0, 0);
|
|
451
448
|
|
|
452
|
-
|
|
449
|
+
return function (shapeNode)
|
|
453
450
|
{
|
|
454
|
-
|
|
455
|
-
this .collisionShapes .push ({ renderer: this, modelViewMatrix: new Float32Array (16), collisions: [ ], clipPlanes: [ ] });
|
|
456
|
-
|
|
457
|
-
var context = this .collisionShapes [this .numCollisionShapes];
|
|
458
|
-
|
|
459
|
-
++ this .numCollisionShapes;
|
|
460
|
-
|
|
461
|
-
context .modelViewMatrix .set (modelViewMatrix);
|
|
462
|
-
context .shapeNode = shapeNode;
|
|
463
|
-
context .scissor = viewVolume .getScissor ();
|
|
464
|
-
|
|
465
|
-
// Collisions
|
|
451
|
+
const modelViewMatrix = this .getModelViewMatrix () .get ();
|
|
466
452
|
|
|
467
|
-
|
|
453
|
+
modelViewMatrix .multDirMatrix (bboxSize .assign (shapeNode .getBBoxSize ()));
|
|
454
|
+
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
468
455
|
|
|
469
|
-
|
|
470
|
-
|
|
456
|
+
const
|
|
457
|
+
radius = bboxSize .abs () / 2,
|
|
458
|
+
viewVolume = this .viewVolumes .at (-1);
|
|
471
459
|
|
|
472
|
-
|
|
460
|
+
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
461
|
+
{
|
|
462
|
+
const num = this .numCollisionShapes ++;
|
|
473
463
|
|
|
474
|
-
|
|
464
|
+
if (num === this .collisionShapes .length)
|
|
465
|
+
{
|
|
466
|
+
this .collisionShapes .push ({ renderer: this, browser: this .getBrowser (), modelViewMatrix: new Float32Array (16), collisions: [ ], clipPlanes: [ ] });
|
|
467
|
+
}
|
|
475
468
|
|
|
476
|
-
|
|
477
|
-
Array .prototype .push .apply (clipPlanes, this .shaderObjects);
|
|
469
|
+
const context = this .collisionShapes [num];
|
|
478
470
|
|
|
479
|
-
|
|
480
|
-
|
|
471
|
+
context .modelViewMatrix .set (modelViewMatrix);
|
|
472
|
+
context .shapeNode = shapeNode;
|
|
473
|
+
context .scissor = viewVolume .getScissor ();
|
|
481
474
|
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
addDepthShape: function (shapeNode)
|
|
485
|
-
{
|
|
486
|
-
var
|
|
487
|
-
modelViewMatrix = this .getModelViewMatrix () .get (),
|
|
488
|
-
bboxSize = modelViewMatrix .multDirMatrix (this .bboxSize .assign (shapeNode .getBBoxSize ())),
|
|
489
|
-
bboxCenter = modelViewMatrix .multVecMatrix (this .bboxCenter .assign (shapeNode .getBBoxCenter ())),
|
|
490
|
-
radius = bboxSize .abs () / 2,
|
|
491
|
-
viewVolume = this .viewVolumes [this .viewVolumes .length - 1];
|
|
475
|
+
// Collisions
|
|
492
476
|
|
|
493
|
-
|
|
494
|
-
{
|
|
495
|
-
if (this .numDepthShapes === this .depthShapes .length)
|
|
496
|
-
this .depthShapes .push ({ renderer: this, modelViewMatrix: new Float32Array (16), clipPlanes: [ ] });
|
|
497
|
-
|
|
498
|
-
var context = this .depthShapes [this .numDepthShapes];
|
|
499
|
-
|
|
500
|
-
++ this .numDepthShapes;
|
|
501
|
-
|
|
502
|
-
context .modelViewMatrix .set (modelViewMatrix);
|
|
503
|
-
context .shapeNode = shapeNode;
|
|
504
|
-
context .scissor = viewVolume .getScissor ();
|
|
505
|
-
|
|
506
|
-
// Clip planes
|
|
507
|
-
|
|
508
|
-
var clipPlanes = context .clipPlanes;
|
|
509
|
-
|
|
510
|
-
clipPlanes .length = 0;
|
|
511
|
-
Array .prototype .push .apply (clipPlanes, this .shaderObjects);
|
|
512
|
-
|
|
513
|
-
return true;
|
|
514
|
-
}
|
|
477
|
+
assign (context .collisions, this .collisions);
|
|
515
478
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
479
|
+
// Clip planes
|
|
480
|
+
|
|
481
|
+
assign (context .clipPlanes, this .localObjects);
|
|
482
|
+
|
|
483
|
+
return true;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return false;
|
|
487
|
+
};
|
|
488
|
+
})(),
|
|
489
|
+
addDepthShape: (function ()
|
|
519
490
|
{
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
bboxCenter = modelViewMatrix .multVecMatrix (this .bboxCenter .assign (shapeNode .getBBoxCenter ())),
|
|
524
|
-
radius = bboxSize .abs () / 2,
|
|
525
|
-
viewVolume = this .viewVolumes [this .viewVolumes .length - 1];
|
|
491
|
+
const
|
|
492
|
+
bboxSize = new Vector3 (0, 0, 0),
|
|
493
|
+
bboxCenter = new Vector3 (0, 0, 0);
|
|
526
494
|
|
|
527
|
-
|
|
495
|
+
return function (shapeNode)
|
|
528
496
|
{
|
|
529
|
-
|
|
497
|
+
const modelViewMatrix = this .getModelViewMatrix () .get ();
|
|
498
|
+
|
|
499
|
+
modelViewMatrix .multDirMatrix (bboxSize .assign (shapeNode .getBBoxSize ()));
|
|
500
|
+
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
501
|
+
|
|
502
|
+
const
|
|
503
|
+
radius = bboxSize .abs () / 2,
|
|
504
|
+
viewVolume = this .viewVolumes .at (-1);
|
|
505
|
+
|
|
506
|
+
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
530
507
|
{
|
|
531
|
-
|
|
508
|
+
const num = this .numDepthShapes ++;
|
|
532
509
|
|
|
533
|
-
if (num === this .
|
|
534
|
-
|
|
510
|
+
if (num === this .depthShapes .length)
|
|
511
|
+
{
|
|
512
|
+
this .depthShapes .push ({ renderer: this, browser: this .getBrowser (), modelViewMatrix: new Float32Array (16), clipPlanes: [ ] });
|
|
513
|
+
}
|
|
535
514
|
|
|
536
|
-
|
|
515
|
+
const context = this .depthShapes [num];
|
|
537
516
|
|
|
538
|
-
|
|
517
|
+
context .modelViewMatrix .set (modelViewMatrix);
|
|
518
|
+
context .shapeNode = shapeNode;
|
|
519
|
+
context .scissor = viewVolume .getScissor ();
|
|
520
|
+
|
|
521
|
+
// Clip planes
|
|
522
|
+
|
|
523
|
+
assign (context .clipPlanes, this .localObjects);
|
|
524
|
+
|
|
525
|
+
return true;
|
|
539
526
|
}
|
|
540
|
-
|
|
527
|
+
|
|
528
|
+
return false;
|
|
529
|
+
};
|
|
530
|
+
})(),
|
|
531
|
+
addDisplayShape: (function ()
|
|
532
|
+
{
|
|
533
|
+
const
|
|
534
|
+
bboxSize = new Vector3 (0, 0, 0),
|
|
535
|
+
bboxCenter = new Vector3 (0, 0, 0);
|
|
536
|
+
|
|
537
|
+
return function (shapeNode)
|
|
538
|
+
{
|
|
539
|
+
const modelViewMatrix = this .getModelViewMatrix () .get ();
|
|
540
|
+
|
|
541
|
+
modelViewMatrix .multDirMatrix (bboxSize .assign (shapeNode .getBBoxSize ()));
|
|
542
|
+
modelViewMatrix .multVecMatrix (bboxCenter .assign (shapeNode .getBBoxCenter ()));
|
|
543
|
+
|
|
544
|
+
const
|
|
545
|
+
radius = bboxSize .abs () / 2,
|
|
546
|
+
viewVolume = this .viewVolumes .at (-1);
|
|
547
|
+
|
|
548
|
+
if (viewVolume .intersectsSphere (radius, bboxCenter))
|
|
541
549
|
{
|
|
542
|
-
|
|
550
|
+
if (shapeNode .getTransparent ())
|
|
551
|
+
{
|
|
552
|
+
const num = this .numTransparentShapes ++;
|
|
543
553
|
|
|
544
|
-
|
|
545
|
-
|
|
554
|
+
if (num === this .transparentShapes .length)
|
|
555
|
+
this .transparentShapes .push (this .createShapeContext (true));
|
|
546
556
|
|
|
547
|
-
|
|
557
|
+
var context = this .transparentShapes [num];
|
|
558
|
+
}
|
|
559
|
+
else
|
|
560
|
+
{
|
|
561
|
+
const num = this .numOpaqueShapes ++;
|
|
548
562
|
|
|
549
|
-
|
|
550
|
-
|
|
563
|
+
if (num === this .opaqueShapes .length)
|
|
564
|
+
this .opaqueShapes .push (this .createShapeContext (false));
|
|
551
565
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
context .shapeNode = shapeNode;
|
|
555
|
-
context .distance = bboxCenter .z - radius;
|
|
556
|
-
context .fogNode = this .localFog;
|
|
557
|
-
context .shadow = this .shadow [0];
|
|
566
|
+
var context = this .opaqueShapes [num];
|
|
567
|
+
}
|
|
558
568
|
|
|
559
|
-
|
|
569
|
+
context .modelViewMatrix .set (modelViewMatrix);
|
|
570
|
+
context .scissor .assign (viewVolume .getScissor ());
|
|
571
|
+
context .shapeNode = shapeNode;
|
|
572
|
+
context .textureNode = null;
|
|
573
|
+
context .distance = bboxCenter .z;
|
|
574
|
+
context .fogNode = this .localFog;
|
|
575
|
+
context .shadow = this .shadow .at (-1);
|
|
560
576
|
|
|
561
|
-
|
|
577
|
+
// Clip planes and local lights
|
|
562
578
|
|
|
563
|
-
|
|
564
|
-
Array .prototype .push .apply (shaderObjects, this .shaderObjects);
|
|
579
|
+
assign (context .localObjects, this .localObjects);
|
|
565
580
|
|
|
566
|
-
|
|
567
|
-
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
568
583
|
|
|
569
|
-
|
|
570
|
-
|
|
584
|
+
return false;
|
|
585
|
+
};
|
|
586
|
+
})(),
|
|
571
587
|
createShapeContext: function (transparent)
|
|
572
588
|
{
|
|
573
589
|
return {
|
|
574
590
|
renderer: this,
|
|
591
|
+
browser: this .getBrowser (),
|
|
575
592
|
transparent: transparent,
|
|
576
|
-
geometryType: 3,
|
|
577
|
-
colorMaterial: false,
|
|
578
593
|
modelViewMatrix: new Float32Array (16),
|
|
579
594
|
scissor: new Vector4 (0, 0, 0, 0),
|
|
580
|
-
|
|
581
|
-
linePropertiesNode: null,
|
|
582
|
-
materialNode: null,
|
|
583
|
-
textureNode: null,
|
|
584
|
-
textureTransformNode: null,
|
|
585
|
-
shaderNode: null,
|
|
586
|
-
shadow: false,
|
|
595
|
+
localObjects: [ ],
|
|
587
596
|
};
|
|
588
597
|
},
|
|
589
598
|
collide: (function ()
|
|
590
599
|
{
|
|
591
|
-
|
|
600
|
+
const
|
|
592
601
|
invModelViewMatrix = new Matrix4 (),
|
|
593
602
|
modelViewMatrix = new Matrix4 (),
|
|
594
603
|
collisionBox = new Box3 (Vector3 .Zero, Vector3 .Zero),
|
|
@@ -597,30 +606,30 @@ function ($,
|
|
|
597
606
|
return function ()
|
|
598
607
|
{
|
|
599
608
|
// Collision nodes are handled here.
|
|
600
|
-
|
|
601
|
-
|
|
609
|
+
|
|
610
|
+
const
|
|
602
611
|
activeCollisions = { }, // current active Collision nodes
|
|
603
612
|
collisionRadius2 = 2.2 * this .getNavigationInfo () .getCollisionRadius (); // Make the radius a little bit larger.
|
|
604
|
-
|
|
613
|
+
|
|
605
614
|
collisionSize .set (collisionRadius2, collisionRadius2, collisionRadius2);
|
|
606
|
-
|
|
607
|
-
for (
|
|
615
|
+
|
|
616
|
+
for (let i = 0, length = this .numCollisionShapes; i < length; ++ i)
|
|
608
617
|
{
|
|
609
618
|
try
|
|
610
619
|
{
|
|
611
|
-
|
|
620
|
+
const
|
|
612
621
|
context = this .collisionShapes [i],
|
|
613
622
|
collisions = context .collisions;
|
|
614
|
-
|
|
623
|
+
|
|
615
624
|
if (collisions .length)
|
|
616
625
|
{
|
|
617
626
|
collisionBox .set (collisionSize, Vector3 .Zero);
|
|
618
627
|
collisionBox .multRight (invModelViewMatrix .assign (context .modelViewMatrix) .inverse ());
|
|
619
|
-
|
|
628
|
+
|
|
620
629
|
if (context .shapeNode .intersectsBox (collisionBox, context .clipPlanes, modelViewMatrix .assign (context .modelViewMatrix)))
|
|
621
630
|
{
|
|
622
|
-
for (
|
|
623
|
-
activeCollisions [
|
|
631
|
+
for (const collision of collisions)
|
|
632
|
+
activeCollisions [collision .getId ()] = collision;
|
|
624
633
|
}
|
|
625
634
|
}
|
|
626
635
|
}
|
|
@@ -629,139 +638,146 @@ function ($,
|
|
|
629
638
|
console .log (error);
|
|
630
639
|
}
|
|
631
640
|
}
|
|
632
|
-
|
|
641
|
+
|
|
633
642
|
// Set isActive to FALSE for affected nodes.
|
|
634
|
-
|
|
643
|
+
|
|
635
644
|
if (! $.isEmptyObject (this .activeCollisions))
|
|
636
645
|
{
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
for (
|
|
646
|
+
const inActiveCollisions = $.isEmptyObject (activeCollisions)
|
|
647
|
+
? this .activeCollisions
|
|
648
|
+
: Algorithm .set_difference (this .activeCollisions, activeCollisions, { });
|
|
649
|
+
|
|
650
|
+
for (const key in inActiveCollisions)
|
|
642
651
|
inActiveCollisions [key] .set_active (false);
|
|
643
652
|
}
|
|
644
|
-
|
|
653
|
+
|
|
645
654
|
// Set isActive to TRUE for affected nodes.
|
|
646
|
-
|
|
655
|
+
|
|
647
656
|
this .activeCollisions = activeCollisions;
|
|
648
|
-
|
|
649
|
-
for (
|
|
657
|
+
|
|
658
|
+
for (const key in activeCollisions)
|
|
650
659
|
activeCollisions [key] .set_active (true);
|
|
651
660
|
};
|
|
652
661
|
})(),
|
|
653
662
|
gravite: (function ()
|
|
654
663
|
{
|
|
655
|
-
|
|
664
|
+
const
|
|
656
665
|
projectionMatrix = new Matrix4 (),
|
|
657
666
|
cameraSpaceProjectionMatrix = new Matrix4 (),
|
|
658
|
-
|
|
667
|
+
translation = new Vector3 (0, 0, 0),
|
|
659
668
|
rotation = new Rotation4 (0, 0, 1, 0);
|
|
660
669
|
|
|
661
670
|
return function ()
|
|
662
671
|
{
|
|
663
672
|
try
|
|
664
673
|
{
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
674
|
+
const
|
|
675
|
+
browser = this .getBrowser (),
|
|
676
|
+
shaderNode = browser .getDepthShader ();
|
|
677
|
+
|
|
678
|
+
if (shaderNode .getValid ())
|
|
668
679
|
{
|
|
669
|
-
|
|
680
|
+
// Terrain following and gravitation
|
|
681
|
+
|
|
682
|
+
if (browser .getActiveLayer () === this)
|
|
683
|
+
{
|
|
684
|
+
if (browser .getCurrentViewer () !== "WALK")
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
else if (this .getNavigationInfo () .getViewer () !== "WALK")
|
|
670
688
|
return;
|
|
671
|
-
}
|
|
672
|
-
else if (this .getNavigationInfo () .getViewer () !== "WALK")
|
|
673
|
-
return;
|
|
674
689
|
|
|
675
|
-
|
|
690
|
+
// Get NavigationInfo values
|
|
676
691
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
692
|
+
const
|
|
693
|
+
navigationInfo = this .getNavigationInfo (),
|
|
694
|
+
viewpoint = this .getViewpoint (),
|
|
695
|
+
collisionRadius = navigationInfo .getCollisionRadius (),
|
|
696
|
+
nearValue = navigationInfo .getNearValue (),
|
|
697
|
+
avatarHeight = navigationInfo .getAvatarHeight (),
|
|
698
|
+
stepHeight = navigationInfo .getStepHeight ();
|
|
684
699
|
|
|
685
|
-
|
|
700
|
+
// Reshape viewpoint for gravite.
|
|
686
701
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
702
|
+
Camera .ortho (-collisionRadius,
|
|
703
|
+
collisionRadius,
|
|
704
|
+
-collisionRadius,
|
|
705
|
+
collisionRadius,
|
|
706
|
+
nearValue,
|
|
707
|
+
Math .max (collisionRadius * 2, avatarHeight * 2),
|
|
708
|
+
projectionMatrix);
|
|
694
709
|
|
|
695
|
-
|
|
710
|
+
// Transform viewpoint to look down the up vector
|
|
696
711
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
712
|
+
const
|
|
713
|
+
upVector = viewpoint .getUpVector (),
|
|
714
|
+
down = rotation .setFromToVec (Vector3 .zAxis, upVector);
|
|
700
715
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
716
|
+
cameraSpaceProjectionMatrix .assign (viewpoint .getModelMatrix ());
|
|
717
|
+
cameraSpaceProjectionMatrix .translate (viewpoint .getUserPosition ());
|
|
718
|
+
cameraSpaceProjectionMatrix .rotate (down);
|
|
719
|
+
cameraSpaceProjectionMatrix .inverse ();
|
|
705
720
|
|
|
706
|
-
|
|
707
|
-
|
|
721
|
+
cameraSpaceProjectionMatrix .multRight (projectionMatrix);
|
|
722
|
+
cameraSpaceProjectionMatrix .multLeft (viewpoint .getCameraSpaceMatrix ());
|
|
708
723
|
|
|
709
|
-
|
|
724
|
+
this .getProjectionMatrix () .pushMatrix (cameraSpaceProjectionMatrix);
|
|
710
725
|
|
|
711
|
-
|
|
726
|
+
let distance = -this .getDepth (projectionMatrix);
|
|
712
727
|
|
|
713
|
-
|
|
728
|
+
this .getProjectionMatrix () .pop ();
|
|
714
729
|
|
|
715
|
-
|
|
730
|
+
// Gravite or step up
|
|
716
731
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
{
|
|
723
|
-
// Gravite and fall down the to the floor
|
|
724
|
-
|
|
725
|
-
var currentFrameRate = this .speed ? this .getBrowser () .getCurrentFrameRate () : 1000000;
|
|
726
|
-
|
|
727
|
-
this .speed -= this .getBrowser () .getBrowserOptions () .Gravity_ .getValue () / currentFrameRate;
|
|
728
|
-
|
|
729
|
-
var translation = this .speed / currentFrameRate;
|
|
730
|
-
|
|
731
|
-
if (translation < -distance)
|
|
732
|
+
distance -= avatarHeight;
|
|
733
|
+
|
|
734
|
+
const up = rotation .setFromToVec (Vector3 .yAxis, upVector);
|
|
735
|
+
|
|
736
|
+
if (distance > 0)
|
|
732
737
|
{
|
|
733
|
-
//
|
|
734
|
-
translation = -distance;
|
|
735
|
-
this .speed = 0;
|
|
736
|
-
}
|
|
738
|
+
// Gravite and fall down the to the floor
|
|
737
739
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
{
|
|
742
|
-
this .speed = 0;
|
|
740
|
+
const currentFrameRate = this .speed ? browser .getCurrentFrameRate () : 1000000;
|
|
741
|
+
|
|
742
|
+
this .speed -= browser .getBrowserOptions () .Gravity_ .getValue () / currentFrameRate;
|
|
743
743
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
744
|
+
let y = this .speed / currentFrameRate;
|
|
745
|
+
|
|
746
|
+
if (y < -distance)
|
|
747
|
+
{
|
|
748
|
+
// The ground is reached.
|
|
749
|
+
y = -distance;
|
|
750
|
+
this .speed = 0;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
viewpoint .positionOffset_ = viewpoint .positionOffset_ .getValue () .add (up .multVecRot (translation .set (0, y, 0)));
|
|
754
|
+
}
|
|
755
|
+
else
|
|
747
756
|
{
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
757
|
+
this .speed = 0;
|
|
758
|
+
|
|
759
|
+
distance = -distance;
|
|
760
|
+
|
|
761
|
+
if (distance > 0.01 && distance < stepHeight)
|
|
762
|
+
{
|
|
763
|
+
// Step up
|
|
764
|
+
this .constrainTranslation (up .multVecRot (translation .set (0, distance, 0)), false);
|
|
765
|
+
|
|
766
|
+
//if (getBrowser () -> getBrowserOptions () -> animateStairWalks ())
|
|
767
|
+
//{
|
|
768
|
+
// float step = getBrowser () -> getCurrentSpeed () / getBrowser () -> getCurrentFrameRate ();
|
|
769
|
+
// step = abs (getViewMatrix () .mult_matrix_dir (Vector3f (0, step, 0) * up));
|
|
770
|
+
//
|
|
771
|
+
// Vector3f offset = Vector3f (0, step, 0) * up;
|
|
772
|
+
//
|
|
773
|
+
// if (math::abs (offset) > math::abs (translation) or getBrowser () -> getCurrentSpeed () == 0)
|
|
774
|
+
// offset = translation;
|
|
775
|
+
//
|
|
776
|
+
// getViewpoint () -> positionOffset () += offset;
|
|
777
|
+
//}
|
|
778
|
+
//else
|
|
779
|
+
viewpoint .positionOffset_ = translation .add (viewpoint .positionOffset_ .getValue ());
|
|
780
|
+
}
|
|
765
781
|
}
|
|
766
782
|
}
|
|
767
783
|
}
|
|
@@ -773,245 +789,256 @@ function ($,
|
|
|
773
789
|
})(),
|
|
774
790
|
depth: (function ()
|
|
775
791
|
{
|
|
776
|
-
|
|
792
|
+
const projectionMatrixArray = new Float32Array (16);
|
|
777
793
|
|
|
778
794
|
return function (shapes, numShapes)
|
|
779
795
|
{
|
|
780
|
-
|
|
796
|
+
const
|
|
781
797
|
browser = this .getBrowser (),
|
|
782
798
|
gl = browser .getContext (),
|
|
783
799
|
viewport = this .getViewVolume () .getViewport (),
|
|
784
800
|
shaderNode = browser .getDepthShader ();
|
|
785
|
-
|
|
801
|
+
|
|
786
802
|
// Configure depth shader.
|
|
787
|
-
|
|
788
|
-
shaderNode .
|
|
789
|
-
|
|
790
|
-
projectionMatrixArray .set (this .getProjectionMatrix () .get ());
|
|
791
|
-
|
|
792
|
-
gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, projectionMatrixArray);
|
|
793
|
-
|
|
794
|
-
// Configure viewport and background
|
|
795
|
-
|
|
796
|
-
gl .viewport (viewport [0],
|
|
797
|
-
viewport [1],
|
|
798
|
-
viewport [2],
|
|
799
|
-
viewport [3]);
|
|
800
|
-
|
|
801
|
-
gl .scissor (viewport [0],
|
|
802
|
-
viewport [1],
|
|
803
|
-
viewport [2],
|
|
804
|
-
viewport [3]);
|
|
805
|
-
|
|
806
|
-
gl .clearColor (1, 0, 0, 0);
|
|
807
|
-
gl .clear (gl .COLOR_BUFFER_BIT | gl .DEPTH_BUFFER_BIT);
|
|
808
|
-
|
|
809
|
-
// Render all objects
|
|
810
|
-
|
|
811
|
-
gl .enable (gl .DEPTH_TEST);
|
|
812
|
-
gl .depthMask (true);
|
|
813
|
-
gl .disable (gl .BLEND);
|
|
814
|
-
gl .disable (gl .CULL_FACE);
|
|
815
|
-
|
|
816
|
-
for (var s = 0; s < numShapes; ++ s)
|
|
803
|
+
|
|
804
|
+
if (shaderNode .getValid ())
|
|
817
805
|
{
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
//
|
|
837
|
-
|
|
838
|
-
|
|
806
|
+
shaderNode .enable (gl);
|
|
807
|
+
|
|
808
|
+
projectionMatrixArray .set (this .getProjectionMatrix () .get ());
|
|
809
|
+
|
|
810
|
+
gl .uniformMatrix4fv (shaderNode .x3d_ProjectionMatrix, false, projectionMatrixArray);
|
|
811
|
+
|
|
812
|
+
// Configure viewport and background
|
|
813
|
+
|
|
814
|
+
gl .viewport (viewport [0],
|
|
815
|
+
viewport [1],
|
|
816
|
+
viewport [2],
|
|
817
|
+
viewport [3]);
|
|
818
|
+
|
|
819
|
+
gl .scissor (viewport [0],
|
|
820
|
+
viewport [1],
|
|
821
|
+
viewport [2],
|
|
822
|
+
viewport [3]);
|
|
823
|
+
|
|
824
|
+
gl .clearColor (1, 0, 0, 0); // Must be '1, 0, 0, 0'.
|
|
825
|
+
gl .clear (gl .COLOR_BUFFER_BIT | gl .DEPTH_BUFFER_BIT);
|
|
826
|
+
|
|
827
|
+
// Render all objects
|
|
828
|
+
|
|
829
|
+
gl .enable (gl .DEPTH_TEST);
|
|
830
|
+
gl .depthMask (true);
|
|
831
|
+
gl .disable (gl .BLEND);
|
|
832
|
+
gl .disable (gl .CULL_FACE);
|
|
833
|
+
|
|
834
|
+
for (let s = 0; s < numShapes; ++ s)
|
|
835
|
+
{
|
|
836
|
+
const
|
|
837
|
+
context = shapes [s],
|
|
838
|
+
scissor = context .scissor;
|
|
839
|
+
|
|
840
|
+
// TODO: viewport must not be the browser or layer viewport.
|
|
841
|
+
gl .scissor (scissor .x,
|
|
842
|
+
scissor .y,
|
|
843
|
+
scissor .z,
|
|
844
|
+
scissor .w);
|
|
845
|
+
|
|
846
|
+
// Clip planes
|
|
847
|
+
|
|
848
|
+
shaderNode .setLocalObjects (gl, context .clipPlanes);
|
|
849
|
+
|
|
850
|
+
// modelViewMatrix
|
|
851
|
+
|
|
852
|
+
gl .uniformMatrix4fv (shaderNode .x3d_ModelViewMatrix, false, context .modelViewMatrix);
|
|
853
|
+
|
|
854
|
+
// Draw
|
|
855
|
+
|
|
856
|
+
context .shapeNode .depth (gl, context, shaderNode);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
shaderNode .disable (gl);
|
|
839
860
|
}
|
|
840
|
-
|
|
841
|
-
shaderNode .disable (gl);
|
|
842
861
|
};
|
|
843
862
|
})(),
|
|
844
863
|
draw: (function ()
|
|
845
864
|
{
|
|
846
|
-
|
|
865
|
+
const
|
|
847
866
|
viewportArray = new Int32Array (4),
|
|
848
867
|
projectionMatrixArray = new Float32Array (16),
|
|
849
868
|
cameraSpaceMatrixArray = new Float32Array (16);
|
|
850
869
|
|
|
851
|
-
return function (
|
|
870
|
+
return function ()
|
|
852
871
|
{
|
|
853
|
-
|
|
872
|
+
const
|
|
854
873
|
browser = this .getBrowser (),
|
|
855
874
|
gl = browser .getContext (),
|
|
856
875
|
viewport = this .getViewVolume () .getViewport (),
|
|
857
876
|
shaders = this .shaders,
|
|
858
877
|
lights = this .lights,
|
|
878
|
+
textureProjectors = this .textureProjectors,
|
|
859
879
|
generatedCubeMapTextures = this .generatedCubeMapTextures;
|
|
860
|
-
|
|
861
|
-
|
|
880
|
+
|
|
881
|
+
|
|
862
882
|
// PREPARATIONS
|
|
863
|
-
|
|
864
|
-
|
|
883
|
+
|
|
884
|
+
|
|
865
885
|
if (this .isIndependent ())
|
|
866
886
|
{
|
|
867
887
|
// Render shadow maps.
|
|
868
|
-
|
|
869
|
-
for (
|
|
870
|
-
|
|
871
|
-
|
|
888
|
+
|
|
889
|
+
for (const light of lights)
|
|
890
|
+
light .renderShadowMap (this);
|
|
891
|
+
|
|
872
892
|
// Render GeneratedCubeMapTextures.
|
|
873
|
-
|
|
874
|
-
for (
|
|
875
|
-
|
|
893
|
+
|
|
894
|
+
for (const generatedCubeMapTexture of generatedCubeMapTextures)
|
|
895
|
+
generatedCubeMapTexture .renderTexture (this);
|
|
876
896
|
}
|
|
877
|
-
|
|
878
|
-
|
|
897
|
+
|
|
898
|
+
|
|
879
899
|
// DRAW
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
// Set shadow matrix for all lights.
|
|
883
|
-
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
// Set up shadow matrix for all lights, and matrix for all projective textures.
|
|
903
|
+
|
|
884
904
|
browser .getHeadlight () .setGlobalVariables (this);
|
|
885
|
-
|
|
886
|
-
for (
|
|
887
|
-
|
|
888
|
-
|
|
905
|
+
|
|
906
|
+
for (const light of lights)
|
|
907
|
+
light .setGlobalVariables (this);
|
|
908
|
+
|
|
909
|
+
for (const textureProjector of textureProjectors)
|
|
910
|
+
textureProjector .setGlobalVariables (this);
|
|
911
|
+
|
|
889
912
|
// Configure viewport and background
|
|
890
|
-
|
|
913
|
+
|
|
891
914
|
gl .viewport (viewport [0],
|
|
892
915
|
viewport [1],
|
|
893
916
|
viewport [2],
|
|
894
917
|
viewport [3]);
|
|
895
|
-
|
|
918
|
+
|
|
896
919
|
gl .scissor (viewport [0],
|
|
897
920
|
viewport [1],
|
|
898
921
|
viewport [2],
|
|
899
|
-
|
|
900
|
-
|
|
922
|
+
viewport [3]);
|
|
923
|
+
|
|
924
|
+
// Draw background.
|
|
925
|
+
|
|
901
926
|
gl .clear (gl .DEPTH_BUFFER_BIT);
|
|
902
|
-
|
|
927
|
+
|
|
903
928
|
this .getBackground () .display (gl, this, viewport);
|
|
904
|
-
|
|
905
|
-
//
|
|
906
|
-
|
|
929
|
+
|
|
930
|
+
// Set global uniforms.
|
|
931
|
+
|
|
907
932
|
viewportArray .set (viewport);
|
|
908
933
|
cameraSpaceMatrixArray .set (this .getCameraSpaceMatrix () .get ());
|
|
909
934
|
projectionMatrixArray .set (this .getProjectionMatrix () .get ());
|
|
910
|
-
|
|
911
|
-
browser .
|
|
912
|
-
browser .
|
|
913
|
-
browser .
|
|
914
|
-
|
|
915
|
-
|
|
935
|
+
|
|
936
|
+
if (browser .hasPointShader ()) shaders .add (browser .getPointShader ());
|
|
937
|
+
if (browser .hasLineShader ()) shaders .add (browser .getLineShader ());
|
|
938
|
+
if (browser .hasUnlitShader ()) shaders .add (browser .getUnlitShader ());
|
|
939
|
+
if (browser .hasShadowShader ()) shaders .add (browser .getShadowShader ());
|
|
940
|
+
shaders .add (browser .getDefaultShader ());
|
|
941
|
+
|
|
942
|
+
shaders .forEach (function (shader)
|
|
943
|
+
{
|
|
916
944
|
shader .setGlobalUniforms (gl, this, cameraSpaceMatrixArray, projectionMatrixArray, viewportArray);
|
|
917
|
-
|
|
945
|
+
},
|
|
946
|
+
this);
|
|
947
|
+
|
|
948
|
+
// Sorted blend
|
|
949
|
+
|
|
918
950
|
// Render opaque objects first
|
|
919
|
-
|
|
951
|
+
|
|
920
952
|
gl .enable (gl .DEPTH_TEST);
|
|
921
953
|
gl .depthMask (true);
|
|
922
954
|
gl .disable (gl .BLEND);
|
|
923
|
-
|
|
924
|
-
|
|
955
|
+
|
|
956
|
+
const opaqueShapes = this .opaqueShapes;
|
|
957
|
+
|
|
958
|
+
for (let i = 0, length = this .numOpaqueShapes; i < length; ++ i)
|
|
925
959
|
{
|
|
926
|
-
|
|
927
|
-
context =
|
|
960
|
+
const
|
|
961
|
+
context = opaqueShapes [i],
|
|
928
962
|
scissor = context .scissor;
|
|
929
|
-
|
|
963
|
+
|
|
930
964
|
gl .scissor (scissor .x,
|
|
931
965
|
scissor .y,
|
|
932
966
|
scissor .z,
|
|
933
967
|
scissor .w);
|
|
934
|
-
|
|
968
|
+
|
|
935
969
|
context .shapeNode .display (gl, context);
|
|
936
970
|
}
|
|
937
|
-
|
|
971
|
+
|
|
938
972
|
// Render transparent objects
|
|
939
|
-
|
|
973
|
+
|
|
940
974
|
gl .depthMask (false);
|
|
941
975
|
gl .enable (gl .BLEND);
|
|
942
|
-
|
|
976
|
+
|
|
977
|
+
const transparentShapes = this .transparentShapes;
|
|
978
|
+
|
|
943
979
|
this .transparencySorter .sort (0, this .numTransparentShapes);
|
|
944
|
-
|
|
945
|
-
for (
|
|
980
|
+
|
|
981
|
+
for (let i = 0, length = this .numTransparentShapes; i < length; ++ i)
|
|
946
982
|
{
|
|
947
|
-
|
|
948
|
-
context =
|
|
983
|
+
const
|
|
984
|
+
context = transparentShapes [i],
|
|
949
985
|
scissor = context .scissor;
|
|
950
|
-
|
|
986
|
+
|
|
951
987
|
gl .scissor (scissor .x,
|
|
952
988
|
scissor .y,
|
|
953
989
|
scissor .z,
|
|
954
990
|
scissor .w);
|
|
955
|
-
|
|
991
|
+
|
|
956
992
|
context .shapeNode .display (gl, context);
|
|
957
993
|
}
|
|
958
|
-
|
|
994
|
+
|
|
959
995
|
gl .depthMask (true);
|
|
960
996
|
gl .disable (gl .BLEND);
|
|
961
|
-
|
|
962
|
-
|
|
997
|
+
|
|
998
|
+
|
|
963
999
|
// POST DRAW
|
|
964
|
-
|
|
965
|
-
|
|
1000
|
+
|
|
1001
|
+
|
|
966
1002
|
gl .activeTexture (gl .TEXTURE0);
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
generatedCubeMapTextures .length = 0;
|
|
971
|
-
shaders .clear ();
|
|
1003
|
+
|
|
1004
|
+
const globalObjects = this .globalObjects;
|
|
972
1005
|
|
|
973
1006
|
if (this .isIndependent ())
|
|
974
1007
|
{
|
|
975
|
-
// Recycle clip planes.
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
for (
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
// Recycle global lights.
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
for (var i = 0, length = lights .length; i < length; ++ i)
|
|
989
|
-
lights [i] .dispose ();
|
|
990
|
-
|
|
991
|
-
// Recycle local lights.
|
|
992
|
-
|
|
993
|
-
var lights = this .getBrowser () .getLocalLights ();
|
|
994
|
-
|
|
995
|
-
for (var i = 0, length = lights .length; i < length; ++ i)
|
|
996
|
-
lights [i] .dispose ();
|
|
997
|
-
|
|
998
|
-
lights .length = 0;
|
|
999
|
-
|
|
1000
|
-
// Recycle local fogs.
|
|
1001
|
-
|
|
1002
|
-
var fogs = this .getBrowser () .getLocalFogs ();
|
|
1003
|
-
|
|
1004
|
-
for (var i = 0, length = fogs .length; i < length; ++ i)
|
|
1005
|
-
fogs [i] .dispose ();
|
|
1006
|
-
|
|
1007
|
-
fogs .length = 0;
|
|
1008
|
+
// Recycle clip planes, local fogs, local lights, and local projective textures.
|
|
1009
|
+
|
|
1010
|
+
const localObjects = browser .getLocalObjects ();
|
|
1011
|
+
|
|
1012
|
+
for (const localObject of localObjects)
|
|
1013
|
+
localObject .dispose ();
|
|
1014
|
+
|
|
1015
|
+
localObjects .length = 0;
|
|
1016
|
+
|
|
1017
|
+
// Recycle global lights and global projective textures.
|
|
1018
|
+
|
|
1019
|
+
for (const globalObject of globalObjects)
|
|
1020
|
+
globalObject .dispose ();
|
|
1008
1021
|
}
|
|
1009
1022
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1023
|
+
// Reset containers.
|
|
1024
|
+
|
|
1025
|
+
shaders .clear ();
|
|
1026
|
+
|
|
1027
|
+
globalObjects .length = 0;
|
|
1028
|
+
lights .length = 0;
|
|
1029
|
+
textureProjectors .length = 0;
|
|
1030
|
+
generatedCubeMapTextures .length = 0;
|
|
1012
1031
|
};
|
|
1013
1032
|
})(),
|
|
1014
1033
|
};
|
|
1015
1034
|
|
|
1035
|
+
function assign (lhs, rhs)
|
|
1036
|
+
{
|
|
1037
|
+
for (var i = 0, length = rhs .length; i < length; ++ i)
|
|
1038
|
+
lhs [i] = rhs [i];
|
|
1039
|
+
|
|
1040
|
+
lhs .length = length;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1016
1043
|
return X3DRenderObject;
|
|
1017
1044
|
});
|