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