x_ite 4.2.17 → 4.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +25 -0
- package/Makefile +27 -10
- package/README.md +13 -145
- package/build/bin/dist.pl +65 -8
- package/build/bin/version-number.pl +25 -0
- package/build/bin/version.pl +54 -14
- package/build/components/annotation.build.js +15 -0
- package/build/components/cad-geometry.build.js +15 -0
- package/build/components/cube-map-texturing.build.js +15 -0
- package/build/components/dis.build.js +15 -0
- package/build/components/event-utilities.build.js +15 -0
- package/build/components/geometry2d.build.js +15 -0
- package/build/components/geospatial.build.js +15 -0
- package/build/components/h-anim.build.js +15 -0
- package/build/components/key-device-sensor.build.js +15 -0
- package/build/components/layout.build.js +15 -0
- package/build/components/nurbs.build.js +15 -0
- package/build/components/particle-systems.build.js +15 -0
- package/build/components/picking.build.js +15 -0
- package/build/components/projective-texture-mapping.build.js +15 -0
- package/build/components/rigid-body-physics.build.js +15 -0
- package/build/components/scripting.build.js +15 -0
- package/build/components/texturing-3d.build.js +15 -0
- package/build/components/volume-rendering.build.js +15 -0
- package/build/components/x_ite.build.js +15 -0
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/x_ite.end.frag.js +25 -0
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +5 -2
- package/dist/{components/texturing-3d.js → assets/components/annotation.js} +341 -263
- package/dist/assets/components/annotation.min.js +1 -0
- package/dist/{components → assets/components}/cad-geometry.js +180 -76
- package/dist/assets/components/cad-geometry.min.js +1 -0
- package/dist/assets/components/cube-map-texturing.js +1222 -0
- package/dist/assets/components/cube-map-texturing.min.js +1 -0
- package/dist/assets/components/dis.js +918 -0
- package/dist/assets/components/dis.min.js +1 -0
- package/dist/assets/components/event-utilities.js +1124 -0
- package/dist/assets/components/event-utilities.min.js +1 -0
- package/dist/assets/components/geometry2d.js +2200 -0
- package/dist/assets/components/geometry2d.min.js +1 -0
- package/dist/{components → assets/components}/geospatial.js +364 -269
- package/dist/assets/components/geospatial.min.js +2 -0
- package/dist/{components → assets/components}/h-anim.js +224 -62
- package/dist/assets/components/h-anim.min.js +1 -0
- package/dist/assets/components/key-device-sensor.js +860 -0
- package/dist/assets/components/key-device-sensor.min.js +1 -0
- package/dist/assets/components/layout.js +2018 -0
- package/dist/assets/components/layout.min.js +1 -0
- package/dist/{components → assets/components}/nurbs.js +632 -348
- package/dist/assets/components/nurbs.min.js +2 -0
- package/dist/{components → assets/components}/particle-systems.js +514 -476
- package/dist/assets/components/particle-systems.min.js +2 -0
- package/dist/assets/components/picking.js +2491 -0
- package/dist/assets/components/picking.min.js +1 -0
- package/dist/assets/components/projective-texture-mapping.js +823 -0
- package/dist/assets/components/projective-texture-mapping.min.js +1 -0
- package/dist/assets/components/rigid-body-physics.js +4579 -0
- package/dist/assets/components/rigid-body-physics.min.js +59 -0
- package/dist/assets/components/scripting.js +816 -0
- package/dist/assets/components/scripting.min.js +1 -0
- package/dist/assets/components/texturing-3d.js +10064 -0
- package/dist/assets/components/texturing-3d.min.js +48 -0
- package/dist/assets/components/volume-rendering.js +3976 -0
- package/dist/assets/components/volume-rendering.min.js +3 -0
- package/dist/assets/components/x_ite.js +295 -0
- package/dist/assets/components/x_ite.min.js +1 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Bold.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-BoldItalic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Italic.ttf +0 -0
- package/{fonts → dist/assets/fonts}/DroidSerif-Regular.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/Ubuntu-RI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-B.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-BI.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-R.ttf +0 -0
- package/{fonts → dist/assets/fonts}/UbuntuMono-RI.ttf +0 -0
- package/dist/assets/hatching/0.png +0 -0
- package/dist/assets/hatching/1.png +0 -0
- package/dist/assets/hatching/10.png +0 -0
- package/dist/assets/hatching/11.png +0 -0
- package/dist/assets/hatching/12.png +0 -0
- package/dist/assets/hatching/13.png +0 -0
- package/dist/assets/hatching/14.png +0 -0
- package/dist/assets/hatching/15.png +0 -0
- package/dist/assets/hatching/16.png +0 -0
- package/dist/assets/hatching/17.png +0 -0
- package/dist/assets/hatching/18.png +0 -0
- package/dist/assets/hatching/19.png +0 -0
- package/dist/assets/hatching/2.png +0 -0
- package/dist/assets/hatching/3.png +0 -0
- package/dist/assets/hatching/4.png +0 -0
- package/dist/assets/hatching/5.png +0 -0
- package/dist/assets/hatching/6.png +0 -0
- package/dist/assets/hatching/7.png +0 -0
- package/dist/assets/hatching/8.png +0 -0
- package/dist/assets/hatching/9.png +0 -0
- package/dist/{images → assets/images}/ExamineViewer.png +0 -0
- package/dist/{images → assets/images}/FlyViewer.png +0 -0
- package/dist/{images → assets/images}/NoneViewer.png +0 -0
- package/dist/{images → assets/images}/PlaneViewer.png +0 -0
- package/dist/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/dist/{images → assets/images}/TextureQuality.png +0 -0
- package/dist/{images → assets/images}/Time.png +0 -0
- package/dist/{images → assets/images}/Viewpoint.png +0 -0
- package/dist/{images → assets/images}/WalkViewer.png +0 -0
- package/dist/assets/images/go-next.png +0 -0
- package/dist/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/dist/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/dist/{images → assets/images}/help-about.png +0 -0
- package/dist/{images → assets/images}/icon.bw.png +0 -0
- package/dist/{images → assets/images}/icon.png +0 -0
- package/dist/assets/images/logo.128.png +0 -0
- package/dist/{images → assets/images}/logo.bw.png +0 -0
- package/dist/{images → assets/images}/logo.png +0 -0
- package/dist/assets/linetype/0.png +0 -0
- package/dist/assets/linetype/1.png +0 -0
- package/dist/assets/linetype/10.png +0 -0
- package/dist/assets/linetype/11.png +0 -0
- package/dist/assets/linetype/12.png +0 -0
- package/dist/assets/linetype/13.png +0 -0
- package/dist/assets/linetype/14.png +0 -0
- package/dist/assets/linetype/15.png +0 -0
- package/dist/assets/linetype/16.png +0 -0
- package/dist/assets/linetype/2.png +0 -0
- package/dist/assets/linetype/3.png +0 -0
- package/dist/assets/linetype/4.png +0 -0
- package/dist/assets/linetype/5.png +0 -0
- package/dist/assets/linetype/6.png +0 -0
- package/dist/assets/linetype/7.png +0 -0
- package/dist/assets/linetype/8.png +0 -0
- package/dist/assets/linetype/9.png +0 -0
- package/dist/assets/shaders/webgl1/Background.fs +23 -0
- package/dist/assets/shaders/webgl1/Background.vs +16 -0
- package/dist/assets/shaders/webgl1/Depth.fs +60 -0
- package/dist/assets/shaders/webgl1/Depth.vs +13 -0
- package/dist/assets/shaders/webgl1/Fallback.fs +28 -0
- package/dist/assets/shaders/webgl1/Fallback.vs +24 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +15 -0
- package/dist/assets/shaders/webgl1/FallbackUnlit.vs +18 -0
- package/dist/assets/shaders/webgl1/Gouraud.fs +529 -0
- package/dist/assets/shaders/webgl1/Gouraud.vs +107 -0
- package/dist/assets/shaders/webgl1/Phong.fs +837 -0
- package/dist/assets/shaders/webgl1/Phong.vs +52 -0
- package/dist/assets/shaders/webgl1/PointSet.fs +541 -0
- package/dist/assets/shaders/webgl1/PointSet.vs +48 -0
- package/dist/assets/shaders/webgl1/Unlit.fs +538 -0
- package/dist/assets/shaders/webgl1/Unlit.vs +52 -0
- package/dist/assets/shaders/webgl1/Wireframe.fs +93 -0
- package/dist/assets/shaders/webgl1/Wireframe.vs +47 -0
- package/dist/assets/shaders/webgl2/Background.fs +25 -0
- package/dist/assets/shaders/webgl2/Background.vs +17 -0
- package/dist/assets/shaders/webgl2/Depth.fs +62 -0
- package/dist/assets/shaders/webgl2/Depth.vs +14 -0
- package/dist/assets/shaders/webgl2/Gouraud.fs +684 -0
- package/dist/assets/shaders/webgl2/Gouraud.vs +108 -0
- package/dist/assets/shaders/webgl2/Phong.fs +1013 -0
- package/dist/assets/shaders/webgl2/Phong.vs +53 -0
- package/dist/assets/shaders/webgl2/PointSet.fs +696 -0
- package/dist/assets/shaders/webgl2/PointSet.vs +49 -0
- package/dist/assets/shaders/webgl2/Unlit.fs +693 -0
- package/dist/assets/shaders/webgl2/Unlit.vs +53 -0
- package/dist/assets/shaders/webgl2/Wireframe.fs +102 -0
- package/dist/assets/shaders/webgl2/Wireframe.vs +48 -0
- package/dist/example.html +8 -7
- package/dist/x_ite.css +167 -49
- package/dist/x_ite.js +66263 -60020
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/404.md +5 -0
- package/docs/Accessing-the-External-Browser.md +319 -0
- package/docs/Browser-Support.md +47 -0
- package/docs/Custom-Shaders.md +896 -0
- package/docs/Features.md +49 -0
- package/docs/Glossary.md +339 -0
- package/docs/How-To-Configure-Your-Web-Server.md +56 -0
- package/docs/Supported-Nodes.md +370 -0
- package/docs/What's-New.md +1295 -0
- package/docs/XHTML-DOM-Integration.md +82 -0
- package/docs/_config.yml +140 -0
- package/docs/_data/navigation.yml +137 -0
- package/docs/assets/css/main.scss +100 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/google3696ee938394d7b6.html +1 -0
- package/docs/index.md +1033 -0
- package/docs/reference/Browser-Services.md +361 -0
- package/docs/reference/Constants-Services.md +376 -0
- package/docs/reference/ECMAScript-Object-and-Function-Definitions.md +128 -0
- package/docs/reference/Field-Services-and-Objects.md +1006 -0
- package/docs/reference/Prototype-Services.md +121 -0
- package/docs/reference/Route-Services.md +49 -0
- package/docs/reference/Scene-Services.md +360 -0
- package/docs/reference/Script-Node-Authoring-Interface.md +342 -0
- package/docs/tutorials/Adding-backgrounds.md +268 -0
- package/docs/tutorials/Adding-fog.md +67 -0
- package/docs/tutorials/Adding-sound.md +326 -0
- package/docs/tutorials/Animating-transforms.md +385 -0
- package/docs/tutorials/Basic-Nodes.md +317 -0
- package/docs/tutorials/Building-a-X3D-world.md +152 -0
- package/docs/tutorials/Building-elevation-grids.md +170 -0
- package/docs/tutorials/Building-extruded-shapes.md +145 -0
- package/docs/tutorials/Building-primitive-shapes.md +204 -0
- package/docs/tutorials/Building-shapes-out-of-points,-lines,-and-faces.md +311 -0
- package/docs/tutorials/Controlling-appearance-with-materials.md +186 -0
- package/docs/tutorials/Controlling-color-on-coordinate-based-geometry.md +208 -0
- package/docs/tutorials/Controlling-detail.md +130 -0
- package/docs/tutorials/Controlling-how-textures-are-mapped.md +277 -0
- package/docs/tutorials/Controlling-navigation.md +70 -0
- package/docs/tutorials/Controlling-shading-on-coordinate-based-geometry.md +180 -0
- package/docs/tutorials/Controlling-the-viewpoint.md +49 -0
- package/docs/tutorials/Creating-new-node-types.md +313 -0
- package/docs/tutorials/Grouping-nodes.md +237 -0
- package/docs/tutorials/Hello,-World!.md +204 -0
- package/docs/tutorials/Improving-Performance.md +227 -0
- package/docs/tutorials/Increasing-Rendering-Speed.md +110 -0
- package/docs/tutorials/Introducing-X3D.md +94 -0
- package/docs/tutorials/Introducing-animation.md +211 -0
- package/docs/tutorials/Introducing-script-use.md +127 -0
- package/docs/tutorials/Lighting-your-world.md +139 -0
- package/docs/tutorials/Mapping-textures.md +212 -0
- package/docs/tutorials/Naming-nodes.md +161 -0
- package/docs/tutorials/Providing-information-about-your-world.md +30 -0
- package/docs/tutorials/Sensing-the-viewer.md +205 -0
- package/docs/tutorials/Sensing-viewer-actions.md +214 -0
- package/docs/tutorials/Transforming-Shapes.md +270 -0
- package/docs/tutorials/Writing-program-scripts-with-ECMAScript.md +631 -0
- package/docs/tutorials/index.md +78 -0
- package/meta/logo/logo.png +0 -0
- package/meta/logo/logo.svg +216 -217
- package/meta/web3d.html +3 -3
- package/package.json +43 -28
- package/src/assets/components/annotation.js +87 -0
- package/src/{components → assets/components}/cad-geometry.js +0 -0
- package/src/{x_ite/Components/CubeMapTexturing.js → assets/components/cube-map-texturing.js} +15 -21
- package/src/assets/components/dis.js +84 -0
- package/src/{x_ite/Components/EventUtilities.js → assets/components/event-utilities.js} +20 -26
- package/src/{x_ite/Components/Geometry2D.js → assets/components/geometry2d.js} +22 -25
- package/src/{components → assets/components}/geospatial.js +0 -0
- package/src/{components → assets/components}/h-anim.js +9 -7
- package/src/{x_ite/Components/KeyDeviceSensor.js → assets/components/key-device-sensor.js} +17 -20
- package/src/{x_ite/Components/Layout.js → assets/components/layout.js} +20 -23
- package/src/{components → assets/components}/nurbs.js +0 -0
- package/src/{components → assets/components}/particle-systems.js +1 -1
- package/src/assets/components/picking.js +87 -0
- package/src/assets/components/projective-texture-mapping.js +75 -0
- package/src/{components → assets/components}/rigid-body-physics.js +7 -2
- package/src/{x_ite/Components/Scripting.js → assets/components/scripting.js} +13 -19
- package/src/{components → assets/components}/texturing-3d.js +12 -13
- package/src/assets/components/volume-rendering.js +118 -0
- package/src/{x_ite/Components/X_ITE.js → assets/components/x_ite.js} +12 -30
- package/src/assets/fonts/DroidSerif-Bold.ttf +0 -0
- package/src/assets/fonts/DroidSerif-BoldItalic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Italic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Regular.ttf +0 -0
- package/src/assets/fonts/Ubuntu-B.ttf +0 -0
- package/src/assets/fonts/Ubuntu-BI.ttf +0 -0
- package/src/assets/fonts/Ubuntu-R.ttf +0 -0
- package/src/assets/fonts/Ubuntu-RI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-B.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-BI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-R.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-RI.ttf +0 -0
- package/src/assets/hatching/0.png +0 -0
- package/src/assets/hatching/1.png +0 -0
- package/src/assets/hatching/10.png +0 -0
- package/src/assets/hatching/11.png +0 -0
- package/src/assets/hatching/12.png +0 -0
- package/src/assets/hatching/13.png +0 -0
- package/src/assets/hatching/14.png +0 -0
- package/src/assets/hatching/15.png +0 -0
- package/src/assets/hatching/16.png +0 -0
- package/src/assets/hatching/17.png +0 -0
- package/src/assets/hatching/18.png +0 -0
- package/src/assets/hatching/19.png +0 -0
- package/src/assets/hatching/2.png +0 -0
- package/src/assets/hatching/3.png +0 -0
- package/src/assets/hatching/4.png +0 -0
- package/src/assets/hatching/5.png +0 -0
- package/src/assets/hatching/6.png +0 -0
- package/src/assets/hatching/7.png +0 -0
- package/src/assets/hatching/8.png +0 -0
- package/src/assets/hatching/9.png +0 -0
- package/src/{images → assets/images}/ExamineViewer.png +0 -0
- package/src/{images → assets/images}/FlyViewer.png +0 -0
- package/src/{images → assets/images}/NoneViewer.png +0 -0
- package/src/{images → assets/images}/PlaneViewer.png +0 -0
- package/src/{images → assets/images}/PrimitiveQuality.png +0 -0
- package/src/{images → assets/images}/TextureQuality.png +0 -0
- package/src/{images → assets/images}/Time.png +0 -0
- package/src/{images → assets/images}/Viewpoint.png +0 -0
- package/src/{images → assets/images}/WalkViewer.png +0 -0
- package/src/assets/images/go-next.png +0 -0
- package/src/{images → assets/images}/gtk-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-leave-fullscreen.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-fit.png +0 -0
- package/src/{images → assets/images}/gtk-zoom-in.png +0 -0
- package/src/{images → assets/images}/help-about.png +0 -0
- package/src/{images → assets/images}/icon.bw.png +0 -0
- package/src/{images → assets/images}/icon.png +0 -0
- package/src/assets/images/logo.128.png +0 -0
- package/src/{images → assets/images}/logo.bw.png +0 -0
- package/src/{images → assets/images}/logo.png +0 -0
- package/src/assets/linetype/0.png +0 -0
- package/src/assets/linetype/1.png +0 -0
- package/src/assets/linetype/10.png +0 -0
- package/src/assets/linetype/11.png +0 -0
- package/src/assets/linetype/12.png +0 -0
- package/src/assets/linetype/13.png +0 -0
- package/src/assets/linetype/14.png +0 -0
- package/src/assets/linetype/15.png +0 -0
- package/src/assets/linetype/16.png +0 -0
- package/src/assets/linetype/2.png +0 -0
- package/src/assets/linetype/3.png +0 -0
- package/src/assets/linetype/4.png +0 -0
- package/src/assets/linetype/5.png +0 -0
- package/src/assets/linetype/6.png +0 -0
- package/src/assets/linetype/7.png +0 -0
- package/src/assets/linetype/8.png +0 -0
- package/src/assets/linetype/9.png +0 -0
- package/src/assets/shaders/Types.glsl +102 -0
- package/src/assets/shaders/webgl1/Background.fs +16 -0
- package/src/assets/shaders/webgl1/Background.vs +22 -0
- package/src/assets/shaders/webgl1/Depth.fs +16 -0
- package/src/assets/shaders/webgl1/Depth.vs +20 -0
- package/src/assets/shaders/webgl1/Fallback.fs +38 -0
- package/src/assets/shaders/webgl1/Fallback.vs +30 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +21 -0
- package/src/assets/shaders/webgl1/FallbackUnlit.vs +24 -0
- package/src/assets/shaders/webgl1/Gouraud.fs +66 -0
- package/src/assets/shaders/webgl1/Gouraud.vs +147 -0
- package/src/assets/shaders/webgl1/Phong.fs +172 -0
- package/src/assets/shaders/webgl1/Phong.vs +67 -0
- package/src/assets/shaders/webgl1/PointSet.fs +100 -0
- package/src/assets/shaders/webgl1/PointSet.vs +70 -0
- package/src/assets/shaders/webgl1/Unlit.fs +86 -0
- package/src/assets/shaders/webgl1/Unlit.vs +67 -0
- package/src/assets/shaders/webgl1/Wireframe.fs +74 -0
- package/src/assets/shaders/webgl1/Wireframe.vs +63 -0
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl1/include/Fog.glsl +38 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl +18 -0
- package/src/{x_ite/Browser/Shaders/Include/Pack.h → assets/shaders/webgl1/include/Pack.glsl} +0 -1
- package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
- package/src/{x_ite/Browser/Shaders/Include/Shadow.h → assets/shaders/webgl1/include/Shadow.glsl} +33 -33
- package/src/assets/shaders/webgl1/include/Texture.glsl +488 -0
- package/src/assets/shaders/webgl2/Background.fs +19 -0
- package/src/assets/shaders/webgl2/Background.vs +23 -0
- package/src/assets/shaders/webgl2/Depth.fs +19 -0
- package/src/assets/shaders/webgl2/Depth.vs +21 -0
- package/src/assets/shaders/webgl2/Gouraud.fs +64 -0
- package/src/assets/shaders/webgl2/Gouraud.vs +148 -0
- package/src/assets/shaders/webgl2/Phong.fs +170 -0
- package/src/assets/shaders/webgl2/Phong.vs +68 -0
- package/src/assets/shaders/webgl2/PointSet.fs +99 -0
- package/src/assets/shaders/webgl2/PointSet.vs +71 -0
- package/src/assets/shaders/webgl2/Unlit.fs +85 -0
- package/src/assets/shaders/webgl2/Unlit.vs +68 -0
- package/src/assets/shaders/webgl2/Wireframe.fs +73 -0
- package/src/assets/shaders/webgl2/Wireframe.vs +64 -0
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl +16 -0
- package/src/assets/shaders/webgl2/include/Fog.glsl +46 -0
- package/src/assets/shaders/webgl2/include/Hatch.glsl +18 -0
- package/src/assets/shaders/webgl2/include/Pack.glsl +51 -0
- package/src/assets/shaders/webgl2/include/Perlin.glsl +40 -0
- package/src/assets/shaders/webgl2/include/Shadow.glsl +324 -0
- package/src/assets/shaders/webgl2/include/Texture.glsl +623 -0
- package/src/bookmarks.js +33 -12
- package/src/dummy.js +1 -0
- package/src/example.html +8 -7
- package/src/examples.js +21 -3
- package/src/lib/ammojs/AmmoJS.js +58 -0
- package/src/lib/ammojs/Makefile +4 -0
- package/src/lib/ammojs/ammo.idl +72 -1
- package/src/lib/ammojs/ammo.js +25 -21
- package/src/lib/jpeg/jpeg.js +1019 -0
- package/src/lib/nurbs/extras/sample.js +137 -80
- package/src/locale/de.po +18 -73
- package/src/locale/fr.po +18 -74
- package/src/spinner.css +18 -6
- package/src/standard/Geospatial/Geodetic.js +43 -43
- package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
- package/src/standard/Geospatial/UniversalTransverseMercator.js +42 -42
- package/src/standard/Math/Algorithm.js +22 -39
- package/src/standard/Math/Algorithms/Bezier.js +147 -0
- package/src/standard/Math/Algorithms/MergeSort.js +2 -2
- package/src/standard/Math/Algorithms/PartialSort.js +6 -6
- package/src/standard/Math/Algorithms/QuickSort.js +8 -6
- package/src/standard/Math/Algorithms/SAT.js +4 -8
- package/src/standard/Math/Algorithms/eigendecomposition.js +37 -33
- package/src/standard/Math/Geometry/Box2.js +84 -56
- package/src/standard/Math/Geometry/Box3.js +400 -358
- package/src/standard/Math/Geometry/Camera.js +19 -16
- package/src/standard/Math/Geometry/Cylinder3.js +13 -13
- package/src/standard/Math/Geometry/Line3.js +34 -34
- package/src/standard/Math/Geometry/Plane3.js +15 -15
- package/src/standard/Math/Geometry/Sphere3.js +122 -105
- package/src/standard/Math/Geometry/Spheroid3.js +1 -1
- package/src/standard/Math/Geometry/Triangle2.js +5 -5
- package/src/standard/Math/Geometry/Triangle3.js +12 -14
- package/src/standard/Math/Geometry/ViewVolume.js +303 -106
- package/src/standard/Math/Numbers/Color3.js +26 -23
- package/src/standard/Math/Numbers/Color4.js +9 -9
- package/src/standard/Math/Numbers/Complex.js +13 -17
- package/src/standard/Math/Numbers/Matrix2.js +20 -13
- package/src/standard/Math/Numbers/Matrix3.js +129 -205
- package/src/standard/Math/Numbers/Matrix4.js +136 -257
- package/src/standard/Math/Numbers/Quaternion.js +49 -138
- package/src/standard/Math/Numbers/Rotation4.js +42 -55
- package/src/standard/Math/Numbers/Vector2.js +32 -115
- package/src/standard/Math/Numbers/Vector3.js +46 -151
- package/src/standard/Math/Numbers/Vector4.js +44 -163
- package/src/standard/Math/Utility/BVH.js +21 -20
- package/src/standard/Math/Utility/MatrixStack.js +4 -4
- package/src/standard/Networking/BinaryTransport.js +8 -8
- package/src/standard/Time/MicroTime.js +81 -0
- package/src/standard/Utility/DataStorage.js +11 -14
- package/src/standard/Utility/MapUtilities.js +69 -0
- package/src/standard/Utility/ObjectCache.js +2 -3
- package/src/standard/Utility/Shuffle.js +5 -6
- package/src/tests.js +84 -5
- package/src/x_ite/Base/Events.js +9 -10
- package/src/x_ite/Base/X3DChildObject.js +20 -16
- package/src/x_ite/Base/X3DEventObject.js +3 -7
- package/src/x_ite/Base/X3DObject.js +44 -27
- package/src/x_ite/Basic/FieldDefinitionArray.js +11 -4
- package/src/x_ite/Basic/X3DBaseNode.js +427 -246
- package/src/x_ite/Basic/X3DField.js +48 -69
- package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
- package/src/x_ite/Basic/X3DObjectArrayField.js +102 -108
- package/src/x_ite/Basic/X3DTypedArrayField.js +194 -163
- package/src/x_ite/Bits/TraverseType.js +2 -5
- package/src/x_ite/Bits/X3DConstants.js +11 -2
- package/src/x_ite/Browser/Core/BrowserOptions.js +89 -68
- package/src/x_ite/Browser/Core/BrowserTimings.js +21 -29
- package/src/x_ite/Browser/Core/ContextMenu.js +139 -60
- package/src/x_ite/Browser/Core/Notification.js +3 -3
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
- package/src/x_ite/Browser/Core/Shading.js +3 -7
- package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
- package/src/x_ite/Browser/Core/X3DCoreContext.js +398 -58
- package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -28
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +5 -14
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +81 -28
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +53 -44
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +8 -9
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +98 -0
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +14 -206
- package/src/x_ite/Browser/Layout/ScreenText.js +226 -254
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +13 -11
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +15 -9
- package/src/x_ite/Browser/NURBS/NURBS.js +84 -72
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +125 -83
- package/src/x_ite/Browser/Navigation/FlyViewer.js +14 -9
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +60 -40
- package/src/x_ite/Browser/Navigation/NoneViewer.js +12 -1
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +39 -20
- package/src/x_ite/Browser/Navigation/WalkViewer.js +21 -6
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +110 -85
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +11 -6
- package/src/x_ite/Browser/Navigation/X3DViewer.js +73 -48
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -24
- package/src/x_ite/Browser/Networking/urls.js +31 -16
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +5 -6
- package/src/x_ite/Browser/Picking/IntersectionType.js +63 -0
- package/src/x_ite/Browser/Picking/MatchCriterion.js +64 -0
- package/src/x_ite/Browser/Picking/SortOrder.js +65 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +197 -0
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +130 -0
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +26 -20
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -10
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +38 -27
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
- package/src/x_ite/Browser/Shaders/Shader.js +112 -92
- package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
- package/src/x_ite/Browser/Shaders/ShaderTest.js +92 -77
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +134 -74
- package/src/x_ite/Browser/Shape/AlphaMode.js +65 -0
- package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +108 -4
- package/src/x_ite/Browser/Text/PolygonText.js +153 -170
- package/src/x_ite/Browser/Text/TextAlignment.js +3 -7
- package/src/x_ite/Browser/Text/X3DTextContext.js +38 -30
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +49 -74
- package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +64 -0
- package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +81 -0
- package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +65 -0
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +73 -0
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +147 -45
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1126 -0
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +686 -0
- package/src/x_ite/Browser/Time/X3DTimeContext.js +20 -17
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +120 -0
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +28 -0
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +114 -0
- package/src/x_ite/Browser/X3DBrowser.js +282 -224
- package/src/x_ite/Browser/X3DBrowserContext.js +60 -27
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +108 -0
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +101 -0
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +112 -0
- package/src/x_ite/Components/Annotation/IconAnnotation.js +110 -0
- package/src/x_ite/Components/Annotation/TextAnnotation.js +102 -0
- package/src/x_ite/Components/Annotation/URLAnnotation.js +101 -0
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +76 -0
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +4 -4
- package/src/x_ite/Components/CADGeometry/CADFace.js +135 -30
- package/src/x_ite/Components/CADGeometry/CADLayer.js +3 -18
- package/src/x_ite/Components/CADGeometry/CADPart.js +4 -8
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +18 -10
- package/src/x_ite/Components/Core/WorldInfo.js +16 -6
- package/src/x_ite/Components/Core/X3DBindableNode.js +4 -33
- package/src/x_ite/Components/Core/X3DChildNode.js +14 -1
- package/src/x_ite/Components/Core/X3DNode.js +0 -63
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +128 -168
- package/src/x_ite/Components/Core.js +6 -9
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +38 -46
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +31 -30
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +42 -57
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +36 -48
- package/src/x_ite/Components/DIS/EspduTransform.js +12 -6
- package/src/x_ite/Components/DIS/ReceiverPdu.js +12 -6
- package/src/x_ite/Components/DIS/SignalPdu.js +12 -6
- package/src/x_ite/Components/DIS/TransmitterPdu.js +12 -6
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +5 -16
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +55 -3
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +3 -5
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +116 -116
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +5 -6
- package/src/x_ite/Components/EnvironmentalEffects.js +6 -9
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +116 -117
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +169 -49
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +31 -27
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +12 -5
- package/src/x_ite/Components/EnvironmentalSensor.js +6 -9
- package/src/x_ite/Components/Followers/ColorChaser.js +1 -3
- package/src/x_ite/Components/Followers/ColorDamper.js +1 -3
- package/src/x_ite/Components/Followers/CoordinateChaser.js +1 -7
- package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -6
- package/src/x_ite/Components/Followers/OrientationChaser.js +7 -3
- package/src/x_ite/Components/Followers/OrientationDamper.js +7 -3
- package/src/x_ite/Components/Followers/PositionChaser.js +1 -3
- package/src/x_ite/Components/Followers/PositionChaser2D.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper.js +1 -3
- package/src/x_ite/Components/Followers/PositionDamper2D.js +1 -3
- package/src/x_ite/Components/Followers/ScalarChaser.js +1 -3
- package/src/x_ite/Components/Followers/ScalarDamper.js +1 -3
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +1 -7
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +1 -7
- package/src/x_ite/Components/Followers/X3DChaserNode.js +20 -18
- package/src/x_ite/Components/Followers/X3DDamperNode.js +5 -7
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +5 -7
- package/src/x_ite/Components/Followers.js +6 -9
- package/src/x_ite/Components/Geometry2D/Arc2D.js +10 -14
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +87 -86
- package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -3
- package/src/x_ite/Components/Geometry2D/Disk2D.js +43 -58
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +4 -8
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +3 -5
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +20 -16
- package/src/x_ite/Components/Geometry3D/Cone.js +1 -3
- package/src/x_ite/Components/Geometry3D/Cylinder.js +3 -5
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +35 -17
- package/src/x_ite/Components/Geometry3D/Extrusion.js +125 -107
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +164 -142
- package/src/x_ite/Components/Geometry3D/Sphere.js +3 -5
- package/src/x_ite/Components/Geometry3D.js +6 -9
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
- package/src/x_ite/Components/Geospatial/GeoLOD.js +207 -124
- package/src/x_ite/Components/Geospatial/GeoLocation.js +6 -6
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +5 -3
- package/src/x_ite/Components/Geospatial/GeoTransform.js +9 -9
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +27 -27
- package/src/x_ite/Components/Grouping/Group.js +3 -3
- package/src/x_ite/Components/Grouping/StaticGroup.js +49 -56
- package/src/x_ite/Components/Grouping/Switch.js +171 -21
- package/src/x_ite/Components/Grouping/Transform.js +3 -3
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +68 -15
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +339 -180
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +51 -25
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +2 -4
- package/src/x_ite/Components/Grouping.js +6 -9
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +4 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimHumanoid.js +24 -14
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +44 -20
- package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +6 -4
- package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +4 -4
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +8 -7
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +4 -3
- package/src/x_ite/Components/Interpolation.js +6 -9
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +1 -3
- package/src/x_ite/Components/Layering/Layer.js +12 -2
- package/src/x_ite/Components/Layering/LayerSet.js +4 -6
- package/src/x_ite/Components/Layering/Viewport.js +8 -8
- package/src/x_ite/Components/Layering/X3DLayerNode.js +67 -62
- package/src/x_ite/Components/Layering.js +6 -9
- package/src/x_ite/Components/Layout/LayoutGroup.js +18 -15
- package/src/x_ite/Components/Layout/LayoutLayer.js +10 -5
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +12 -14
- package/src/x_ite/Components/Layout/ScreenGroup.js +25 -31
- package/src/x_ite/Components/Lighting/DirectionalLight.js +27 -22
- package/src/x_ite/Components/Lighting/PointLight.js +26 -29
- package/src/x_ite/Components/Lighting/SpotLight.js +29 -24
- package/src/x_ite/Components/Lighting/X3DLightNode.js +85 -66
- package/src/x_ite/Components/Lighting.js +6 -9
- package/src/x_ite/Components/NURBS/Contour2D.js +45 -1
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +53 -25
- package/src/x_ite/Components/NURBS/NurbsCurve.js +21 -24
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +44 -25
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +19 -21
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +18 -20
- package/src/x_ite/Components/NURBS/NurbsSet.js +17 -6
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +2 -2
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +15 -16
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +38 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +116 -43
- package/src/x_ite/Components/Navigation/Billboard.js +12 -11
- package/src/x_ite/Components/Navigation/Collision.js +10 -8
- package/src/x_ite/Components/Navigation/LOD.js +207 -59
- package/src/x_ite/Components/Navigation/NavigationInfo.js +29 -43
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +99 -18
- package/src/x_ite/Components/Navigation/Viewpoint.js +15 -15
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +12 -5
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +137 -148
- package/src/x_ite/Components/Navigation.js +6 -9
- package/src/x_ite/Components/Networking/Anchor.js +22 -24
- package/src/x_ite/Components/Networking/Inline.js +63 -44
- package/src/x_ite/Components/Networking/X3DUrlObject.js +88 -8
- package/src/x_ite/Components/Networking.js +6 -9
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +2 -2
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +215 -199
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +44 -39
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +48 -46
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +121 -117
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +21 -18
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +20 -22
- package/src/x_ite/Components/Picking/LinePickSensor.js +251 -6
- package/src/x_ite/Components/Picking/PickableGroup.js +120 -7
- package/src/x_ite/Components/Picking/PointPickSensor.js +260 -8
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +174 -4
- package/src/x_ite/Components/Picking/VolumePickSensor.js +150 -4
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +377 -4
- package/src/x_ite/Components/Picking/X3DPickableObject.js +21 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +26 -11
- package/src/x_ite/Components/PointingDeviceSensor.js +6 -9
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +282 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +227 -0
- package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +217 -0
- package/src/x_ite/Components/Rendering/ClipPlane.js +8 -10
- package/src/x_ite/Components/Rendering/Color.js +22 -13
- package/src/x_ite/Components/Rendering/ColorRGBA.js +28 -16
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +52 -33
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +17 -14
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +9 -4
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +17 -17
- package/src/x_ite/Components/Rendering/LineSet.js +44 -27
- package/src/x_ite/Components/Rendering/Normal.js +20 -4
- package/src/x_ite/Components/Rendering/PointSet.js +38 -16
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +7 -9
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +6 -8
- package/src/x_ite/Components/Rendering/X3DColorNode.js +16 -1
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +80 -55
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +11 -13
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +622 -477
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +159 -90
- package/src/x_ite/Components/Rendering.js +6 -9
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +142 -26
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +312 -128
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +91 -7
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +189 -4
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +82 -4
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +49 -37
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +45 -39
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +41 -34
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +25 -20
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +8 -10
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +15 -16
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +2 -4
- package/src/x_ite/Components/Scripting/Script.js +147 -101
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +2 -4
- package/src/x_ite/Components/Shaders/ComposedShader.js +17 -19
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +9 -3
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -3
- package/src/x_ite/Components/Shaders/PackagedShader.js +18 -14
- package/src/x_ite/Components/Shaders/ShaderPart.js +30 -18
- package/src/x_ite/Components/Shaders/ShaderProgram.js +15 -11
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +681 -558
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +48 -12
- package/src/x_ite/Components/Shaders.js +15 -18
- package/src/x_ite/Components/Shape/Appearance.js +153 -77
- package/src/x_ite/Components/Shape/FillProperties.js +63 -4
- package/src/x_ite/Components/Shape/LineProperties.js +27 -5
- package/src/x_ite/Components/Shape/Material.js +48 -62
- package/src/x_ite/Components/Shape/PointProperties.js +162 -0
- package/src/x_ite/Components/Shape/Shape.js +86 -39
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +53 -59
- package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +9 -6
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +16 -3
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
- package/src/x_ite/Components/Shape/X3DShapeNode.js +41 -17
- package/src/x_ite/Components/Shape.js +22 -16
- package/src/x_ite/Components/Sound/AudioClip.js +36 -50
- package/src/x_ite/Components/Sound/Sound.js +36 -36
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +18 -6
- package/src/x_ite/Components/Sound.js +6 -9
- package/src/x_ite/Components/Text/FontStyle.js +10 -12
- package/src/x_ite/Components/Text/Text.js +6 -6
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +56 -87
- package/src/x_ite/Components/Text.js +6 -9
- package/src/x_ite/Components/Texturing/ImageTexture.js +48 -63
- package/src/x_ite/Components/Texturing/MovieTexture.js +42 -56
- package/src/x_ite/Components/Texturing/MultiTexture.js +236 -11
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +73 -6
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +45 -4
- package/src/x_ite/Components/Texturing/PixelTexture.js +45 -11
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +32 -17
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +68 -8
- package/src/x_ite/Components/Texturing/TextureProperties.js +96 -65
- package/src/x_ite/Components/Texturing/TextureTransform.js +55 -47
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +91 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +183 -0
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +77 -0
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +42 -95
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +3 -17
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +6 -67
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +4 -11
- package/src/x_ite/Components/Texturing.js +31 -25
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +88 -4
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +105 -13
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +124 -4
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +35 -18
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +41 -31
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +18 -11
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -6
- package/src/x_ite/Components/Time/TimeSensor.js +23 -19
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +11 -7
- package/src/x_ite/Components/Time.js +6 -9
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +309 -8
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +58 -4
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +217 -6
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +132 -3
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +86 -5
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +309 -11
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +85 -3
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +134 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +222 -9
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +191 -8
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +85 -6
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +95 -5
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +153 -8
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -3
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +62 -0
- package/src/x_ite/Components/X_ITE/BlendMode.js +51 -51
- package/src/x_ite/Components.js +11 -16
- package/src/x_ite/Configuration/ComponentInfo.js +12 -6
- package/src/x_ite/Configuration/ComponentInfoArray.js +4 -7
- package/src/x_ite/Configuration/ProfileInfo.js +10 -6
- package/src/x_ite/Configuration/SupportedComponents.js +66 -40
- package/src/x_ite/Configuration/SupportedNodes.js +22 -6
- package/src/x_ite/Configuration/SupportedProfiles.js +91 -89
- package/src/x_ite/Configuration/UnitInfo.js +12 -2
- package/src/x_ite/Configuration/X3DInfoArray.js +37 -18
- package/src/x_ite/Execution/BindableList.js +63 -38
- package/src/x_ite/Execution/BindableStack.js +63 -71
- package/src/x_ite/Execution/ExportedNode.js +25 -2
- package/src/x_ite/Execution/ImportedNode.js +122 -39
- package/src/x_ite/Execution/Scene.js +22 -14
- package/src/x_ite/Execution/World.js +22 -19
- package/src/x_ite/Execution/X3DExecutionContext.js +381 -221
- package/src/x_ite/Execution/X3DScene.js +213 -53
- package/src/x_ite/{Error.js → Fallback.js} +26 -29
- package/src/x_ite/Fields/ArrayFields.js +176 -57
- package/src/x_ite/Fields/SFBool.js +6 -5
- package/src/x_ite/Fields/SFColor.js +24 -21
- package/src/x_ite/Fields/SFColorRGBA.js +23 -23
- package/src/x_ite/Fields/SFDouble.js +6 -5
- package/src/x_ite/Fields/SFFloat.js +7 -6
- package/src/x_ite/Fields/SFImage.js +37 -36
- package/src/x_ite/Fields/SFInt32.js +5 -4
- package/src/x_ite/Fields/SFMatrix3.js +19 -15
- package/src/x_ite/Fields/SFMatrix4.js +19 -15
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +10 -2
- package/src/x_ite/Fields/SFNode.js +105 -53
- package/src/x_ite/Fields/SFNodeCache.js +93 -0
- package/src/x_ite/Fields/SFRotation.js +31 -27
- package/src/x_ite/Fields/SFString.js +9 -8
- package/src/x_ite/Fields/SFTime.js +6 -5
- package/src/x_ite/Fields/SFVec2.js +17 -13
- package/src/x_ite/Fields/SFVec3.js +21 -17
- package/src/x_ite/Fields/SFVec4.js +24 -20
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +8 -4
- package/src/x_ite/Fields.js +2 -6
- package/src/x_ite/InputOutput/FileLoader.js +174 -190
- package/src/x_ite/InputOutput/Generator.js +133 -104
- package/src/x_ite/Parser/HTMLSupport.js +3 -596
- package/src/x_ite/Parser/JSONParser.js +348 -245
- package/src/x_ite/Parser/Parser.js +314 -303
- package/src/x_ite/Parser/X3DParser.js +41 -20
- package/src/x_ite/Parser/XMLParser.js +178 -60
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -0
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +104 -44
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +111 -42
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -14
- package/src/x_ite/Rendering/DependentRenderer.js +7 -9
- package/src/x_ite/Rendering/TextureBuffer.js +24 -19
- package/src/x_ite/Rendering/X3DRenderObject.js +455 -428
- package/src/x_ite/Routing/RouteArray.js +34 -11
- package/src/x_ite/Routing/X3DRoute.js +60 -60
- package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
- package/src/x_ite/X3D.js +30 -37
- package/src/x_ite.config.js +40 -5
- package/src/x_ite.css +165 -45
- package/src/x_ite.html +49 -29
- package/src/x_ite.js +86 -25
- package/x_ite.min.html +49 -22
- package/.bzrignore +0 -3
- package/AUTHORS.md +0 -6
- package/STYLE_GUIDE.md +0 -51
- package/X_ITE.sln +0 -54
- package/X_ITE.userprefs +0 -14
- package/build/build.mdproj +0 -47
- package/build/cad-geometry.build.js +0 -15
- package/build/geospatial.build.js +0 -15
- package/build/h-anim.build.js +0 -15
- package/build/nurbs.build.js +0 -15
- package/build/particle-systems.build.js +0 -15
- package/build/parts/cad-geometry.end.frag +0 -2
- package/build/parts/cad-geometry.start.frag +0 -6
- package/build/parts/geospatial.end.frag +0 -2
- package/build/parts/geospatial.start.frag +0 -6
- package/build/parts/h-anim.end.frag +0 -2
- package/build/parts/h-anim.start.frag +0 -6
- package/build/parts/nurbs.end.frag +0 -2
- package/build/parts/nurbs.start.frag +0 -6
- package/build/parts/particle-systems.end.frag +0 -2
- package/build/parts/particle-systems.start.frag +0 -6
- package/build/parts/rigid-body-physics.end.frag +0 -2
- package/build/parts/rigid-body-physics.start.frag +0 -6
- package/build/parts/texturing-3d.end.frag +0 -2
- package/build/parts/texturing-3d.start.frag +0 -6
- package/build/parts/x_ite.end.frag +0 -9
- package/build/parts/x_ite.start.frag +0 -6
- package/build/rigid-body-physics.build.js +0 -15
- package/build/texturing-3d.build.js +0 -15
- package/dist/components/README +0 -3
- package/dist/components/cad-geometry.min.js +0 -1
- package/dist/components/geospatial.min.js +0 -2
- package/dist/components/h-anim.min.js +0 -1
- package/dist/components/nurbs.min.js +0 -2
- package/dist/components/particle-systems.min.js +0 -2
- package/dist/components/rigid-body-physics.js +0 -3761
- package/dist/components/rigid-body-physics.min.js +0 -56
- package/dist/components/texturing-3d.min.js +0 -1
- package/dist/dist.mdproj +0 -61
- package/dist/images/logo.128.png +0 -0
- package/fonts/fonts.mdproj +0 -29
- package/meta/meta.mdproj +0 -35
- package/src/components/cad-geometry.config.js +0 -56
- package/src/components/geospatial.config.js +0 -56
- package/src/components/h-anim.config.js +0 -56
- package/src/components/nurbs.config.js +0 -61
- package/src/components/particle-systems.config.js +0 -56
- package/src/components/rigid-body-physics.config.js +0 -61
- package/src/components/texturing-3d.config.js +0 -56
- package/src/images/logo.128.png +0 -0
- package/src/locale/de.mo +0 -0
- package/src/locale/fr.mo +0 -0
- package/src/src.mdproj +0 -698
- package/src/standard/Networking/URI.js +0 -785
- package/src/test.x3d +0 -225
- package/src/x_ite/Browser/Shaders/Background.fs +0 -31
- package/src/x_ite/Browser/Shaders/Background.vs +0 -23
- package/src/x_ite/Browser/Shaders/Depth.fs +0 -32
- package/src/x_ite/Browser/Shaders/Depth.vs +0 -21
- package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -135
- package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -145
- package/src/x_ite/Browser/Shaders/Phong.fs +0 -269
- package/src/x_ite/Browser/Shaders/Phong.vs +0 -47
- package/src/x_ite/Browser/Shaders/PointSet.fs +0 -86
- package/src/x_ite/Browser/Shaders/Types.h +0 -55
- package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -82
- package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -61
- package/src/x_ite/Components/DIS.js +0 -91
- package/src/x_ite/Components/Picking.js +0 -94
- package/src/x_ite/Components/VolumeRendering.js +0 -121
|
@@ -52,10 +52,8 @@ define ([
|
|
|
52
52
|
"x_ite/Components/Core/X3DNode",
|
|
53
53
|
"x_ite/Bits/X3DConstants",
|
|
54
54
|
"x_ite/Browser/Core/Shading",
|
|
55
|
-
"standard/Math/Numbers/Color3",
|
|
56
55
|
"standard/Math/Numbers/Vector2",
|
|
57
56
|
"standard/Math/Numbers/Vector3",
|
|
58
|
-
"standard/Math/Numbers/Matrix3",
|
|
59
57
|
"standard/Math/Numbers/Matrix4",
|
|
60
58
|
"standard/Math/Geometry/Box3",
|
|
61
59
|
"standard/Math/Geometry/Plane3",
|
|
@@ -66,10 +64,8 @@ function (Fields,
|
|
|
66
64
|
X3DNode,
|
|
67
65
|
X3DConstants,
|
|
68
66
|
Shading,
|
|
69
|
-
Color3,
|
|
70
67
|
Vector2,
|
|
71
68
|
Vector3,
|
|
72
|
-
Matrix3,
|
|
73
69
|
Matrix4,
|
|
74
70
|
Box3,
|
|
75
71
|
Plane3,
|
|
@@ -80,12 +76,6 @@ function (Fields,
|
|
|
80
76
|
|
|
81
77
|
const ARRAY_TYPE = "Array"; // For color, texCoord, normal, and vertex array, can be MFFloat or Array;
|
|
82
78
|
|
|
83
|
-
const
|
|
84
|
-
point = new Vector3 (0, 0, 0),
|
|
85
|
-
clipPoint = new Vector3 (0, 0, 0),
|
|
86
|
-
modelViewMatrix = new Matrix4 (),
|
|
87
|
-
invMatrix = new Matrix4 ();
|
|
88
|
-
|
|
89
79
|
// Box normals for bbox / line intersection.
|
|
90
80
|
const boxNormals = [
|
|
91
81
|
new Vector3 (0, 0, 1), // front
|
|
@@ -101,7 +91,7 @@ function (Fields,
|
|
|
101
91
|
X3DNode .call (this, executionContext);
|
|
102
92
|
|
|
103
93
|
this .addType (X3DConstants .X3DGeometryNode);
|
|
104
|
-
|
|
94
|
+
|
|
105
95
|
this .addChildObjects ("transparent", new Fields .SFBool (),
|
|
106
96
|
"bbox_changed", new Fields .SFTime (),
|
|
107
97
|
"rebuild", new Fields .SFTime ());
|
|
@@ -112,24 +102,24 @@ function (Fields,
|
|
|
112
102
|
|
|
113
103
|
// Members
|
|
114
104
|
|
|
115
|
-
this .min
|
|
116
|
-
this .max
|
|
117
|
-
this .bbox
|
|
118
|
-
this .solid
|
|
119
|
-
this .geometryType
|
|
120
|
-
this .flatShading
|
|
121
|
-
this .colorMaterial
|
|
122
|
-
this .attribNodes
|
|
123
|
-
this .attribs
|
|
124
|
-
this .
|
|
125
|
-
this .
|
|
126
|
-
this .
|
|
127
|
-
this .
|
|
128
|
-
this .colors
|
|
129
|
-
this .normals
|
|
130
|
-
this .flatNormals
|
|
131
|
-
this .vertices
|
|
132
|
-
this .vertexCount
|
|
105
|
+
this .min = new Vector3 (0, 0, 0);
|
|
106
|
+
this .max = new Vector3 (0, 0, 0);
|
|
107
|
+
this .bbox = new Box3 (this .min, this .max, true);
|
|
108
|
+
this .solid = true;
|
|
109
|
+
this .geometryType = 3;
|
|
110
|
+
this .flatShading = undefined;
|
|
111
|
+
this .colorMaterial = false;
|
|
112
|
+
this .attribNodes = [ ];
|
|
113
|
+
this .attribs = [ ];
|
|
114
|
+
this .textureCoordinateNode = this .getBrowser () .getDefaultTextureCoordinate ();
|
|
115
|
+
this .multiTexCoords = [ ];
|
|
116
|
+
this .texCoords = X3DGeometryNode .createArray ();
|
|
117
|
+
this .fogDepths = X3DGeometryNode .createArray ();
|
|
118
|
+
this .colors = X3DGeometryNode .createArray ();
|
|
119
|
+
this .normals = X3DGeometryNode .createArray ();
|
|
120
|
+
this .flatNormals = X3DGeometryNode .createArray ();
|
|
121
|
+
this .vertices = X3DGeometryNode .createArray ();
|
|
122
|
+
this .vertexCount = 0;
|
|
133
123
|
|
|
134
124
|
// This methods are configured in transfer.
|
|
135
125
|
this .depth = Function .prototype;
|
|
@@ -143,15 +133,16 @@ function (Fields,
|
|
|
143
133
|
if (ARRAY_TYPE == "MFFloat")
|
|
144
134
|
return new Fields .MFFloat ();
|
|
145
135
|
|
|
146
|
-
|
|
136
|
+
const array = [ ];
|
|
147
137
|
|
|
148
138
|
array .typedArray = new Float32Array ();
|
|
149
139
|
|
|
150
140
|
array .assign = function (value)
|
|
151
141
|
{
|
|
152
|
-
|
|
142
|
+
for (var i = 0, length = value .length; i < length; ++ i)
|
|
143
|
+
this [i] = value [i];
|
|
153
144
|
|
|
154
|
-
|
|
145
|
+
this .length = length;
|
|
155
146
|
};
|
|
156
147
|
|
|
157
148
|
array .getValue = function ()
|
|
@@ -173,19 +164,10 @@ function (Fields,
|
|
|
173
164
|
X3DGeometryNode .prototype = Object .assign (Object .create (X3DNode .prototype),
|
|
174
165
|
{
|
|
175
166
|
constructor: X3DGeometryNode,
|
|
176
|
-
intersection: new Vector3 (0, 0, 0),
|
|
177
|
-
uvt: { u: 0, v: 0, t: 0 },
|
|
178
|
-
v0: new Vector3 (0, 0, 0),
|
|
179
|
-
v1: new Vector3 (0, 0, 0),
|
|
180
|
-
v2: new Vector3 (0, 0, 0),
|
|
181
|
-
normal: new Vector3 (0, 0, 0),
|
|
182
167
|
setup: function ()
|
|
183
168
|
{
|
|
184
169
|
X3DNode .prototype .setup .call (this);
|
|
185
170
|
|
|
186
|
-
this .addInterest ("requestRebuild", this);
|
|
187
|
-
this .rebuild_ .addInterest ("rebuild", this);
|
|
188
|
-
|
|
189
171
|
this .rebuild ();
|
|
190
172
|
},
|
|
191
173
|
initialize: function ()
|
|
@@ -194,12 +176,16 @@ function (Fields,
|
|
|
194
176
|
|
|
195
177
|
this .isLive () .addInterest ("set_live__", this);
|
|
196
178
|
|
|
197
|
-
|
|
179
|
+
this .addInterest ("requestRebuild", this);
|
|
180
|
+
this .rebuild_ .addInterest ("rebuild", this);
|
|
181
|
+
|
|
182
|
+
const gl = this .getBrowser () .getContext ();
|
|
198
183
|
|
|
199
184
|
this .primitiveMode = gl .TRIANGLES;
|
|
200
185
|
this .frontFace = gl .CCW;
|
|
201
186
|
this .attribBuffers = [ ];
|
|
202
187
|
this .texCoordBuffers = [ ];
|
|
188
|
+
this .fogDepthBuffer = gl .createBuffer ();
|
|
203
189
|
this .colorBuffer = gl .createBuffer ();
|
|
204
190
|
this .normalBuffer = gl .createBuffer ();
|
|
205
191
|
this .vertexBuffer = gl .createBuffer ();
|
|
@@ -207,8 +193,8 @@ function (Fields,
|
|
|
207
193
|
|
|
208
194
|
if (this .geometryType > 1)
|
|
209
195
|
{
|
|
210
|
-
for (
|
|
211
|
-
this .planes [i] = new Plane3 (Vector3 .Zero,
|
|
196
|
+
for (let i = 0; i < 5; ++ i)
|
|
197
|
+
this .planes [i] = new Plane3 (Vector3 .Zero, Vector3 .zAxis);
|
|
212
198
|
}
|
|
213
199
|
|
|
214
200
|
this .set_live__ ();
|
|
@@ -221,6 +207,15 @@ function (Fields,
|
|
|
221
207
|
{
|
|
222
208
|
return this .geometryType;
|
|
223
209
|
},
|
|
210
|
+
setTransparent: function (value)
|
|
211
|
+
{
|
|
212
|
+
if (value !== this .transparent_ .getValue ())
|
|
213
|
+
this .transparent_ = value;
|
|
214
|
+
},
|
|
215
|
+
getTransparent: function ()
|
|
216
|
+
{
|
|
217
|
+
return this .transparent_ .getValue ();
|
|
218
|
+
},
|
|
224
219
|
getBBox: function ()
|
|
225
220
|
{
|
|
226
221
|
// With screen matrix applied.
|
|
@@ -228,17 +223,17 @@ function (Fields,
|
|
|
228
223
|
},
|
|
229
224
|
setBBox: function (bbox)
|
|
230
225
|
{
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
226
|
+
if (bbox .equals (this .bbox))
|
|
227
|
+
return;
|
|
228
|
+
|
|
229
|
+
bbox .getExtents (this .min, this .max);
|
|
230
|
+
|
|
231
|
+
this .bbox .assign (bbox);
|
|
232
|
+
|
|
233
|
+
for (let i = 0; i < 5; ++ i)
|
|
234
|
+
this .planes [i] .set (i % 2 ? this .min : this .max, boxNormals [i]);
|
|
235
|
+
|
|
236
|
+
this .bbox_changed_ .addEvent ();
|
|
242
237
|
},
|
|
243
238
|
getMin: function ()
|
|
244
239
|
{
|
|
@@ -278,6 +273,14 @@ function (Fields,
|
|
|
278
273
|
{
|
|
279
274
|
return this .attribs;
|
|
280
275
|
},
|
|
276
|
+
setFogDepths: function (value)
|
|
277
|
+
{
|
|
278
|
+
this .fogDepths .assign (value);
|
|
279
|
+
},
|
|
280
|
+
getFogDepths: function ()
|
|
281
|
+
{
|
|
282
|
+
return this .fogDepths;
|
|
283
|
+
},
|
|
281
284
|
setColors: function (value)
|
|
282
285
|
{
|
|
283
286
|
this .colors .assign (value);
|
|
@@ -288,11 +291,12 @@ function (Fields,
|
|
|
288
291
|
},
|
|
289
292
|
setMultiTexCoords: function (value)
|
|
290
293
|
{
|
|
291
|
-
|
|
294
|
+
const multiTexCoords = this .multiTexCoords;
|
|
292
295
|
|
|
293
|
-
|
|
296
|
+
for (var i = 0, length = value .length; i < length; ++ i)
|
|
297
|
+
multiTexCoords [i] = value [i];
|
|
294
298
|
|
|
295
|
-
|
|
299
|
+
multiTexCoords .length = length;
|
|
296
300
|
},
|
|
297
301
|
getMultiTexCoords: function ()
|
|
298
302
|
{
|
|
@@ -302,9 +306,12 @@ function (Fields,
|
|
|
302
306
|
{
|
|
303
307
|
return this .texCoords;
|
|
304
308
|
},
|
|
305
|
-
|
|
309
|
+
setTextureCoordinate: function (value)
|
|
306
310
|
{
|
|
307
|
-
|
|
311
|
+
if (value)
|
|
312
|
+
this .textureCoordinateNode = value;
|
|
313
|
+
else
|
|
314
|
+
this .textureCoordinateNode = this .getBrowser () .getDefaultTextureCoordinate ();
|
|
308
315
|
},
|
|
309
316
|
setNormals: function (value)
|
|
310
317
|
{
|
|
@@ -324,101 +331,110 @@ function (Fields,
|
|
|
324
331
|
},
|
|
325
332
|
buildTexCoords: function ()
|
|
326
333
|
{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
Sindex = p .Sindex,
|
|
331
|
-
Tindex = p .Tindex,
|
|
332
|
-
Ssize = p .Ssize,
|
|
333
|
-
S = min [Sindex],
|
|
334
|
-
T = min [Tindex],
|
|
335
|
-
texCoords = this .texCoords,
|
|
336
|
-
vertices = this .vertices .getValue ();
|
|
337
|
-
|
|
338
|
-
for (var i = 0, length = vertices .length; i < length; i += 4)
|
|
334
|
+
const texCoords = this .texCoords;
|
|
335
|
+
|
|
336
|
+
if (texCoords .length === 0)
|
|
339
337
|
{
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
338
|
+
const
|
|
339
|
+
p = this .getTexCoordParams (),
|
|
340
|
+
min = p .min,
|
|
341
|
+
Sindex = p .Sindex,
|
|
342
|
+
Tindex = p .Tindex,
|
|
343
|
+
Ssize = p .Ssize,
|
|
344
|
+
S = min [Sindex],
|
|
345
|
+
T = min [Tindex],
|
|
346
|
+
vertices = this .vertices .getValue ();
|
|
347
|
+
|
|
348
|
+
for (let i = 0, length = vertices .length; i < length; i += 4)
|
|
349
|
+
{
|
|
350
|
+
texCoords .push ((vertices [i + Sindex] - S) / Ssize,
|
|
351
|
+
(vertices [i + Tindex] - T) / Ssize,
|
|
352
|
+
0,
|
|
353
|
+
1);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
texCoords .shrinkToFit ();
|
|
344
357
|
}
|
|
345
358
|
|
|
346
|
-
|
|
359
|
+
return texCoords;
|
|
347
360
|
},
|
|
348
|
-
getTexCoordParams: function ()
|
|
361
|
+
getTexCoordParams: (function ()
|
|
349
362
|
{
|
|
350
|
-
|
|
351
|
-
p = this .texCoordParams,
|
|
352
|
-
bbox = this .getBBox (),
|
|
353
|
-
size = bbox .size,
|
|
354
|
-
Xsize = size .x,
|
|
355
|
-
Ysize = size .y,
|
|
356
|
-
Zsize = size .z;
|
|
357
|
-
|
|
358
|
-
p .min .assign (bbox .center) .subtract (size .divide (2));
|
|
363
|
+
const texCoordParams = { min: new Vector3 (0, 0, 0), Ssize: 0, Sindex: 0, Tindex: 0 };
|
|
359
364
|
|
|
360
|
-
|
|
365
|
+
return function ()
|
|
361
366
|
{
|
|
362
|
-
|
|
363
|
-
|
|
367
|
+
const
|
|
368
|
+
bbox = this .getBBox (),
|
|
369
|
+
size = bbox .size,
|
|
370
|
+
Xsize = size .x,
|
|
371
|
+
Ysize = size .y,
|
|
372
|
+
Zsize = size .z;
|
|
364
373
|
|
|
365
|
-
|
|
366
|
-
p .Tindex = 1;
|
|
367
|
-
else
|
|
368
|
-
p .Tindex = 2;
|
|
369
|
-
}
|
|
370
|
-
else if ((Ysize >= Xsize) && (Ysize >= Zsize))
|
|
371
|
-
{
|
|
372
|
-
// Y size largest
|
|
373
|
-
p .Ssize = Ysize; p .Sindex = 1;
|
|
374
|
+
texCoordParams .min .assign (bbox .center) .subtract (size .divide (2));
|
|
374
375
|
|
|
375
|
-
if (Xsize >= Zsize)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
376
|
+
if ((Xsize >= Ysize) && (Xsize >= Zsize))
|
|
377
|
+
{
|
|
378
|
+
// X size largest
|
|
379
|
+
texCoordParams .Ssize = Xsize; texCoordParams .Sindex = 0;
|
|
380
|
+
|
|
381
|
+
if (Ysize >= Zsize)
|
|
382
|
+
texCoordParams .Tindex = 1;
|
|
383
|
+
else
|
|
384
|
+
texCoordParams .Tindex = 2;
|
|
385
|
+
}
|
|
386
|
+
else if ((Ysize >= Xsize) && (Ysize >= Zsize))
|
|
387
|
+
{
|
|
388
|
+
// Y size largest
|
|
389
|
+
texCoordParams .Ssize = Ysize; texCoordParams .Sindex = 1;
|
|
384
390
|
|
|
385
|
-
|
|
386
|
-
|
|
391
|
+
if (Xsize >= Zsize)
|
|
392
|
+
texCoordParams .Tindex = 0;
|
|
393
|
+
else
|
|
394
|
+
texCoordParams .Tindex = 2;
|
|
395
|
+
}
|
|
387
396
|
else
|
|
388
|
-
|
|
389
|
-
|
|
397
|
+
{
|
|
398
|
+
// Z is the largest
|
|
399
|
+
texCoordParams .Ssize = Zsize; texCoordParams .Sindex = 2;
|
|
390
400
|
|
|
391
|
-
|
|
392
|
-
|
|
401
|
+
if (Xsize >= Ysize)
|
|
402
|
+
texCoordParams .Tindex = 0;
|
|
403
|
+
else
|
|
404
|
+
texCoordParams .Tindex = 1;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return texCoordParams;
|
|
408
|
+
};
|
|
409
|
+
})(),
|
|
393
410
|
refineNormals: function (normalIndex, normals, creaseAngle)
|
|
394
411
|
{
|
|
395
412
|
if (creaseAngle === 0)
|
|
396
413
|
return normals;
|
|
397
414
|
|
|
398
|
-
|
|
415
|
+
const
|
|
399
416
|
cosCreaseAngle = Math .cos (Algorithm .clamp (creaseAngle, 0, Math .PI)),
|
|
400
417
|
normals_ = [ ];
|
|
401
418
|
|
|
402
|
-
for (
|
|
419
|
+
for (const i in normalIndex) // Don't use forEach
|
|
403
420
|
{
|
|
404
|
-
|
|
421
|
+
const vertex = normalIndex [i];
|
|
405
422
|
|
|
406
|
-
for (
|
|
423
|
+
for (const p of vertex)
|
|
407
424
|
{
|
|
408
|
-
|
|
409
|
-
P =
|
|
410
|
-
|
|
411
|
-
n = new Vector3 (0, 0, 0);
|
|
425
|
+
const
|
|
426
|
+
P = normals [p],
|
|
427
|
+
N = new Vector3 (0, 0, 0);
|
|
412
428
|
|
|
413
|
-
for (
|
|
429
|
+
for (const q of vertex)
|
|
414
430
|
{
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (Q .dot (
|
|
418
|
-
|
|
431
|
+
const Q = normals [q];
|
|
432
|
+
|
|
433
|
+
if (Q .dot (P) >= cosCreaseAngle)
|
|
434
|
+
N .add (Q);
|
|
419
435
|
}
|
|
420
436
|
|
|
421
|
-
normals_ [
|
|
437
|
+
normals_ [p] = N .normalize ();
|
|
422
438
|
}
|
|
423
439
|
}
|
|
424
440
|
|
|
@@ -439,182 +455,196 @@ function (Fields,
|
|
|
439
455
|
{
|
|
440
456
|
// Apply sceen nodes transformation in place here.
|
|
441
457
|
},
|
|
442
|
-
intersectsLine: function (
|
|
458
|
+
intersectsLine: (function ()
|
|
443
459
|
{
|
|
444
|
-
|
|
460
|
+
const
|
|
461
|
+
modelViewMatrix = new Matrix4 (),
|
|
462
|
+
uvt = { u: 0, v: 0, t: 0 },
|
|
463
|
+
v0 = new Vector3 (0, 0, 0),
|
|
464
|
+
v1 = new Vector3 (0, 0, 0),
|
|
465
|
+
v2 = new Vector3 (0, 0, 0),
|
|
466
|
+
clipPoint = new Vector3 (0, 0, 0);
|
|
467
|
+
|
|
468
|
+
return function (line, clipPlanes, modelViewMatrix_, intersections)
|
|
445
469
|
{
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
if (this .intersectsBBox (line))
|
|
470
|
+
try
|
|
449
471
|
{
|
|
450
|
-
this .
|
|
451
|
-
this .transformMatrix (modelViewMatrix .assign (modelViewMatrix_)); // Apply screen transformations from screen nodes.
|
|
452
|
-
|
|
453
|
-
var
|
|
454
|
-
texCoords = this .multiTexCoords [0] .getValue (),
|
|
455
|
-
normals = this .normals .getValue (),
|
|
456
|
-
vertices = this .vertices .getValue (),
|
|
457
|
-
uvt = this .uvt,
|
|
458
|
-
v0 = this .v0,
|
|
459
|
-
v1 = this .v1,
|
|
460
|
-
v2 = this .v2;
|
|
461
|
-
|
|
462
|
-
for (var i = 0, length = this .vertexCount; i < length; i += 3)
|
|
472
|
+
if (this .intersectsBBox (line))
|
|
463
473
|
{
|
|
464
|
-
|
|
474
|
+
this .transformLine (line); // Apply screen transformations from screen nodes.
|
|
475
|
+
this .transformMatrix (modelViewMatrix .assign (modelViewMatrix_)); // Apply screen transformations from screen nodes.
|
|
465
476
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
477
|
+
const
|
|
478
|
+
texCoords = this .multiTexCoords [0] .getValue (),
|
|
479
|
+
normals = this .normals .getValue (),
|
|
480
|
+
vertices = this .vertices .getValue ();
|
|
469
481
|
|
|
470
|
-
|
|
482
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
471
483
|
{
|
|
472
|
-
|
|
484
|
+
const i4 = i * 4;
|
|
473
485
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
t = uvt .t;
|
|
486
|
+
v0 .x = vertices [i4]; v0 .y = vertices [i4 + 1]; v0 .z = vertices [i4 + 2];
|
|
487
|
+
v1 .x = vertices [i4 + 4]; v1 .y = vertices [i4 + 5]; v1 .z = vertices [i4 + 6];
|
|
488
|
+
v2 .x = vertices [i4 + 8]; v2 .y = vertices [i4 + 9]; v2 .z = vertices [i4 + 10];
|
|
478
489
|
|
|
479
|
-
|
|
490
|
+
if (line .intersectsTriangle (v0, v1, v2, uvt))
|
|
491
|
+
{
|
|
492
|
+
// Get barycentric coordinates.
|
|
480
493
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
494
|
+
const
|
|
495
|
+
u = uvt .u,
|
|
496
|
+
v = uvt .v,
|
|
497
|
+
t = uvt .t;
|
|
484
498
|
|
|
485
|
-
|
|
486
|
-
continue;
|
|
499
|
+
// Determine vectors for X3DPointingDeviceSensors.
|
|
487
500
|
|
|
488
|
-
|
|
489
|
-
|
|
501
|
+
const point = new Vector3 (t * vertices [i4] + u * vertices [i4 + 4] + v * vertices [i4 + 8],
|
|
502
|
+
t * vertices [i4 + 1] + u * vertices [i4 + 5] + v * vertices [i4 + 9],
|
|
503
|
+
t * vertices [i4 + 2] + u * vertices [i4 + 6] + v * vertices [i4 + 10]);
|
|
490
504
|
|
|
491
|
-
|
|
505
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (point)), clipPlanes))
|
|
506
|
+
continue;
|
|
492
507
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
t * normals [i3 + 2] + u * normals [i3 + 5] + v * normals [i3 + 8]);
|
|
508
|
+
const texCoord = new Vector2 (t * texCoords [i4] + u * texCoords [i4 + 4] + v * texCoords [i4 + 8],
|
|
509
|
+
t * texCoords [i4 + 1] + u * texCoords [i4 + 5] + v * texCoords [i4 + 9]);
|
|
496
510
|
|
|
497
|
-
|
|
498
|
-
|
|
511
|
+
const i3 = i * 3;
|
|
512
|
+
|
|
513
|
+
const normal = new Vector3 (t * normals [i3] + u * normals [i3 + 3] + v * normals [i3 + 6],
|
|
514
|
+
t * normals [i3 + 1] + u * normals [i3 + 4] + v * normals [i3 + 7],
|
|
515
|
+
t * normals [i3 + 2] + u * normals [i3 + 5] + v * normals [i3 + 8]);
|
|
516
|
+
|
|
517
|
+
intersections .push ({ texCoord: texCoord, normal: normal, point: this .getMatrix () .multVecMatrix (point) });
|
|
518
|
+
}
|
|
499
519
|
}
|
|
500
520
|
}
|
|
501
|
-
}
|
|
502
521
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
522
|
+
return intersections .length;
|
|
523
|
+
}
|
|
524
|
+
catch (error)
|
|
525
|
+
{
|
|
526
|
+
console .log (error);
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
})(),
|
|
531
|
+
intersectsBBox: (function ()
|
|
512
532
|
{
|
|
513
|
-
|
|
514
|
-
planes = this .planes,
|
|
515
|
-
min = this .min,
|
|
516
|
-
max = this .max,
|
|
517
|
-
minX = min .x,
|
|
518
|
-
maxX = max .x,
|
|
519
|
-
minY = min .y,
|
|
520
|
-
maxY = max .y,
|
|
521
|
-
minZ = min .z,
|
|
522
|
-
maxZ = max .z,
|
|
523
|
-
intersection = this .intersection;
|
|
524
|
-
|
|
525
|
-
// front
|
|
526
|
-
if (planes [0] .intersectsLine (line, intersection))
|
|
527
|
-
{
|
|
528
|
-
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
529
|
-
intersection .y >= minY && intersection .y <= maxY)
|
|
530
|
-
return true;
|
|
531
|
-
}
|
|
533
|
+
const intersection = new Vector3 (0, 0, 0);
|
|
532
534
|
|
|
533
|
-
|
|
534
|
-
if (planes [1] .intersectsLine (line, intersection))
|
|
535
|
+
return function (line)
|
|
535
536
|
{
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
537
|
+
const
|
|
538
|
+
planes = this .planes,
|
|
539
|
+
min = this .min,
|
|
540
|
+
max = this .max,
|
|
541
|
+
minX = min .x,
|
|
542
|
+
maxX = max .x,
|
|
543
|
+
minY = min .y,
|
|
544
|
+
maxY = max .y,
|
|
545
|
+
minZ = min .z,
|
|
546
|
+
maxZ = max .z;
|
|
547
|
+
|
|
548
|
+
// front
|
|
549
|
+
if (planes [0] .intersectsLine (line, intersection))
|
|
550
|
+
{
|
|
551
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
552
|
+
intersection .y >= minY && intersection .y <= maxY)
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
540
555
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
556
|
+
// back
|
|
557
|
+
if (planes [1] .intersectsLine (line, intersection))
|
|
558
|
+
{
|
|
559
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
560
|
+
intersection .y >= minY && intersection .y <= maxY)
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
548
563
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
564
|
+
// top
|
|
565
|
+
if (planes [2] .intersectsLine (line, intersection))
|
|
566
|
+
{
|
|
567
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
568
|
+
intersection .z >= minZ && intersection .z <= maxZ)
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
556
571
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
572
|
+
// bottom
|
|
573
|
+
if (planes [3] .intersectsLine (line, intersection))
|
|
574
|
+
{
|
|
575
|
+
if (intersection .x >= minX && intersection .x <= maxX &&
|
|
576
|
+
intersection .z >= minZ && intersection .z <= maxZ)
|
|
577
|
+
return true;
|
|
578
|
+
}
|
|
564
579
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
580
|
+
// right
|
|
581
|
+
if (planes [4] .intersectsLine (line, intersection))
|
|
582
|
+
{
|
|
583
|
+
if (intersection .y >= minY && intersection .y <= maxY &&
|
|
584
|
+
intersection .z >= minZ && intersection .z <= maxZ)
|
|
585
|
+
return true;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return false;
|
|
589
|
+
};
|
|
590
|
+
})(),
|
|
591
|
+
intersectsBox: (function ()
|
|
568
592
|
{
|
|
569
|
-
|
|
593
|
+
const
|
|
594
|
+
v0 = new Vector3 (0, 0, 0),
|
|
595
|
+
v1 = new Vector3 (0, 0, 0),
|
|
596
|
+
v2 = new Vector3 (0, 0, 0),
|
|
597
|
+
invMatrix = new Matrix4 (),
|
|
598
|
+
clipPoint = new Vector3 (0, 0, 0);
|
|
599
|
+
|
|
600
|
+
return function (box, clipPlanes, modelViewMatrix)
|
|
570
601
|
{
|
|
571
|
-
|
|
602
|
+
try
|
|
572
603
|
{
|
|
573
|
-
|
|
604
|
+
if (box .intersectsBox (this .bbox))
|
|
605
|
+
{
|
|
606
|
+
box .multRight (invMatrix .assign (this .getMatrix ()) .inverse ());
|
|
574
607
|
|
|
575
|
-
|
|
608
|
+
this .transformMatrix (modelViewMatrix); // Apply screen transformations from screen nodes.
|
|
576
609
|
|
|
577
|
-
|
|
578
|
-
vertices = this .vertices .getValue (),
|
|
579
|
-
v0 = this .v0,
|
|
580
|
-
v1 = this .v1,
|
|
581
|
-
v2 = this .v2;
|
|
582
|
-
|
|
583
|
-
for (var i = 0, length = this .vertexCount; i < length; i += 3)
|
|
584
|
-
{
|
|
585
|
-
var i4 = i * 4;
|
|
586
|
-
|
|
587
|
-
v0 .x = vertices [i4]; v0 .y = vertices [i4 + 1]; v0 .z = vertices [i4 + 2];
|
|
588
|
-
v1 .x = vertices [i4 + 4]; v1 .y = vertices [i4 + 5]; v1 .z = vertices [i4 + 6];
|
|
589
|
-
v2 .x = vertices [i4 + 8]; v2 .y = vertices [i4 + 9]; v2 .z = vertices [i4 + 10];
|
|
610
|
+
const vertices = this .vertices .getValue ();
|
|
590
611
|
|
|
591
|
-
|
|
612
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
592
613
|
{
|
|
593
|
-
|
|
614
|
+
const i4 = i * 4;
|
|
615
|
+
|
|
616
|
+
v0 .x = vertices [i4]; v0 .y = vertices [i4 + 1]; v0 .z = vertices [i4 + 2];
|
|
617
|
+
v1 .x = vertices [i4 + 4]; v1 .y = vertices [i4 + 5]; v1 .z = vertices [i4 + 6];
|
|
618
|
+
v2 .x = vertices [i4 + 8]; v2 .y = vertices [i4 + 9]; v2 .z = vertices [i4 + 10];
|
|
619
|
+
|
|
620
|
+
if (box .intersectsTriangle (v0, v1, v2))
|
|
594
621
|
{
|
|
595
|
-
if (
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
622
|
+
if (clipPlanes .length)
|
|
623
|
+
{
|
|
624
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (v0)), clipPlanes))
|
|
625
|
+
continue;
|
|
626
|
+
|
|
627
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (v1)), clipPlanes))
|
|
628
|
+
continue;
|
|
629
|
+
|
|
630
|
+
if (this .isClipped (modelViewMatrix .multVecMatrix (clipPoint .assign (v2)), clipPlanes))
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
return true;
|
|
603
635
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
609
638
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
639
|
+
return false;
|
|
640
|
+
}
|
|
641
|
+
catch (error)
|
|
642
|
+
{
|
|
643
|
+
console .log (error);
|
|
644
|
+
return false;
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
})(),
|
|
618
648
|
set_live__: function ()
|
|
619
649
|
{
|
|
620
650
|
if (this .isLive () .getValue ())
|
|
@@ -622,132 +652,146 @@ function (Fields,
|
|
|
622
652
|
else
|
|
623
653
|
this .getBrowser () .getBrowserOptions () .Shading_ .removeInterest ("set_shading__", this);
|
|
624
654
|
},
|
|
625
|
-
set_shading__: function (
|
|
655
|
+
set_shading__: (function ()
|
|
626
656
|
{
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
657
|
+
const
|
|
658
|
+
v0 = new Vector3 (0, 0, 0),
|
|
659
|
+
v1 = new Vector3 (0, 0, 0),
|
|
660
|
+
v2 = new Vector3 (0, 0, 0),
|
|
661
|
+
normal = new Vector3 (0, 0, 0);
|
|
631
662
|
|
|
632
|
-
|
|
633
|
-
|
|
663
|
+
return function (shading)
|
|
664
|
+
{
|
|
665
|
+
if (this .geometryType < 2)
|
|
666
|
+
return;
|
|
634
667
|
|
|
635
|
-
|
|
668
|
+
const flatShading = this .getBrowser () .getBrowserOptions () .getShading () === Shading .FLAT;
|
|
636
669
|
|
|
637
|
-
|
|
670
|
+
if (flatShading === this .flatShading)
|
|
671
|
+
return;
|
|
638
672
|
|
|
639
|
-
|
|
673
|
+
this .flatShading = flatShading;
|
|
640
674
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
675
|
+
// Generate flat normals if needed.
|
|
676
|
+
|
|
677
|
+
const gl = this .getBrowser () .getContext ();
|
|
678
|
+
|
|
679
|
+
if (flatShading)
|
|
644
680
|
{
|
|
645
|
-
|
|
646
|
-
cw = this .frontFace === gl .CW,
|
|
647
|
-
flatNormals = this .flatNormals,
|
|
648
|
-
vertices = this .vertices .getValue (),
|
|
649
|
-
v0 = this .v0,
|
|
650
|
-
v1 = this .v1,
|
|
651
|
-
v2 = this .v2,
|
|
652
|
-
normal = this .normal;
|
|
653
|
-
|
|
654
|
-
for (var i = 0, length = vertices .length; i < length; i += 12)
|
|
681
|
+
if (! this .flatNormals .length)
|
|
655
682
|
{
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}
|
|
683
|
+
const
|
|
684
|
+
cw = this .frontFace === gl .CW,
|
|
685
|
+
flatNormals = this .flatNormals,
|
|
686
|
+
vertices = this .vertices .getValue ();
|
|
687
|
+
|
|
688
|
+
for (let i = 0, length = vertices .length; i < length; i += 12)
|
|
689
|
+
{
|
|
690
|
+
Triangle3 .normal (v0 .set (vertices [i], vertices [i + 1], vertices [i + 2]),
|
|
691
|
+
v1 .set (vertices [i + 4], vertices [i + 5], vertices [i + 6]),
|
|
692
|
+
v2 .set (vertices [i + 8], vertices [i + 9], vertices [i + 10]),
|
|
693
|
+
normal);
|
|
668
694
|
|
|
669
|
-
|
|
695
|
+
if (cw)
|
|
696
|
+
normal .negate ();
|
|
697
|
+
|
|
698
|
+
flatNormals .push (normal .x, normal .y, normal .z,
|
|
699
|
+
normal .x, normal .y, normal .z,
|
|
700
|
+
normal .x, normal .y, normal .z);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
flatNormals .shrinkToFit ();
|
|
704
|
+
}
|
|
670
705
|
}
|
|
671
|
-
}
|
|
672
706
|
|
|
673
|
-
|
|
707
|
+
// Transfer normals.
|
|
674
708
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
709
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .normalBuffer);
|
|
710
|
+
gl .bufferData (gl .ARRAY_BUFFER, flatShading ? this .flatNormals .getValue () : this .normals .getValue (), gl .STATIC_DRAW);
|
|
711
|
+
};
|
|
712
|
+
})(),
|
|
678
713
|
requestRebuild: function ()
|
|
679
714
|
{
|
|
680
715
|
this .rebuild_ .addEvent ();
|
|
681
716
|
},
|
|
682
|
-
rebuild: function ()
|
|
717
|
+
rebuild: (function ()
|
|
683
718
|
{
|
|
684
|
-
|
|
685
|
-
this .build ();
|
|
719
|
+
const point = new Vector3 (0, 0, 0);
|
|
686
720
|
|
|
687
|
-
|
|
721
|
+
return function ()
|
|
722
|
+
{
|
|
723
|
+
this .clear ();
|
|
724
|
+
this .build ();
|
|
688
725
|
|
|
689
|
-
|
|
690
|
-
this .attribs [i] .shrinkToFit ();
|
|
726
|
+
// Shrink arrays before transfer to graphics card.
|
|
691
727
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
this .colors .shrinkToFit ();
|
|
696
|
-
this .normals .shrinkToFit ();
|
|
697
|
-
this .vertices .shrinkToFit ();
|
|
728
|
+
for (const attrib of this .attribs)
|
|
729
|
+
attrib .shrinkToFit ();
|
|
698
730
|
|
|
699
|
-
|
|
731
|
+
for (const multiTexCoord of this .multiTexCoords)
|
|
732
|
+
multiTexCoord .shrinkToFit ();
|
|
700
733
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
734
|
+
this .fogDepths .shrinkToFit ();
|
|
735
|
+
this .colors .shrinkToFit ();
|
|
736
|
+
this .normals .shrinkToFit ();
|
|
737
|
+
this .vertices .shrinkToFit ();
|
|
705
738
|
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
739
|
+
// Determine bbox.
|
|
740
|
+
|
|
741
|
+
const
|
|
742
|
+
min = this .min,
|
|
743
|
+
max = this .max,
|
|
744
|
+
vertices = this .vertices .getValue ();
|
|
745
|
+
|
|
746
|
+
if (vertices .length)
|
|
709
747
|
{
|
|
710
|
-
|
|
748
|
+
if (min .x === Number .POSITIVE_INFINITY)
|
|
711
749
|
{
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
750
|
+
for (let i = 0, length = vertices .length; i < length; i += 4)
|
|
751
|
+
{
|
|
752
|
+
point .set (vertices [i], vertices [i + 1], vertices [i + 2]);
|
|
753
|
+
|
|
754
|
+
min .min (point);
|
|
755
|
+
max .max (point);
|
|
756
|
+
}
|
|
716
757
|
}
|
|
758
|
+
|
|
759
|
+
this .bbox .setExtents (min, max);
|
|
760
|
+
}
|
|
761
|
+
else
|
|
762
|
+
{
|
|
763
|
+
this .bbox .setExtents (min .set (0, 0, 0), max .set (0, 0, 0));
|
|
717
764
|
}
|
|
718
765
|
|
|
719
|
-
this .
|
|
720
|
-
}
|
|
721
|
-
else
|
|
722
|
-
{
|
|
723
|
-
this .bbox .setExtents (min .set (0, 0, 0), max .set (0, 0, 0));
|
|
724
|
-
}
|
|
766
|
+
this .bbox_changed_ .addEvent ();
|
|
725
767
|
|
|
726
|
-
|
|
768
|
+
// Generate texCoord if needed.
|
|
727
769
|
|
|
728
|
-
|
|
770
|
+
if (this .geometryType > 1)
|
|
771
|
+
{
|
|
772
|
+
for (let i = 0; i < 5; ++ i)
|
|
773
|
+
this .planes [i] .set (i % 2 ? min : max, boxNormals [i]);
|
|
729
774
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
for (var i = 0; i < 5; ++ i)
|
|
733
|
-
this .planes [i] .set (i % 2 ? min : max, boxNormals [i]);
|
|
775
|
+
if (this .multiTexCoords .length === 0)
|
|
776
|
+
this .multiTexCoords .push (this .buildTexCoords ());
|
|
734
777
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
this .
|
|
738
|
-
|
|
739
|
-
|
|
778
|
+
const last = this .multiTexCoords .length - 1;
|
|
779
|
+
|
|
780
|
+
for (var i = this .multiTexCoords .length, length = this .getBrowser () .getMaxTextures (); i < length; ++ i)
|
|
781
|
+
this .multiTexCoords [i] = this .multiTexCoords [last];
|
|
782
|
+
|
|
783
|
+
this .multiTexCoords .length = length;
|
|
740
784
|
}
|
|
741
|
-
}
|
|
742
785
|
|
|
743
|
-
|
|
786
|
+
// Upload normals or flat normals.
|
|
744
787
|
|
|
745
|
-
|
|
788
|
+
this .set_shading__ (this .getBrowser () .getBrowserOptions () .Shading_);
|
|
746
789
|
|
|
747
|
-
|
|
790
|
+
// Upload arrays.
|
|
748
791
|
|
|
749
|
-
|
|
750
|
-
|
|
792
|
+
this .transfer ();
|
|
793
|
+
};
|
|
794
|
+
})(),
|
|
751
795
|
clear: function ()
|
|
752
796
|
{
|
|
753
797
|
// BBox
|
|
@@ -757,7 +801,7 @@ function (Fields,
|
|
|
757
801
|
|
|
758
802
|
// Create attrib arrays.
|
|
759
803
|
|
|
760
|
-
|
|
804
|
+
const attribs = this .attribs;
|
|
761
805
|
|
|
762
806
|
for (var a = 0, length = attribs .length; a < length; ++ a)
|
|
763
807
|
attribs [a] .length = 0;
|
|
@@ -771,6 +815,7 @@ function (Fields,
|
|
|
771
815
|
|
|
772
816
|
this .flatShading = undefined;
|
|
773
817
|
|
|
818
|
+
this .fogDepths .length = 0;
|
|
774
819
|
this .colors .length = 0;
|
|
775
820
|
this .multiTexCoords .length = 0;
|
|
776
821
|
this .texCoords .length = 0;
|
|
@@ -780,44 +825,43 @@ function (Fields,
|
|
|
780
825
|
},
|
|
781
826
|
transfer: function ()
|
|
782
827
|
{
|
|
783
|
-
|
|
828
|
+
const
|
|
784
829
|
gl = this .getBrowser () .getContext (),
|
|
785
830
|
count = this .vertices .length / 4;
|
|
786
831
|
|
|
787
832
|
// Transfer attribs.
|
|
788
833
|
|
|
789
|
-
for (
|
|
834
|
+
for (let i = this .attribBuffers .length, length = this .attribs .length; i < length; ++ i)
|
|
790
835
|
this .attribBuffers .push (gl .createBuffer ());
|
|
791
836
|
|
|
792
|
-
|
|
793
|
-
//this .attribBuffers .length = length;
|
|
794
|
-
|
|
795
|
-
for (var i = 0, length = this .attribs .length; i < length; ++ i)
|
|
837
|
+
for (let i = 0, length = this .attribs .length; i < length; ++ i)
|
|
796
838
|
{
|
|
797
839
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .attribBuffers [i]);
|
|
798
840
|
gl .bufferData (gl .ARRAY_BUFFER, this .attribs [i] .getValue (), gl .STATIC_DRAW);
|
|
799
841
|
}
|
|
800
842
|
|
|
843
|
+
// Transfer fog depths.
|
|
844
|
+
|
|
845
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .fogDepthBuffer);
|
|
846
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .fogDepths .getValue (), gl .STATIC_DRAW);
|
|
847
|
+
this .fogCoords = !! (this .fogDepths .length);
|
|
848
|
+
// Transfer colors.
|
|
849
|
+
|
|
850
|
+
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
851
|
+
gl .bufferData (gl .ARRAY_BUFFER, this .colors .getValue (), gl .STATIC_DRAW);
|
|
852
|
+
this .colorMaterial = !! (this .colors .length);
|
|
853
|
+
|
|
801
854
|
// Transfer multiTexCoords.
|
|
802
855
|
|
|
803
|
-
for (
|
|
856
|
+
for (let i = this .texCoordBuffers .length, length = this .multiTexCoords .length; i < length; ++ i)
|
|
804
857
|
this .texCoordBuffers .push (gl .createBuffer ());
|
|
805
858
|
|
|
806
|
-
|
|
807
|
-
//this .texCoordBuffers .length = length;
|
|
808
|
-
|
|
809
|
-
for (var i = 0, length = this .multiTexCoords .length; i < length; ++ i)
|
|
859
|
+
for (let i = 0, length = this .multiTexCoords .length; i < length; ++ i)
|
|
810
860
|
{
|
|
811
861
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .texCoordBuffers [i]);
|
|
812
862
|
gl .bufferData (gl .ARRAY_BUFFER, this .multiTexCoords [i] .getValue (), gl .STATIC_DRAW);
|
|
813
863
|
}
|
|
814
864
|
|
|
815
|
-
// Transfer colors.
|
|
816
|
-
|
|
817
|
-
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
818
|
-
gl .bufferData (gl .ARRAY_BUFFER, this .colors .getValue (), gl .STATIC_DRAW);
|
|
819
|
-
this .colorMaterial = Boolean (this .colors .length);
|
|
820
|
-
|
|
821
865
|
// Transfer vertices.
|
|
822
866
|
|
|
823
867
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .vertexBuffer);
|
|
@@ -862,84 +906,136 @@ function (Fields,
|
|
|
862
906
|
{
|
|
863
907
|
try
|
|
864
908
|
{
|
|
865
|
-
|
|
866
|
-
|
|
909
|
+
const
|
|
910
|
+
appearanceNode = context .shapeNode .getAppearance (),
|
|
911
|
+
materialNode = appearanceNode .materialNode,
|
|
912
|
+
backMaterialNode = appearanceNode .backMaterialNode,
|
|
913
|
+
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
914
|
+
|
|
915
|
+
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
916
|
+
{
|
|
917
|
+
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, true, true);
|
|
918
|
+
}
|
|
919
|
+
else
|
|
920
|
+
{
|
|
921
|
+
const backShaderNode = appearanceNode .shaderNode || backMaterialNode .getShader (context .browser, context .shadow)
|
|
922
|
+
|
|
923
|
+
this .displayGeometry (gl, context, appearanceNode, backShaderNode, true, false);
|
|
924
|
+
this .displayGeometry (gl, context, appearanceNode, frontShaderNode, false, true);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
catch (error)
|
|
928
|
+
{
|
|
929
|
+
// Catch error from setLocalUniforms.
|
|
930
|
+
console .log (error);
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
displayGeometry: function (gl, context, appearanceNode, shaderNode, back, front)
|
|
934
|
+
{
|
|
935
|
+
if (shaderNode .getValid ())
|
|
936
|
+
{
|
|
937
|
+
const
|
|
938
|
+
blendModeNode = appearanceNode .blendModeNode,
|
|
867
939
|
attribNodes = this .attribNodes,
|
|
868
940
|
attribBuffers = this .attribBuffers;
|
|
869
941
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
context .geometryType = this .geometryType;
|
|
873
|
-
context .colorMaterial = this .colorMaterial;
|
|
942
|
+
if (blendModeNode)
|
|
943
|
+
blendModeNode .enable (gl);
|
|
874
944
|
|
|
875
945
|
shaderNode .enable (gl);
|
|
876
|
-
shaderNode .setLocalUniforms (gl, context);
|
|
877
|
-
|
|
946
|
+
shaderNode .setLocalUniforms (gl, context, front);
|
|
947
|
+
|
|
878
948
|
// Setup vertex attributes.
|
|
879
|
-
|
|
880
|
-
for (
|
|
949
|
+
|
|
950
|
+
for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
881
951
|
attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
882
|
-
|
|
952
|
+
|
|
953
|
+
if (this .fogCoords)
|
|
954
|
+
shaderNode .enableFogDepthAttribute (gl, this .fogDepthBuffer);
|
|
955
|
+
|
|
883
956
|
if (this .colorMaterial)
|
|
884
957
|
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
885
|
-
|
|
958
|
+
|
|
886
959
|
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
887
960
|
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
888
961
|
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
889
|
-
|
|
962
|
+
|
|
890
963
|
// Draw depending on wireframe, solid and transparent.
|
|
891
|
-
|
|
964
|
+
|
|
892
965
|
if (shaderNode .wireframe)
|
|
893
966
|
{
|
|
894
|
-
//
|
|
967
|
+
// Points and Wireframes.
|
|
895
968
|
|
|
896
|
-
|
|
897
|
-
|
|
969
|
+
if (shaderNode .primitiveMode === gl .POINTS)
|
|
970
|
+
{
|
|
971
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
972
|
+
}
|
|
973
|
+
else
|
|
974
|
+
{
|
|
975
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
976
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
977
|
+
}
|
|
898
978
|
}
|
|
899
979
|
else
|
|
900
980
|
{
|
|
901
|
-
|
|
902
|
-
|
|
981
|
+
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
982
|
+
|
|
903
983
|
gl .frontFace (positiveScale ? this .frontFace : (this .frontFace === gl .CCW ? gl .CW : gl .CCW));
|
|
904
|
-
|
|
905
|
-
if (context .transparent
|
|
984
|
+
|
|
985
|
+
if (context .transparent || back !== front)
|
|
906
986
|
{
|
|
987
|
+
// Render transparent or back or front.
|
|
988
|
+
|
|
907
989
|
gl .enable (gl .CULL_FACE);
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
990
|
+
|
|
991
|
+
// Render back.
|
|
992
|
+
|
|
993
|
+
if (back && !this .solid)
|
|
994
|
+
{
|
|
995
|
+
gl .cullFace (gl .FRONT);
|
|
996
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// Render front.
|
|
1000
|
+
|
|
1001
|
+
if (front)
|
|
1002
|
+
{
|
|
1003
|
+
gl .cullFace (gl .BACK);
|
|
1004
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1005
|
+
}
|
|
913
1006
|
}
|
|
914
1007
|
else
|
|
915
1008
|
{
|
|
1009
|
+
// Render solid or both sides.
|
|
1010
|
+
|
|
916
1011
|
if (this .solid)
|
|
917
1012
|
gl .enable (gl .CULL_FACE);
|
|
918
1013
|
else
|
|
919
1014
|
gl .disable (gl .CULL_FACE);
|
|
920
|
-
|
|
1015
|
+
|
|
921
1016
|
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
922
1017
|
}
|
|
923
1018
|
}
|
|
924
|
-
|
|
925
|
-
for (
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1019
|
+
|
|
1020
|
+
for (const attribNode of attribNodes)
|
|
1021
|
+
attribNode .disable (gl, shaderNode);
|
|
1022
|
+
|
|
1023
|
+
if (this .fogCoords)
|
|
1024
|
+
shaderNode .disableFogDepthAttribute (gl);
|
|
1025
|
+
|
|
1026
|
+
if (this .colorMaterial)
|
|
1027
|
+
shaderNode .disableColorAttribute (gl);
|
|
1028
|
+
|
|
929
1029
|
shaderNode .disableTexCoordAttribute (gl);
|
|
930
1030
|
shaderNode .disableNormalAttribute (gl);
|
|
931
1031
|
shaderNode .disable (gl);
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
// Catch error from setLocalUniforms.
|
|
936
|
-
console .log (error);
|
|
1032
|
+
|
|
1033
|
+
if (blendModeNode)
|
|
1034
|
+
blendModeNode .disable (gl);
|
|
937
1035
|
}
|
|
938
1036
|
},
|
|
939
1037
|
displayParticlesDepth: function (gl, context, shaderNode, particles, numParticles)
|
|
940
1038
|
{
|
|
941
|
-
var gl = context .renderer .getBrowser () .getContext ();
|
|
942
|
-
|
|
943
1039
|
// Attribs in depth rendering are not supported:
|
|
944
1040
|
//for (var i = 0, length = attribNodes .length; i < length; ++ i)
|
|
945
1041
|
// attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
@@ -948,15 +1044,15 @@ function (Fields,
|
|
|
948
1044
|
|
|
949
1045
|
// Draw depending on wireframe, solid and transparent.
|
|
950
1046
|
|
|
951
|
-
|
|
1047
|
+
const
|
|
952
1048
|
modelViewMatrix = context .modelViewMatrix,
|
|
953
1049
|
x = modelViewMatrix [12],
|
|
954
1050
|
y = modelViewMatrix [13],
|
|
955
1051
|
z = modelViewMatrix [14];
|
|
956
1052
|
|
|
957
|
-
for (
|
|
1053
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
958
1054
|
{
|
|
959
|
-
|
|
1055
|
+
const particle = particles [p];
|
|
960
1056
|
|
|
961
1057
|
modelViewMatrix [12] = x;
|
|
962
1058
|
modelViewMatrix [13] = y;
|
|
@@ -964,111 +1060,158 @@ function (Fields,
|
|
|
964
1060
|
|
|
965
1061
|
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
966
1062
|
|
|
967
|
-
shaderNode .setParticle (gl,
|
|
1063
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
968
1064
|
|
|
969
1065
|
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
970
1066
|
}
|
|
971
|
-
|
|
972
|
-
//for (
|
|
1067
|
+
|
|
1068
|
+
//for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
973
1069
|
// attribNodes [i] .disable (gl, shaderNode);
|
|
974
1070
|
},
|
|
975
1071
|
displayParticles: function (gl, context, particles, numParticles)
|
|
976
1072
|
{
|
|
977
1073
|
try
|
|
978
1074
|
{
|
|
979
|
-
|
|
980
|
-
|
|
1075
|
+
const
|
|
1076
|
+
appearanceNode = context .shapeNode .getAppearance (),
|
|
1077
|
+
materialNode = appearanceNode .materialNode,
|
|
1078
|
+
backMaterialNode = appearanceNode .backMaterialNode,
|
|
1079
|
+
frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
|
|
1080
|
+
|
|
1081
|
+
if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
|
|
1082
|
+
{
|
|
1083
|
+
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, true, true, particles, numParticles);
|
|
1084
|
+
}
|
|
1085
|
+
else
|
|
1086
|
+
{
|
|
1087
|
+
const backShaderNode = appearanceNode .shaderNode || backMaterialNode .getShader (context .browser, context .shadow);
|
|
1088
|
+
|
|
1089
|
+
this .displayParticlesGeometry (gl, context, appearanceNode, backShaderNode, true, false, particles, numParticles);
|
|
1090
|
+
this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, false, true, particles, numParticles);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
catch (error)
|
|
1094
|
+
{
|
|
1095
|
+
// Catch error from setLocalUniforms.
|
|
1096
|
+
console .log (error);
|
|
1097
|
+
}
|
|
1098
|
+
},
|
|
1099
|
+
displayParticlesGeometry: function (gl, context, appearanceNode, shaderNode, back, front, particles, numParticles)
|
|
1100
|
+
{
|
|
1101
|
+
if (shaderNode .getValid ())
|
|
1102
|
+
{
|
|
1103
|
+
const
|
|
1104
|
+
blendModeNode = appearanceNode .blendModeNode,
|
|
981
1105
|
attribNodes = this .attribNodes,
|
|
982
1106
|
attribBuffers = this .attribBuffers;
|
|
983
|
-
|
|
1107
|
+
|
|
1108
|
+
if (blendModeNode)
|
|
1109
|
+
blendModeNode .enable (gl);
|
|
1110
|
+
|
|
984
1111
|
// Setup shader.
|
|
985
|
-
|
|
986
|
-
context .geometryType = this .geometryType;
|
|
987
|
-
context .colorMaterial = this .colorMaterial;
|
|
988
1112
|
|
|
989
1113
|
shaderNode .enable (gl);
|
|
990
|
-
shaderNode .setLocalUniforms (gl, context);
|
|
991
|
-
|
|
1114
|
+
shaderNode .setLocalUniforms (gl, context, front);
|
|
1115
|
+
|
|
992
1116
|
// Setup vertex attributes.
|
|
993
|
-
|
|
994
|
-
for (
|
|
1117
|
+
|
|
1118
|
+
for (let i = 0, length = attribNodes .length; i < length; ++ i)
|
|
995
1119
|
attribNodes [i] .enable (gl, shaderNode, attribBuffers [i]);
|
|
996
1120
|
|
|
1121
|
+
if (this .fogCoords)
|
|
1122
|
+
shaderNode .enableFogDepthAttribute (gl, this .fogDepthBuffer);
|
|
1123
|
+
|
|
997
1124
|
if (this .colorMaterial)
|
|
998
1125
|
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
999
|
-
|
|
1126
|
+
|
|
1000
1127
|
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
1001
1128
|
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
1002
1129
|
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
1003
|
-
|
|
1130
|
+
|
|
1004
1131
|
// Draw depending on wireframe, solid and transparent.
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
materialNode = context .materialNode,
|
|
1008
|
-
normalMatrix = materialNode || shaderNode .getCustom (),
|
|
1132
|
+
|
|
1133
|
+
const
|
|
1009
1134
|
modelViewMatrix = context .modelViewMatrix,
|
|
1010
1135
|
x = modelViewMatrix [12],
|
|
1011
1136
|
y = modelViewMatrix [13],
|
|
1012
1137
|
z = modelViewMatrix [14];
|
|
1013
|
-
|
|
1138
|
+
|
|
1014
1139
|
if (shaderNode .wireframe)
|
|
1015
1140
|
{
|
|
1016
|
-
//
|
|
1017
|
-
|
|
1018
|
-
for (
|
|
1141
|
+
// Points and Wireframes.
|
|
1142
|
+
|
|
1143
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1019
1144
|
{
|
|
1020
|
-
|
|
1145
|
+
const particle = particles [p];
|
|
1021
1146
|
|
|
1022
1147
|
modelViewMatrix [12] = x;
|
|
1023
1148
|
modelViewMatrix [13] = y;
|
|
1024
1149
|
modelViewMatrix [14] = z;
|
|
1025
|
-
|
|
1150
|
+
|
|
1026
1151
|
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1027
1152
|
|
|
1028
|
-
shaderNode .setParticle (gl,
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1153
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1154
|
+
|
|
1155
|
+
if (shaderNode .primitiveMode === gl .POINTS)
|
|
1156
|
+
{
|
|
1157
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1158
|
+
}
|
|
1159
|
+
else
|
|
1160
|
+
{
|
|
1161
|
+
for (let i = 0, length = this .vertexCount; i < length; i += 3)
|
|
1162
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
1163
|
+
}
|
|
1032
1164
|
}
|
|
1033
1165
|
}
|
|
1034
1166
|
else
|
|
1035
1167
|
{
|
|
1036
|
-
|
|
1037
|
-
|
|
1168
|
+
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
1169
|
+
|
|
1038
1170
|
gl .frontFace (positiveScale ? this .frontFace : (this .frontFace === gl .CCW ? gl .CW : gl .CCW));
|
|
1039
|
-
|
|
1040
|
-
if (context .transparent
|
|
1171
|
+
|
|
1172
|
+
if (context .transparent || back !== front)
|
|
1041
1173
|
{
|
|
1042
|
-
|
|
1174
|
+
// Render transparent or back or front.
|
|
1175
|
+
|
|
1176
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1043
1177
|
{
|
|
1044
|
-
|
|
1178
|
+
const particle = particles [p];
|
|
1045
1179
|
|
|
1046
1180
|
modelViewMatrix [12] = x;
|
|
1047
1181
|
modelViewMatrix [13] = y;
|
|
1048
1182
|
modelViewMatrix [14] = z;
|
|
1049
|
-
|
|
1183
|
+
|
|
1050
1184
|
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1051
|
-
|
|
1052
|
-
shaderNode .setParticle (gl,
|
|
1185
|
+
|
|
1186
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1053
1187
|
|
|
1054
1188
|
gl .enable (gl .CULL_FACE);
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1189
|
+
|
|
1190
|
+
if (back && !this .solid)
|
|
1191
|
+
{
|
|
1192
|
+
gl .cullFace (gl .FRONT);
|
|
1193
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
if (front)
|
|
1197
|
+
{
|
|
1198
|
+
gl .cullFace (gl .BACK);
|
|
1199
|
+
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1061
1202
|
}
|
|
1062
1203
|
else
|
|
1063
1204
|
{
|
|
1205
|
+
// Render solid or both sides.
|
|
1206
|
+
|
|
1064
1207
|
if (this .solid)
|
|
1065
1208
|
gl .enable (gl .CULL_FACE);
|
|
1066
1209
|
else
|
|
1067
1210
|
gl .disable (gl .CULL_FACE);
|
|
1068
|
-
|
|
1069
|
-
for (
|
|
1211
|
+
|
|
1212
|
+
for (let p = 0; p < numParticles; ++ p)
|
|
1070
1213
|
{
|
|
1071
|
-
|
|
1214
|
+
const particle = particles [p];
|
|
1072
1215
|
|
|
1073
1216
|
modelViewMatrix [12] = x;
|
|
1074
1217
|
modelViewMatrix [13] = y;
|
|
@@ -1076,29 +1219,31 @@ function (Fields,
|
|
|
1076
1219
|
|
|
1077
1220
|
Matrix4 .prototype .translate .call (modelViewMatrix, particle .position);
|
|
1078
1221
|
|
|
1079
|
-
shaderNode .setParticle (gl,
|
|
1222
|
+
shaderNode .setParticle (gl, particle, modelViewMatrix);
|
|
1080
1223
|
|
|
1081
1224
|
gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
|
|
1082
1225
|
}
|
|
1083
1226
|
}
|
|
1084
1227
|
}
|
|
1085
|
-
|
|
1086
|
-
for (
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1228
|
+
|
|
1229
|
+
for (const attribNode of attribNodes)
|
|
1230
|
+
attribNode .disable (gl, shaderNode);
|
|
1231
|
+
|
|
1232
|
+
if (this .fogCoords)
|
|
1233
|
+
shaderNode .disableFogDepthAttribute (gl);
|
|
1234
|
+
|
|
1235
|
+
if (this .colorMaterial)
|
|
1236
|
+
shaderNode .disableColorAttribute (gl);
|
|
1237
|
+
|
|
1090
1238
|
shaderNode .disableTexCoordAttribute (gl);
|
|
1091
1239
|
shaderNode .disableNormalAttribute (gl);
|
|
1092
1240
|
shaderNode .disable (gl);
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
// Catch error from setLocalUniforms.
|
|
1097
|
-
console .log (error);
|
|
1241
|
+
|
|
1242
|
+
if (blendModeNode)
|
|
1243
|
+
blendModeNode .disable (gl);
|
|
1098
1244
|
}
|
|
1099
1245
|
},
|
|
1100
1246
|
});
|
|
1101
1247
|
|
|
1102
1248
|
return X3DGeometryNode;
|
|
1103
1249
|
});
|
|
1104
|
-
|