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
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
(function ()
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
6
12
|
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
7
16
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
17
|
*******************************************************************************
|
|
9
18
|
*
|
|
@@ -63,7 +72,7 @@ define ('x_ite/Components/ParticleSystems/X3DParticleEmitterNode',[
|
|
|
63
72
|
"standard/Math/Algorithm",
|
|
64
73
|
"standard/Math/Algorithms/QuickSort",
|
|
65
74
|
],
|
|
66
|
-
function (X3DNode,
|
|
75
|
+
function (X3DNode,
|
|
67
76
|
X3DConstants,
|
|
68
77
|
Vector3,
|
|
69
78
|
Rotation4,
|
|
@@ -147,7 +156,7 @@ function (X3DNode,
|
|
|
147
156
|
v = particleLifetime * lifetimeVariation,
|
|
148
157
|
min = Math .max (0, particleLifetime - v),
|
|
149
158
|
max = particleLifetime + v;
|
|
150
|
-
|
|
159
|
+
|
|
151
160
|
return Math .random () * (max - min) + min;
|
|
152
161
|
},
|
|
153
162
|
getRandomSpeed: function ()
|
|
@@ -157,7 +166,7 @@ function (X3DNode,
|
|
|
157
166
|
v = speed * this .variation,
|
|
158
167
|
min = Math .max (0, speed - v),
|
|
159
168
|
max = speed + v;
|
|
160
|
-
|
|
169
|
+
|
|
161
170
|
return Math .random () * (max - min) + min;
|
|
162
171
|
},
|
|
163
172
|
getSphericalRandomVelocity: function (velocity)
|
|
@@ -175,7 +184,7 @@ function (X3DNode,
|
|
|
175
184
|
cphi = this .getRandomValue (-1, 1),
|
|
176
185
|
phi = Math .acos (cphi),
|
|
177
186
|
r = Math .sin (phi);
|
|
178
|
-
|
|
187
|
+
|
|
179
188
|
return normal .set (Math .sin (theta) * r,
|
|
180
189
|
Math .cos (theta) * r,
|
|
181
190
|
cphi);
|
|
@@ -187,7 +196,7 @@ function (X3DNode,
|
|
|
187
196
|
cphi = this .getRandomValue (Math .cos (angle), 1),
|
|
188
197
|
phi = Math .acos (cphi),
|
|
189
198
|
r = Math .sin (phi);
|
|
190
|
-
|
|
199
|
+
|
|
191
200
|
return normal .set (Math .sin (theta) * r,
|
|
192
201
|
Math .cos (theta) * r,
|
|
193
202
|
cphi);
|
|
@@ -205,7 +214,7 @@ function (X3DNode,
|
|
|
205
214
|
cphi = Math .pow (Math .random (), 1/3),
|
|
206
215
|
phi = Math .acos (cphi),
|
|
207
216
|
r = Math .sin (phi);
|
|
208
|
-
|
|
217
|
+
|
|
209
218
|
return normal .set (Math .sin (theta) * r,
|
|
210
219
|
Math .cos (theta) * r,
|
|
211
220
|
cphi);
|
|
@@ -237,7 +246,7 @@ function (X3DNode,
|
|
|
237
246
|
var
|
|
238
247
|
particle = particles [i],
|
|
239
248
|
elapsedTime = particle .elapsedTime + deltaTime;
|
|
240
|
-
|
|
249
|
+
|
|
241
250
|
if (elapsedTime > particle .lifetime)
|
|
242
251
|
{
|
|
243
252
|
// Create new particle or hide particle.
|
|
@@ -276,7 +285,7 @@ function (X3DNode,
|
|
|
276
285
|
position .x += velocity .x * deltaTime;
|
|
277
286
|
position .y += velocity .y * deltaTime;
|
|
278
287
|
position .z += velocity .z * deltaTime;
|
|
279
|
-
|
|
288
|
+
|
|
280
289
|
this .bounce (boundedVolume, fromPosition, position, velocity);
|
|
281
290
|
}
|
|
282
291
|
else
|
|
@@ -285,14 +294,14 @@ function (X3DNode,
|
|
|
285
294
|
position .y += velocity .y * deltaTime;
|
|
286
295
|
position .z += velocity .z * deltaTime;
|
|
287
296
|
}
|
|
288
|
-
|
|
297
|
+
|
|
289
298
|
particle .elapsedTime = elapsedTime;
|
|
290
299
|
}
|
|
291
300
|
}
|
|
292
301
|
|
|
293
302
|
// Animate color if needed.
|
|
294
303
|
|
|
295
|
-
if (particleSystem .colorMaterial)
|
|
304
|
+
if (particleSystem .geometryContext .colorMaterial)
|
|
296
305
|
this .getColors (particles, particleSystem .colorKeys, particleSystem .colorRamp, numParticles);
|
|
297
306
|
},
|
|
298
307
|
bounce: function (boundedVolume, fromPosition, toPosition, velocity)
|
|
@@ -300,7 +309,7 @@ function (X3DNode,
|
|
|
300
309
|
normal .assign (velocity) .normalize ();
|
|
301
310
|
|
|
302
311
|
line .set (fromPosition, normal);
|
|
303
|
-
|
|
312
|
+
|
|
304
313
|
var
|
|
305
314
|
intersections = this .intersections,
|
|
306
315
|
intersectionNormals = this .intersectionNormals,
|
|
@@ -312,11 +321,11 @@ function (X3DNode,
|
|
|
312
321
|
intersections [i] .index = i;
|
|
313
322
|
|
|
314
323
|
plane .set (fromPosition, normal);
|
|
315
|
-
|
|
324
|
+
|
|
316
325
|
this .sorter .sort (0, numIntersections);
|
|
317
326
|
|
|
318
327
|
var index = Algorithm .upperBound (intersections, 0, numIntersections, 0, PlaneCompareValue);
|
|
319
|
-
|
|
328
|
+
|
|
320
329
|
if (index < numIntersections)
|
|
321
330
|
{
|
|
322
331
|
var
|
|
@@ -324,7 +333,7 @@ function (X3DNode,
|
|
|
324
333
|
intersectionNormal = intersectionNormals [intersection .index];
|
|
325
334
|
|
|
326
335
|
plane .set (intersection, intersectionNormal);
|
|
327
|
-
|
|
336
|
+
|
|
328
337
|
if (plane .getDistanceToPoint (fromPosition) * plane .getDistanceToPoint (toPosition) < 0)
|
|
329
338
|
{
|
|
330
339
|
var dot2 = 2 * intersectionNormal .dot (velocity);
|
|
@@ -351,7 +360,7 @@ function (X3DNode,
|
|
|
351
360
|
index0 = 0,
|
|
352
361
|
index1 = 0,
|
|
353
362
|
weight = 0;
|
|
354
|
-
|
|
363
|
+
|
|
355
364
|
for (var i = 0; i < numParticles; ++ i)
|
|
356
365
|
{
|
|
357
366
|
// Determine index0, index1 and weight.
|
|
@@ -376,16 +385,16 @@ function (X3DNode,
|
|
|
376
385
|
else
|
|
377
386
|
{
|
|
378
387
|
var index = Algorithm .upperBound (colorKeys, 0, length, fraction, Algorithm .less);
|
|
379
|
-
|
|
388
|
+
|
|
380
389
|
if (index < length)
|
|
381
390
|
{
|
|
382
391
|
index1 = index;
|
|
383
392
|
index0 = index - 1;
|
|
384
|
-
|
|
393
|
+
|
|
385
394
|
var
|
|
386
395
|
key0 = colorKeys [index0],
|
|
387
396
|
key1 = colorKeys [index1];
|
|
388
|
-
|
|
397
|
+
|
|
389
398
|
weight = Algorithm .clamp ((fraction - key0) / (key1 - key0), 0, 1);
|
|
390
399
|
}
|
|
391
400
|
else
|
|
@@ -395,13 +404,13 @@ function (X3DNode,
|
|
|
395
404
|
weight = 0;
|
|
396
405
|
}
|
|
397
406
|
}
|
|
398
|
-
|
|
407
|
+
|
|
399
408
|
// Interpolate and set color.
|
|
400
409
|
|
|
401
410
|
var
|
|
402
411
|
color0 = colorRamp [index0],
|
|
403
412
|
color1 = colorRamp [index1];
|
|
404
|
-
|
|
413
|
+
|
|
405
414
|
// Algorithm .lerp (color0, color1, weight);
|
|
406
415
|
color .x = color0 .x + weight * (color1 .x - color0 .x);
|
|
407
416
|
color .y = color0 .y + weight * (color1 .y - color0 .y);
|
|
@@ -414,8 +423,6 @@ function (X3DNode,
|
|
|
414
423
|
return X3DParticleEmitterNode;
|
|
415
424
|
});
|
|
416
425
|
|
|
417
|
-
|
|
418
|
-
|
|
419
426
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
420
427
|
*******************************************************************************
|
|
421
428
|
*
|
|
@@ -621,18 +628,17 @@ define ('x_ite/Browser/ParticleSystems/X3DParticleSystemsContext',[
|
|
|
621
628
|
function (PointEmitter)
|
|
622
629
|
{
|
|
623
630
|
"use strict";
|
|
624
|
-
|
|
631
|
+
|
|
625
632
|
function X3DParticleSystemsContext () { }
|
|
626
633
|
|
|
627
634
|
X3DParticleSystemsContext .prototype =
|
|
628
635
|
{
|
|
629
636
|
getDefaultEmitter: function ()
|
|
630
637
|
{
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
638
|
+
this .defaultEmitter = new PointEmitter (this .getPrivateScene ());
|
|
639
|
+
this .defaultEmitter .setup ();
|
|
640
|
+
|
|
641
|
+
this .getDefaultEmitter = function () { return this .defaultEmitter; };
|
|
636
642
|
|
|
637
643
|
return this .defaultEmitter;
|
|
638
644
|
},
|
|
@@ -822,12 +828,12 @@ function (Fields,
|
|
|
822
828
|
set_geometry__: function ()
|
|
823
829
|
{
|
|
824
830
|
if (this .geometryNode)
|
|
825
|
-
this .geometryNode .removeInterest ("addNodeEvent", this);
|
|
831
|
+
this .geometryNode .rebuild_ .removeInterest ("addNodeEvent", this);
|
|
826
832
|
|
|
827
833
|
this .geometryNode = X3DCast (X3DConstants .X3DGeometryNode, this .geometry_);
|
|
828
834
|
|
|
829
835
|
if (this .geometryNode)
|
|
830
|
-
this .geometryNode .addInterest ("addNodeEvent", this);
|
|
836
|
+
this .geometryNode .rebuild_ .addInterest ("addNodeEvent", this);
|
|
831
837
|
},
|
|
832
838
|
addGeometry: function (boundedNormals, boundedVertices)
|
|
833
839
|
{
|
|
@@ -1301,14 +1307,14 @@ function (Vector3,
|
|
|
1301
1307
|
{
|
|
1302
1308
|
"use strict";
|
|
1303
1309
|
|
|
1304
|
-
|
|
1310
|
+
const
|
|
1305
1311
|
v0 = new Vector3 (0, 0, 0),
|
|
1306
1312
|
v1 = new Vector3 (0, 0, 0),
|
|
1307
1313
|
v2 = new Vector3 (0, 0, 0),
|
|
1308
1314
|
uvt = { u: 0, v: 0, t: 0 };
|
|
1309
1315
|
|
|
1310
1316
|
// Box normals for bbox / line intersection.
|
|
1311
|
-
|
|
1317
|
+
const boxNormals = [
|
|
1312
1318
|
new Vector3 (0, 0, 1), // front
|
|
1313
1319
|
new Vector3 (0, 0, -1), // back
|
|
1314
1320
|
new Vector3 (0, 1, 0), // top
|
|
@@ -1321,7 +1327,7 @@ function (Vector3,
|
|
|
1321
1327
|
{
|
|
1322
1328
|
function compare (a, b)
|
|
1323
1329
|
{
|
|
1324
|
-
|
|
1330
|
+
const
|
|
1325
1331
|
vertices = compare .vertices;
|
|
1326
1332
|
axis = compare .axis;
|
|
1327
1333
|
|
|
@@ -1347,7 +1353,7 @@ function (Vector3,
|
|
|
1347
1353
|
{
|
|
1348
1354
|
intersectsLine: function (line, intersections, intersectionNormals)
|
|
1349
1355
|
{
|
|
1350
|
-
|
|
1356
|
+
const
|
|
1351
1357
|
vertices = this .vertices,
|
|
1352
1358
|
normals = this .normals,
|
|
1353
1359
|
i4 = this .i4,
|
|
@@ -1361,14 +1367,14 @@ function (Vector3,
|
|
|
1361
1367
|
{
|
|
1362
1368
|
// Get barycentric coordinates.
|
|
1363
1369
|
|
|
1364
|
-
|
|
1370
|
+
const
|
|
1365
1371
|
u = uvt .u,
|
|
1366
1372
|
v = uvt .v,
|
|
1367
1373
|
t = 1 - u - v;
|
|
1368
1374
|
|
|
1369
1375
|
// Determine vectors for X3DPointingDeviceSensors.
|
|
1370
1376
|
|
|
1371
|
-
|
|
1377
|
+
const i = intersections .size ++;
|
|
1372
1378
|
|
|
1373
1379
|
if (i >= intersections .length)
|
|
1374
1380
|
intersections .push (new Vector3 (0, 0, 0));
|
|
@@ -1397,19 +1403,20 @@ function (Vector3,
|
|
|
1397
1403
|
this .planes = [ ];
|
|
1398
1404
|
this .intersection = new Vector3 (0, 0, 0);
|
|
1399
1405
|
|
|
1400
|
-
|
|
1406
|
+
const
|
|
1401
1407
|
vertices = tree .vertices,
|
|
1402
1408
|
min = this .min,
|
|
1403
1409
|
max = this .max,
|
|
1404
|
-
last = first + size
|
|
1405
|
-
|
|
1410
|
+
last = first + size;
|
|
1411
|
+
|
|
1412
|
+
let t = triangles [first] * 12;
|
|
1406
1413
|
|
|
1407
1414
|
// Calculate bbox
|
|
1408
1415
|
|
|
1409
1416
|
min .set (vertices [t], vertices [t + 1], vertices [t + 2]);
|
|
1410
1417
|
max .assign (min);
|
|
1411
1418
|
|
|
1412
|
-
for (
|
|
1419
|
+
for (let i = first; i < last; ++ i)
|
|
1413
1420
|
{
|
|
1414
1421
|
t = triangles [i] * 12;
|
|
1415
1422
|
|
|
@@ -1421,7 +1428,7 @@ function (Vector3,
|
|
|
1421
1428
|
max .max (v0, v1, v2);
|
|
1422
1429
|
}
|
|
1423
1430
|
|
|
1424
|
-
for (
|
|
1431
|
+
for (let i = 0; i < 5; ++ i)
|
|
1425
1432
|
this .planes [i] = new Plane3 (i % 2 ? min : max, boxNormals [i]);
|
|
1426
1433
|
|
|
1427
1434
|
// Sort and split array
|
|
@@ -1442,7 +1449,7 @@ function (Vector3,
|
|
|
1442
1449
|
|
|
1443
1450
|
// Split array
|
|
1444
1451
|
|
|
1445
|
-
|
|
1452
|
+
const rightSize = size - leftSize;
|
|
1446
1453
|
|
|
1447
1454
|
// Construct left and right node
|
|
1448
1455
|
|
|
@@ -1469,7 +1476,7 @@ function (Vector3,
|
|
|
1469
1476
|
},
|
|
1470
1477
|
intersectsBBox: function (line)
|
|
1471
1478
|
{
|
|
1472
|
-
|
|
1479
|
+
const
|
|
1473
1480
|
planes = this .planes,
|
|
1474
1481
|
min = this .min,
|
|
1475
1482
|
max = this .max,
|
|
@@ -1525,11 +1532,11 @@ function (Vector3,
|
|
|
1525
1532
|
},
|
|
1526
1533
|
getLongestAxis: function (min, max)
|
|
1527
1534
|
{
|
|
1528
|
-
|
|
1535
|
+
const
|
|
1529
1536
|
x = max .x - min .x,
|
|
1530
1537
|
y = max .y - min .y,
|
|
1531
1538
|
z = max .z - min .z;
|
|
1532
|
-
|
|
1539
|
+
|
|
1533
1540
|
if (x < y)
|
|
1534
1541
|
{
|
|
1535
1542
|
if (y < z)
|
|
@@ -1552,8 +1559,8 @@ function (Vector3,
|
|
|
1552
1559
|
this .vertices = vertices;
|
|
1553
1560
|
this .normals = normals;
|
|
1554
1561
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1562
|
+
const numTriangles = vertices .length / 12;
|
|
1563
|
+
|
|
1557
1564
|
switch (numTriangles)
|
|
1558
1565
|
{
|
|
1559
1566
|
case 0:
|
|
@@ -1568,9 +1575,9 @@ function (Vector3,
|
|
|
1568
1575
|
}
|
|
1569
1576
|
default:
|
|
1570
1577
|
{
|
|
1571
|
-
|
|
1578
|
+
const triangles = [ ];
|
|
1572
1579
|
|
|
1573
|
-
for (
|
|
1580
|
+
for (let i = 0; i < numTriangles; ++ i)
|
|
1574
1581
|
triangles .push (i);
|
|
1575
1582
|
|
|
1576
1583
|
this .sorter = new QuickSort (triangles, SortComparator (vertices, 0));
|
|
@@ -1584,7 +1591,7 @@ function (Vector3,
|
|
|
1584
1591
|
BVH .prototype =
|
|
1585
1592
|
{
|
|
1586
1593
|
constructor: BVH,
|
|
1587
|
-
|
|
1594
|
+
|
|
1588
1595
|
intersectsLine: function (line, intersections, intersectionNormals)
|
|
1589
1596
|
{
|
|
1590
1597
|
intersections .size = 0;
|
|
@@ -1659,7 +1666,7 @@ define ('x_ite/Components/ParticleSystems/ParticleSystem',[
|
|
|
1659
1666
|
"x_ite/Bits/TraverseType",
|
|
1660
1667
|
"x_ite/Bits/X3DConstants",
|
|
1661
1668
|
"x_ite/Bits/X3DCast",
|
|
1662
|
-
"
|
|
1669
|
+
"x_ite/Browser/Shape/AlphaMode",
|
|
1663
1670
|
"standard/Math/Numbers/Vector3",
|
|
1664
1671
|
"standard/Math/Numbers/Vector4",
|
|
1665
1672
|
"standard/Math/Numbers/Matrix4",
|
|
@@ -1675,7 +1682,7 @@ function (Fields,
|
|
|
1675
1682
|
TraverseType,
|
|
1676
1683
|
X3DConstants,
|
|
1677
1684
|
X3DCast,
|
|
1678
|
-
|
|
1685
|
+
AlphaMode,
|
|
1679
1686
|
Vector3,
|
|
1680
1687
|
Vector4,
|
|
1681
1688
|
Matrix4,
|
|
@@ -1686,8 +1693,9 @@ function (Fields,
|
|
|
1686
1693
|
{
|
|
1687
1694
|
"use strict";
|
|
1688
1695
|
|
|
1689
|
-
var
|
|
1690
|
-
|
|
1696
|
+
var i = 0;
|
|
1697
|
+
|
|
1698
|
+
const
|
|
1691
1699
|
POINT = i ++,
|
|
1692
1700
|
LINE = i ++,
|
|
1693
1701
|
TRIANGLE = i ++,
|
|
@@ -1695,7 +1703,7 @@ function (Fields,
|
|
|
1695
1703
|
GEOMETRY = i ++,
|
|
1696
1704
|
SPRITE = i ++;
|
|
1697
1705
|
|
|
1698
|
-
|
|
1706
|
+
const GeometryTypes = {
|
|
1699
1707
|
POINT: POINT,
|
|
1700
1708
|
LINE: LINE,
|
|
1701
1709
|
TRIANGLE: TRIANGLE,
|
|
@@ -1704,7 +1712,7 @@ function (Fields,
|
|
|
1704
1712
|
SPRITE: SPRITE,
|
|
1705
1713
|
};
|
|
1706
1714
|
|
|
1707
|
-
|
|
1715
|
+
const
|
|
1708
1716
|
invModelViewMatrix = new Matrix4 (),
|
|
1709
1717
|
billboardToScreen = new Vector3 (0, 0, 0),
|
|
1710
1718
|
viewerYAxis = new Vector3 (0, 0, 0),
|
|
@@ -1750,16 +1758,16 @@ function (Fields,
|
|
|
1750
1758
|
this .colorKeys = [ ];
|
|
1751
1759
|
this .colorRamppNode = null;
|
|
1752
1760
|
this .colorRamp = [ ];
|
|
1753
|
-
this .colorMaterial = false;
|
|
1754
1761
|
this .texCoordKeys = [ ];
|
|
1755
1762
|
this .texCoordRampNode = null;
|
|
1756
1763
|
this .texCoordRamp = [ ];
|
|
1757
1764
|
this .texCoordAnim = false;
|
|
1758
1765
|
this .vertexCount = 0;
|
|
1759
|
-
this .shaderNode =
|
|
1766
|
+
this .shaderNode = null;
|
|
1760
1767
|
this .rotation = new Matrix3 ();
|
|
1761
1768
|
this .particleSorter = new QuickSort (this .particles, compareDistance);
|
|
1762
1769
|
this .sortParticles = false;
|
|
1770
|
+
this .geometryContext = { };
|
|
1763
1771
|
}
|
|
1764
1772
|
|
|
1765
1773
|
ParticleSystem .prototype = Object .assign (Object .create (X3DShapeNode .prototype),
|
|
@@ -1781,6 +1789,9 @@ function (Fields,
|
|
|
1781
1789
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "texCoordKey", new Fields .MFFloat ()),
|
|
1782
1790
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "texCoordRamp", new Fields .SFNode ()),
|
|
1783
1791
|
new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
|
|
1792
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
|
|
1793
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "castShadow", new Fields .SFBool (true)),
|
|
1794
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
|
|
1784
1795
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
|
|
1785
1796
|
new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
|
|
1786
1797
|
new X3DFieldDefinition (X3DConstants .inputOutput, "appearance", new Fields .SFNode ()),
|
|
@@ -1802,12 +1813,13 @@ function (Fields,
|
|
|
1802
1813
|
{
|
|
1803
1814
|
X3DShapeNode .prototype .initialize .call (this);
|
|
1804
1815
|
|
|
1805
|
-
|
|
1816
|
+
const
|
|
1817
|
+
browser = this .getBrowser (),
|
|
1818
|
+
gl = browser .getContext ();
|
|
1806
1819
|
|
|
1807
1820
|
this .isLive () .addInterest ("set_live__", this);
|
|
1808
1821
|
|
|
1809
|
-
|
|
1810
|
-
//this .getBrowser () .getDefaultShader () .addInterest ("set_shader__", this);
|
|
1822
|
+
browser .getBrowserOptions () .Shading_ .addInterest ("set_shader__", this);
|
|
1811
1823
|
|
|
1812
1824
|
this .enabled_ .addInterest ("set_enabled__", this);
|
|
1813
1825
|
this .createParticles_ .addInterest ("set_createParticles__", this);
|
|
@@ -1831,6 +1843,9 @@ function (Fields,
|
|
|
1831
1843
|
this .normalBuffer = gl .createBuffer ();
|
|
1832
1844
|
this .vertexBuffer = gl .createBuffer ();
|
|
1833
1845
|
|
|
1846
|
+
for (var i = 1, channels = this .getBrowser () .getMaxTextures (); i < channels; ++ i)
|
|
1847
|
+
this .texCoordBuffers .push (this .texCoordBuffers [0]);
|
|
1848
|
+
|
|
1834
1849
|
this .idArray = new Float32Array ();
|
|
1835
1850
|
this .positionArray = new Float32Array ();
|
|
1836
1851
|
this .elapsedTimeArray = new Float32Array ();
|
|
@@ -1842,6 +1857,11 @@ function (Fields,
|
|
|
1842
1857
|
|
|
1843
1858
|
this .primitiveMode = gl .TRIANGLES;
|
|
1844
1859
|
|
|
1860
|
+
// Geometry context
|
|
1861
|
+
|
|
1862
|
+
this .geometryContext .fogCoords = false;
|
|
1863
|
+
this .geometryContext .textureCoordinateNode = browser .getDefaultTextureCoordinate ();
|
|
1864
|
+
|
|
1845
1865
|
// Call order is higly important at startup.
|
|
1846
1866
|
this .set_emitter__ ();
|
|
1847
1867
|
this .set_enabled__ ();
|
|
@@ -1854,31 +1874,38 @@ function (Fields,
|
|
|
1854
1874
|
},
|
|
1855
1875
|
set_bbox__: function ()
|
|
1856
1876
|
{
|
|
1857
|
-
if (this .bboxSize_ .getValue () .equals (this .
|
|
1877
|
+
if (this .bboxSize_ .getValue () .equals (this .getDefaultBBoxSize ()))
|
|
1858
1878
|
this .bbox .set ();
|
|
1859
1879
|
else
|
|
1860
1880
|
this .bbox .set (this .bboxSize_ .getValue (), this .bboxCenter_ .getValue ());
|
|
1861
|
-
|
|
1862
|
-
this .bboxSize
|
|
1863
|
-
this .bboxCenter
|
|
1881
|
+
|
|
1882
|
+
this .bboxSize .assign (this .bbox .size);
|
|
1883
|
+
this .bboxCenter .assign (this .bbox .center);
|
|
1864
1884
|
},
|
|
1865
1885
|
set_transparent__: function ()
|
|
1866
1886
|
{
|
|
1867
|
-
|
|
1887
|
+
if (this .getAppearance () .getAlphaMode () === AlphaMode .AUTO)
|
|
1868
1888
|
{
|
|
1869
|
-
|
|
1889
|
+
switch (this .geometryType)
|
|
1870
1890
|
{
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1891
|
+
case POINT:
|
|
1892
|
+
{
|
|
1893
|
+
this .setTransparent (true);
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1896
|
+
default:
|
|
1897
|
+
{
|
|
1898
|
+
this .setTransparent (this .getAppearance () .getTransparent () ||
|
|
1899
|
+
(this .colorRampNode && this .colorRampNode .getTransparent ()) ||
|
|
1900
|
+
(this .geometryType === GEOMETRY && this .geometryNode && this .geometryNode .getTransparent ()));
|
|
1901
|
+
break;
|
|
1902
|
+
}
|
|
1880
1903
|
}
|
|
1881
1904
|
}
|
|
1905
|
+
else
|
|
1906
|
+
{
|
|
1907
|
+
this .setTransparent (this .getAppearance () .getTransparent ());
|
|
1908
|
+
}
|
|
1882
1909
|
},
|
|
1883
1910
|
set_live__: function ()
|
|
1884
1911
|
{
|
|
@@ -1887,7 +1914,7 @@ function (Fields,
|
|
|
1887
1914
|
if (this .isActive_ .getValue () && this .maxParticles_ .getValue ())
|
|
1888
1915
|
{
|
|
1889
1916
|
this .getBrowser () .sensorEvents () .addInterest ("animateParticles", this);
|
|
1890
|
-
|
|
1917
|
+
|
|
1891
1918
|
if (this .pauseTime)
|
|
1892
1919
|
{
|
|
1893
1920
|
this .creationTime += performance .now () / 1000 - this .pauseTime;
|
|
@@ -1900,7 +1927,7 @@ function (Fields,
|
|
|
1900
1927
|
if (this .isActive_ .getValue () && this .maxParticles_ .getValue ())
|
|
1901
1928
|
{
|
|
1902
1929
|
this .getBrowser () .sensorEvents () .removeInterest ("animateParticles", this);
|
|
1903
|
-
|
|
1930
|
+
|
|
1904
1931
|
if (this .pauseTime === 0)
|
|
1905
1932
|
this .pauseTime = performance .now () / 1000;
|
|
1906
1933
|
}
|
|
@@ -1915,7 +1942,7 @@ function (Fields,
|
|
|
1915
1942
|
if (this .isLive () .getValue ())
|
|
1916
1943
|
{
|
|
1917
1944
|
this .getBrowser () .sensorEvents () .addInterest ("animateParticles", this);
|
|
1918
|
-
|
|
1945
|
+
|
|
1919
1946
|
this .pauseTime = 0;
|
|
1920
1947
|
}
|
|
1921
1948
|
else
|
|
@@ -1932,9 +1959,9 @@ function (Fields,
|
|
|
1932
1959
|
{
|
|
1933
1960
|
this .getBrowser () .sensorEvents () .removeInterest ("animateParticles", this);
|
|
1934
1961
|
}
|
|
1935
|
-
|
|
1962
|
+
|
|
1936
1963
|
this .isActive_ = false;
|
|
1937
|
-
|
|
1964
|
+
|
|
1938
1965
|
this .numParticles = 0;
|
|
1939
1966
|
}
|
|
1940
1967
|
}
|
|
@@ -1979,9 +2006,12 @@ function (Fields,
|
|
|
1979
2006
|
this .colorArray .fill (1);
|
|
1980
2007
|
this .vertexArray .fill (1);
|
|
1981
2008
|
|
|
2009
|
+
this .testWireframe = false;
|
|
1982
2010
|
this .primitiveMode = gl .POINTS;
|
|
1983
2011
|
this .texCoordCount = 0;
|
|
1984
2012
|
this .vertexCount = 1;
|
|
2013
|
+
|
|
2014
|
+
this .geometryContext .geometryType = 0;
|
|
1985
2015
|
break;
|
|
1986
2016
|
}
|
|
1987
2017
|
case LINE:
|
|
@@ -2001,9 +2031,12 @@ function (Fields,
|
|
|
2001
2031
|
this .colorArray .fill (1);
|
|
2002
2032
|
this .vertexArray .fill (1);
|
|
2003
2033
|
|
|
2034
|
+
this .testWireframe = false;
|
|
2004
2035
|
this .primitiveMode = gl .LINES;
|
|
2005
2036
|
this .texCoordCount = 2;
|
|
2006
2037
|
this .vertexCount = 2;
|
|
2038
|
+
|
|
2039
|
+
this .geometryContext .geometryType = 1;
|
|
2007
2040
|
break;
|
|
2008
2041
|
}
|
|
2009
2042
|
case TRIANGLE:
|
|
@@ -2078,9 +2111,12 @@ function (Fields,
|
|
|
2078
2111
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .texCoordBuffers [0]);
|
|
2079
2112
|
gl .bufferData (gl .ARRAY_BUFFER, this .texCoordArray, gl .STATIC_DRAW);
|
|
2080
2113
|
|
|
2114
|
+
this .testWireframe = true;
|
|
2081
2115
|
this .primitiveMode = gl .TRIANGLES;
|
|
2082
2116
|
this .texCoordCount = 4;
|
|
2083
2117
|
this .vertexCount = 6;
|
|
2118
|
+
|
|
2119
|
+
this .geometryContext .geometryType = 2;
|
|
2084
2120
|
break;
|
|
2085
2121
|
}
|
|
2086
2122
|
case GEOMETRY:
|
|
@@ -2103,28 +2139,20 @@ function (Fields,
|
|
|
2103
2139
|
{
|
|
2104
2140
|
case POINT:
|
|
2105
2141
|
{
|
|
2106
|
-
this .
|
|
2107
|
-
this .shaderNode = this .getBrowser () .getPointShader ();
|
|
2142
|
+
this .shaderNode = this .getBrowser () .getPointShader ();
|
|
2108
2143
|
break;
|
|
2109
2144
|
}
|
|
2110
2145
|
case LINE:
|
|
2111
2146
|
{
|
|
2112
|
-
this .
|
|
2113
|
-
this .shaderNode = this .getBrowser () .getLineShader ();
|
|
2147
|
+
this .shaderNode = this .getBrowser () .getLineShader ();
|
|
2114
2148
|
break;
|
|
2115
2149
|
}
|
|
2116
2150
|
case TRIANGLE:
|
|
2117
2151
|
case QUAD:
|
|
2118
2152
|
case SPRITE:
|
|
2119
|
-
{
|
|
2120
|
-
this .shaderGeometryType = 3;
|
|
2121
|
-
this .shaderNode = this .getBrowser () .getDefaultShader ();
|
|
2122
|
-
break;
|
|
2123
|
-
}
|
|
2124
2153
|
case GEOMETRY:
|
|
2125
2154
|
{
|
|
2126
|
-
this .
|
|
2127
|
-
this .shaderNode = this .getBrowser () .getDefaultShader ();
|
|
2155
|
+
this .shaderNode = null;
|
|
2128
2156
|
break;
|
|
2129
2157
|
}
|
|
2130
2158
|
}
|
|
@@ -2144,12 +2172,13 @@ function (Fields,
|
|
|
2144
2172
|
for (var i = particles .length, length = maxParticles; i < length; ++ i)
|
|
2145
2173
|
{
|
|
2146
2174
|
particles [i] = {
|
|
2175
|
+
id: i,
|
|
2147
2176
|
life: 1,
|
|
2148
2177
|
lifetime: -1,
|
|
2149
2178
|
elapsedTime: 0,
|
|
2150
2179
|
position: new Vector3 (0, 0, 0),
|
|
2151
2180
|
velocity: new Vector3 (0, 0, 0),
|
|
2152
|
-
color:
|
|
2181
|
+
color: new Vector4 (1, 1, 1, 1),
|
|
2153
2182
|
distance: 0,
|
|
2154
2183
|
};
|
|
2155
2184
|
}
|
|
@@ -2176,7 +2205,7 @@ function (Fields,
|
|
|
2176
2205
|
|
|
2177
2206
|
if (! this .emitterNode)
|
|
2178
2207
|
this .emitterNode = this .getBrowser () .getDefaultEmitter ();
|
|
2179
|
-
|
|
2208
|
+
|
|
2180
2209
|
this .createParticles = this .createParticles_ .getValue ();
|
|
2181
2210
|
},
|
|
2182
2211
|
set_physics__: function ()
|
|
@@ -2279,7 +2308,7 @@ function (Fields,
|
|
|
2279
2308
|
|
|
2280
2309
|
colorRamp .length = length;
|
|
2281
2310
|
|
|
2282
|
-
this .colorMaterial =
|
|
2311
|
+
this .geometryContext .colorMaterial = !! (colorKeys .length && this .colorRampNode);
|
|
2283
2312
|
},
|
|
2284
2313
|
set_texCoordRamp__: function ()
|
|
2285
2314
|
{
|
|
@@ -2313,7 +2342,7 @@ function (Fields,
|
|
|
2313
2342
|
|
|
2314
2343
|
texCoordRamp .length = length;
|
|
2315
2344
|
|
|
2316
|
-
this .texCoordAnim =
|
|
2345
|
+
this .texCoordAnim = !! (texCoordKeys .length && this .texCoordRampNode);
|
|
2317
2346
|
},
|
|
2318
2347
|
intersectsBox: function (box, clipPlanes)
|
|
2319
2348
|
{
|
|
@@ -2339,14 +2368,14 @@ function (Fields,
|
|
|
2339
2368
|
var
|
|
2340
2369
|
now = performance .now () / 1000,
|
|
2341
2370
|
particleLifetime = this .particleLifetime + this .particleLifetime * this .lifetimeVariation;
|
|
2342
|
-
|
|
2371
|
+
|
|
2343
2372
|
if (this .numParticles === 0 || now - this .creationTime > particleLifetime)
|
|
2344
2373
|
{
|
|
2345
2374
|
this .creationTime = now;
|
|
2346
2375
|
this .numParticles = this .maxParticles;
|
|
2347
2376
|
this .createParticles = this .createParticles_ .getValue ();
|
|
2348
2377
|
|
|
2349
|
-
deltaTime = Number .POSITIVE_INFINITY;
|
|
2378
|
+
deltaTime = Number .POSITIVE_INFINITY;
|
|
2350
2379
|
}
|
|
2351
2380
|
else
|
|
2352
2381
|
this .createParticles = false;
|
|
@@ -2358,7 +2387,7 @@ function (Fields,
|
|
|
2358
2387
|
var
|
|
2359
2388
|
now = performance .now () / 1000,
|
|
2360
2389
|
newParticles = Math .max (0, Math .floor ((now - this .creationTime) * this .maxParticles / this .particleLifetime));
|
|
2361
|
-
|
|
2390
|
+
|
|
2362
2391
|
if (newParticles)
|
|
2363
2392
|
this .creationTime = now;
|
|
2364
2393
|
|
|
@@ -2443,20 +2472,20 @@ function (Fields,
|
|
|
2443
2472
|
|
|
2444
2473
|
// Colors
|
|
2445
2474
|
|
|
2446
|
-
if (this .colorMaterial)
|
|
2475
|
+
if (this .geometryContext .colorMaterial)
|
|
2447
2476
|
{
|
|
2448
2477
|
for (var i = 0; i < numParticles; ++ i)
|
|
2449
2478
|
{
|
|
2450
2479
|
var
|
|
2451
2480
|
color = particles [i] .color,
|
|
2452
2481
|
i4 = i * 4;
|
|
2453
|
-
|
|
2482
|
+
|
|
2454
2483
|
colorArray [i4] = color .x;
|
|
2455
2484
|
colorArray [i4 + 1] = color .y;
|
|
2456
2485
|
colorArray [i4 + 2] = color .z;
|
|
2457
2486
|
colorArray [i4 + 3] = color .w;
|
|
2458
2487
|
}
|
|
2459
|
-
|
|
2488
|
+
|
|
2460
2489
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
2461
2490
|
gl .bufferData (gl .ARRAY_BUFFER, this .colorArray, gl .STATIC_DRAW);
|
|
2462
2491
|
}
|
|
@@ -2507,14 +2536,14 @@ function (Fields,
|
|
|
2507
2536
|
|
|
2508
2537
|
// Colors
|
|
2509
2538
|
|
|
2510
|
-
if (this .colorMaterial)
|
|
2539
|
+
if (this .geometryContext .colorMaterial)
|
|
2511
2540
|
{
|
|
2512
2541
|
for (var i = 0; i < numParticles; ++ i)
|
|
2513
2542
|
{
|
|
2514
2543
|
var
|
|
2515
2544
|
color = particles [i] .color,
|
|
2516
2545
|
i8 = i * 8;
|
|
2517
|
-
|
|
2546
|
+
|
|
2518
2547
|
colorArray [i8] = color .x;
|
|
2519
2548
|
colorArray [i8 + 1] = color .y;
|
|
2520
2549
|
colorArray [i8 + 2] = color .z;
|
|
@@ -2525,7 +2554,7 @@ function (Fields,
|
|
|
2525
2554
|
colorArray [i8 + 6] = color .z;
|
|
2526
2555
|
colorArray [i8 + 7] = color .w;
|
|
2527
2556
|
}
|
|
2528
|
-
|
|
2557
|
+
|
|
2529
2558
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
2530
2559
|
gl .bufferData (gl .ARRAY_BUFFER, this .colorArray, gl .STATIC_DRAW);
|
|
2531
2560
|
}
|
|
@@ -2565,7 +2594,7 @@ function (Fields,
|
|
|
2565
2594
|
vertexArray [i8] = x - normal .x;
|
|
2566
2595
|
vertexArray [i8 + 1] = y - normal .y;
|
|
2567
2596
|
vertexArray [i8 + 2] = z - normal .z;
|
|
2568
|
-
|
|
2597
|
+
|
|
2569
2598
|
vertexArray [i8 + 4] = x + normal .x;
|
|
2570
2599
|
vertexArray [i8 + 5] = y + normal .y;
|
|
2571
2600
|
vertexArray [i8 + 6] = z + normal .z;
|
|
@@ -2598,9 +2627,9 @@ function (Fields,
|
|
|
2598
2627
|
vertexArray = this .vertexArray,
|
|
2599
2628
|
sx1_2 = this .particleSize_ .x / 2,
|
|
2600
2629
|
sy1_2 = this .particleSize_ .y / 2;
|
|
2601
|
-
|
|
2630
|
+
|
|
2602
2631
|
// Sort particles
|
|
2603
|
-
|
|
2632
|
+
|
|
2604
2633
|
// if (this .sortParticles) // always false
|
|
2605
2634
|
// {
|
|
2606
2635
|
// for (var i = 0; i < numParticles; ++ i)
|
|
@@ -2608,167 +2637,167 @@ function (Fields,
|
|
|
2608
2637
|
// var particle = particles [i];
|
|
2609
2638
|
// particle .distance = modelViewMatrix .getDepth (particle .position);
|
|
2610
2639
|
// }
|
|
2611
|
-
//
|
|
2640
|
+
//
|
|
2612
2641
|
// // Expensisive function!!!
|
|
2613
2642
|
// this .particleSorter .sort (0, numParticles);
|
|
2614
2643
|
// }
|
|
2615
|
-
|
|
2644
|
+
|
|
2616
2645
|
// Colors
|
|
2617
|
-
|
|
2646
|
+
|
|
2618
2647
|
if (! modelViewMatrix) // if called from animateParticles
|
|
2619
2648
|
{
|
|
2620
|
-
if (this .colorMaterial)
|
|
2649
|
+
if (this .geometryContext .colorMaterial)
|
|
2621
2650
|
{
|
|
2622
2651
|
for (var i = 0; i < maxParticles; ++ i)
|
|
2623
2652
|
{
|
|
2624
2653
|
var
|
|
2625
2654
|
color = particles [i] .color,
|
|
2626
2655
|
i24 = i * 24;
|
|
2627
|
-
|
|
2656
|
+
|
|
2628
2657
|
// p4 ------ p3
|
|
2629
2658
|
// | / |
|
|
2630
2659
|
// | / |
|
|
2631
2660
|
// | / |
|
|
2632
2661
|
// | / |
|
|
2633
2662
|
// p1 ------ p2
|
|
2634
|
-
|
|
2663
|
+
|
|
2635
2664
|
// p1, p2, p3; p1, p3, p4
|
|
2636
2665
|
colorArray [i24] = colorArray [i24 + 4] = colorArray [i24 + 8] = colorArray [i24 + 12] = colorArray [i24 + 16] = colorArray [i24 + 20] = color .x;
|
|
2637
2666
|
colorArray [i24 + 1] = colorArray [i24 + 5] = colorArray [i24 + 9] = colorArray [i24 + 13] = colorArray [i24 + 17] = colorArray [i24 + 21] = color .y;
|
|
2638
2667
|
colorArray [i24 + 2] = colorArray [i24 + 6] = colorArray [i24 + 10] = colorArray [i24 + 14] = colorArray [i24 + 18] = colorArray [i24 + 22] = color .z;
|
|
2639
2668
|
colorArray [i24 + 3] = colorArray [i24 + 7] = colorArray [i24 + 11] = colorArray [i24 + 15] = colorArray [i24 + 19] = colorArray [i24 + 23] = color .w;
|
|
2640
2669
|
}
|
|
2641
|
-
|
|
2670
|
+
|
|
2642
2671
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .colorBuffer);
|
|
2643
2672
|
gl .bufferData (gl .ARRAY_BUFFER, this .colorArray, gl .STATIC_DRAW);
|
|
2644
2673
|
}
|
|
2645
|
-
|
|
2674
|
+
|
|
2646
2675
|
if (this .texCoordAnim && this .texCoordArray .length)
|
|
2647
2676
|
{
|
|
2648
2677
|
var
|
|
2649
2678
|
texCoordKeys = this .texCoordKeys,
|
|
2650
2679
|
texCoordRamp = this .texCoordRamp;
|
|
2651
|
-
|
|
2680
|
+
|
|
2652
2681
|
var
|
|
2653
2682
|
length = texCoordKeys .length,
|
|
2654
2683
|
index0 = 0;
|
|
2655
|
-
|
|
2684
|
+
|
|
2656
2685
|
for (var i = 0; i < maxParticles; ++ i)
|
|
2657
2686
|
{
|
|
2658
2687
|
// Determine index0.
|
|
2659
|
-
|
|
2688
|
+
|
|
2660
2689
|
var
|
|
2661
2690
|
particle = particles [i],
|
|
2662
2691
|
fraction = particle .elapsedTime / particle .lifetime;
|
|
2663
|
-
|
|
2692
|
+
|
|
2664
2693
|
if (length == 1 || fraction <= texCoordKeys [0])
|
|
2665
2694
|
{
|
|
2666
2695
|
index0 = 0;
|
|
2667
2696
|
}
|
|
2668
|
-
else if (fraction >= texCoordKeys
|
|
2697
|
+
else if (fraction >= texCoordKeys .at (-1))
|
|
2669
2698
|
{
|
|
2670
2699
|
index0 = length - 2;
|
|
2671
2700
|
}
|
|
2672
2701
|
else
|
|
2673
2702
|
{
|
|
2674
2703
|
var index = Algorithm .upperBound (texCoordKeys, 0, length, fraction, Algorithm .less);
|
|
2675
|
-
|
|
2704
|
+
|
|
2676
2705
|
if (index < length)
|
|
2677
2706
|
index0 = index - 1;
|
|
2678
2707
|
else
|
|
2679
2708
|
index0 = 0;
|
|
2680
2709
|
}
|
|
2681
|
-
|
|
2710
|
+
|
|
2682
2711
|
// Set texCoord.
|
|
2683
|
-
|
|
2712
|
+
|
|
2684
2713
|
index0 *= this .texCoordCount;
|
|
2685
|
-
|
|
2714
|
+
|
|
2686
2715
|
var
|
|
2687
2716
|
texCoord1 = texCoordRamp [index0],
|
|
2688
2717
|
texCoord2 = texCoordRamp [index0 + 1],
|
|
2689
2718
|
texCoord3 = texCoordRamp [index0 + 2],
|
|
2690
2719
|
texCoord4 = texCoordRamp [index0 + 3],
|
|
2691
2720
|
i24 = i * 24;
|
|
2692
|
-
|
|
2721
|
+
|
|
2693
2722
|
// p4 ------ p3
|
|
2694
2723
|
// | / |
|
|
2695
2724
|
// | / |
|
|
2696
2725
|
// | / |
|
|
2697
2726
|
// | / |
|
|
2698
2727
|
// p1 ------ p2
|
|
2699
|
-
|
|
2728
|
+
|
|
2700
2729
|
// p1
|
|
2701
2730
|
texCoordArray [i24] = texCoordArray [i24 + 12] = texCoord1 .x;
|
|
2702
2731
|
texCoordArray [i24 + 1] = texCoordArray [i24 + 13] = texCoord1 .y;
|
|
2703
2732
|
texCoordArray [i24 + 2] = texCoordArray [i24 + 14] = texCoord1 .z;
|
|
2704
2733
|
texCoordArray [i24 + 3] = texCoordArray [i24 + 15] = texCoord1 .w;
|
|
2705
|
-
|
|
2734
|
+
|
|
2706
2735
|
// p2
|
|
2707
2736
|
texCoordArray [i24 + 4] = texCoord2 .x;
|
|
2708
2737
|
texCoordArray [i24 + 5] = texCoord2 .y;
|
|
2709
2738
|
texCoordArray [i24 + 6] = texCoord2 .z;
|
|
2710
2739
|
texCoordArray [i24 + 7] = texCoord2 .w;
|
|
2711
|
-
|
|
2740
|
+
|
|
2712
2741
|
// p3
|
|
2713
2742
|
texCoordArray [i24 + 8] = texCoordArray [i24 + 16] = texCoord3 .x;
|
|
2714
2743
|
texCoordArray [i24 + 9] = texCoordArray [i24 + 17] = texCoord3 .y;
|
|
2715
2744
|
texCoordArray [i24 + 10] = texCoordArray [i24 + 18] = texCoord3 .z;
|
|
2716
2745
|
texCoordArray [i24 + 11] = texCoordArray [i24 + 19] = texCoord3 .w;
|
|
2717
|
-
|
|
2746
|
+
|
|
2718
2747
|
// p4
|
|
2719
2748
|
texCoordArray [i24 + 20] = texCoord4 .x;
|
|
2720
2749
|
texCoordArray [i24 + 21] = texCoord4 .y;
|
|
2721
2750
|
texCoordArray [i24 + 22] = texCoord4 .z;
|
|
2722
2751
|
texCoordArray [i24 + 23] = texCoord4 .w;
|
|
2723
2752
|
}
|
|
2724
|
-
|
|
2753
|
+
|
|
2725
2754
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .texCoordBuffers [0]);
|
|
2726
2755
|
gl .bufferData (gl .ARRAY_BUFFER, this .texCoordArray, gl .STATIC_DRAW);
|
|
2727
2756
|
}
|
|
2728
2757
|
}
|
|
2729
2758
|
|
|
2730
2759
|
// Vertices
|
|
2731
|
-
|
|
2760
|
+
|
|
2732
2761
|
if (this .geometryType === SPRITE)
|
|
2733
2762
|
{
|
|
2734
2763
|
if (modelViewMatrix) // if called from depth or draw
|
|
2735
2764
|
{
|
|
2736
2765
|
// Normals
|
|
2737
|
-
|
|
2766
|
+
|
|
2738
2767
|
var rotation = this .getScreenAlignedRotation (modelViewMatrix);
|
|
2739
|
-
|
|
2768
|
+
|
|
2740
2769
|
normal
|
|
2741
2770
|
.set (rotation [0], rotation [1], rotation [2])
|
|
2742
2771
|
.cross (vector .set (rotation [3], rotation [4], rotation [5]))
|
|
2743
2772
|
.normalize ();
|
|
2744
|
-
|
|
2773
|
+
|
|
2745
2774
|
var
|
|
2746
2775
|
nx = normal .x,
|
|
2747
2776
|
ny = normal .y,
|
|
2748
2777
|
nz = normal .z;
|
|
2749
|
-
|
|
2778
|
+
|
|
2750
2779
|
for (var i = 0, length = 6 * 3 * maxParticles; i < length; i += 3)
|
|
2751
2780
|
{
|
|
2752
2781
|
normalArray [i] = nx;
|
|
2753
2782
|
normalArray [i + 1] = ny;
|
|
2754
2783
|
normalArray [i + 2] = nz;
|
|
2755
2784
|
}
|
|
2756
|
-
|
|
2785
|
+
|
|
2757
2786
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .normalBuffer);
|
|
2758
2787
|
gl .bufferData (gl .ARRAY_BUFFER, this .normalArray, gl .STATIC_DRAW);
|
|
2759
|
-
|
|
2788
|
+
|
|
2760
2789
|
// Vertices
|
|
2761
|
-
|
|
2790
|
+
|
|
2762
2791
|
s1 .set (-sx1_2, -sy1_2, 0);
|
|
2763
2792
|
s2 .set ( sx1_2, -sy1_2, 0);
|
|
2764
2793
|
s3 .set ( sx1_2, sy1_2, 0);
|
|
2765
2794
|
s4 .set (-sx1_2, sy1_2, 0);
|
|
2766
|
-
|
|
2795
|
+
|
|
2767
2796
|
rotation .multVecMatrix (s1);
|
|
2768
2797
|
rotation .multVecMatrix (s2);
|
|
2769
2798
|
rotation .multVecMatrix (s3);
|
|
2770
2799
|
rotation .multVecMatrix (s4);
|
|
2771
|
-
|
|
2800
|
+
|
|
2772
2801
|
for (var i = 0; i < numParticles; ++ i)
|
|
2773
2802
|
{
|
|
2774
2803
|
var
|
|
@@ -2780,7 +2809,7 @@ function (Fields,
|
|
|
2780
2809
|
i6 = i * 6,
|
|
2781
2810
|
i18 = i * 18,
|
|
2782
2811
|
i24 = i * 24;
|
|
2783
|
-
|
|
2812
|
+
|
|
2784
2813
|
// p4 ------ p3
|
|
2785
2814
|
// | / |
|
|
2786
2815
|
// | / |
|
|
@@ -2800,23 +2829,23 @@ function (Fields,
|
|
|
2800
2829
|
vertexArray [i24] = vertexArray [i24 + 12] = x + s1 .x;
|
|
2801
2830
|
vertexArray [i24 + 1] = vertexArray [i24 + 13] = y + s1 .y;
|
|
2802
2831
|
vertexArray [i24 + 2] = vertexArray [i24 + 14] = z + s1 .z;
|
|
2803
|
-
|
|
2832
|
+
|
|
2804
2833
|
// p2
|
|
2805
2834
|
vertexArray [i24 + 4] = x + s2 .x;
|
|
2806
2835
|
vertexArray [i24 + 5] = y + s2 .y;
|
|
2807
2836
|
vertexArray [i24 + 6] = z + s2 .z;
|
|
2808
|
-
|
|
2837
|
+
|
|
2809
2838
|
// p3
|
|
2810
2839
|
vertexArray [i24 + 8] = vertexArray [i24 + 16] = x + s3 .x;
|
|
2811
2840
|
vertexArray [i24 + 9] = vertexArray [i24 + 17] = y + s3 .y;
|
|
2812
2841
|
vertexArray [i24 + 10] = vertexArray [i24 + 18] = z + s3 .z;
|
|
2813
|
-
|
|
2842
|
+
|
|
2814
2843
|
// p4
|
|
2815
2844
|
vertexArray [i24 + 20] = x + s4 .x;
|
|
2816
2845
|
vertexArray [i24 + 21] = y + s4 .y;
|
|
2817
2846
|
vertexArray [i24 + 22] = z + s4 .z;
|
|
2818
2847
|
}
|
|
2819
|
-
|
|
2848
|
+
|
|
2820
2849
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .positionBuffer);
|
|
2821
2850
|
gl .bufferData (gl .ARRAY_BUFFER, this .positionArray, gl .STATIC_DRAW);
|
|
2822
2851
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .elapsedTimeBuffer);
|
|
@@ -2842,7 +2871,7 @@ function (Fields,
|
|
|
2842
2871
|
i6 = i * 6,
|
|
2843
2872
|
i18 = i * 18,
|
|
2844
2873
|
i24 = i * 24;
|
|
2845
|
-
|
|
2874
|
+
|
|
2846
2875
|
// p4 ------ p3
|
|
2847
2876
|
// | / |
|
|
2848
2877
|
// | / |
|
|
@@ -2856,28 +2885,28 @@ function (Fields,
|
|
|
2856
2885
|
|
|
2857
2886
|
elapsedTimeArray [i6] = elapsedTimeArray [i6 + 1] = elapsedTimeArray [i6 + 2] = elapsedTimeArray [i6 + 3] = elapsedTimeArray [i6 + 4] = elapsedTimeArray [i6 + 5] = elapsedTime;
|
|
2858
2887
|
lifeArray [i6] = lifeArray [i6 + 1] = lifeArray [i6 + 2] = lifeArray [i6 + 3] = lifeArray [i6 + 4] = lifeArray [i6 + 5] = particles [i] .life;
|
|
2859
|
-
|
|
2888
|
+
|
|
2860
2889
|
// p1
|
|
2861
2890
|
vertexArray [i24] = vertexArray [i24 + 12] = x - sx1_2;
|
|
2862
2891
|
vertexArray [i24 + 1] = vertexArray [i24 + 13] = y - sy1_2;
|
|
2863
2892
|
vertexArray [i24 + 2] = vertexArray [i24 + 14] = z;
|
|
2864
|
-
|
|
2893
|
+
|
|
2865
2894
|
// p2
|
|
2866
2895
|
vertexArray [i24 + 4] = x + sx1_2;
|
|
2867
2896
|
vertexArray [i24 + 5] = y - sy1_2;
|
|
2868
2897
|
vertexArray [i24 + 6] = z;
|
|
2869
|
-
|
|
2898
|
+
|
|
2870
2899
|
// p3
|
|
2871
2900
|
vertexArray [i24 + 8] = vertexArray [i24 + 16] = x + sx1_2;
|
|
2872
2901
|
vertexArray [i24 + 9] = vertexArray [i24 + 17] = y + sy1_2;
|
|
2873
2902
|
vertexArray [i24 + 10] = vertexArray [i24 + 18] = z;
|
|
2874
|
-
|
|
2903
|
+
|
|
2875
2904
|
// p4
|
|
2876
2905
|
vertexArray [i24 + 20] = x - sx1_2;
|
|
2877
2906
|
vertexArray [i24 + 21] = y + sy1_2;
|
|
2878
2907
|
vertexArray [i24 + 22] = z;
|
|
2879
2908
|
}
|
|
2880
|
-
|
|
2909
|
+
|
|
2881
2910
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .positionBuffer);
|
|
2882
2911
|
gl .bufferData (gl .ARRAY_BUFFER, this .positionArray, gl .STATIC_DRAW);
|
|
2883
2912
|
gl .bindBuffer (gl .ARRAY_BUFFER, this .elapsedTimeBuffer);
|
|
@@ -2905,14 +2934,20 @@ function (Fields,
|
|
|
2905
2934
|
{
|
|
2906
2935
|
break;
|
|
2907
2936
|
}
|
|
2937
|
+
case TraverseType .PICKING:
|
|
2938
|
+
{
|
|
2939
|
+
break;
|
|
2940
|
+
}
|
|
2908
2941
|
case TraverseType .COLLISION:
|
|
2909
2942
|
{
|
|
2910
2943
|
// TODO: to be implemented.
|
|
2911
2944
|
break;
|
|
2912
2945
|
}
|
|
2913
|
-
case TraverseType .
|
|
2946
|
+
case TraverseType .SHADOW:
|
|
2914
2947
|
{
|
|
2915
|
-
|
|
2948
|
+
if (this .castShadow_ .getValue ())
|
|
2949
|
+
renderObject .addDepthShape (this);
|
|
2950
|
+
|
|
2916
2951
|
break;
|
|
2917
2952
|
}
|
|
2918
2953
|
case TraverseType .DISPLAY:
|
|
@@ -2950,20 +2985,23 @@ function (Fields,
|
|
|
2950
2985
|
if (this .numParticles <= 0)
|
|
2951
2986
|
return;
|
|
2952
2987
|
|
|
2953
|
-
|
|
2988
|
+
if (shaderNode .getValid ())
|
|
2989
|
+
{
|
|
2990
|
+
// Setup vertex attributes.
|
|
2954
2991
|
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2992
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticleId", this .idBuffer, 1);
|
|
2993
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticlePosition", this .positionBuffer, 3);
|
|
2994
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticleElapsedTime", this .elapsedTimeBuffer, 1);
|
|
2995
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticleLife", this .lifeBuffer, 1);
|
|
2996
|
+
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
2960
2997
|
|
|
2961
|
-
|
|
2998
|
+
gl .drawArrays (this .primitiveMode, 0, this .numParticles * this .vertexCount);
|
|
2962
2999
|
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
3000
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticleId");
|
|
3001
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticlePosition");
|
|
3002
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticleElapsedTime");
|
|
3003
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticleLife");
|
|
3004
|
+
}
|
|
2967
3005
|
}
|
|
2968
3006
|
},
|
|
2969
3007
|
display: function (gl, context)
|
|
@@ -2973,10 +3011,6 @@ function (Fields,
|
|
|
2973
3011
|
if (this .numParticles <= 0)
|
|
2974
3012
|
return;
|
|
2975
3013
|
|
|
2976
|
-
// Traverse appearance before everything.
|
|
2977
|
-
|
|
2978
|
-
this .getAppearance () .enable (gl, context);
|
|
2979
|
-
|
|
2980
3014
|
// Update geometry if SPRITE.
|
|
2981
3015
|
|
|
2982
3016
|
this .updateGeometry (context .modelViewMatrix);
|
|
@@ -2985,92 +3019,83 @@ function (Fields,
|
|
|
2985
3019
|
|
|
2986
3020
|
if (this .geometryType === GEOMETRY)
|
|
2987
3021
|
{
|
|
2988
|
-
|
|
3022
|
+
const geometryNode = this .getGeometry ();
|
|
2989
3023
|
|
|
2990
3024
|
if (geometryNode)
|
|
2991
3025
|
geometryNode .displayParticles (gl, context, this .particles, this .numParticles);
|
|
2992
3026
|
}
|
|
2993
3027
|
else
|
|
2994
3028
|
{
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
shaderNode
|
|
2998
|
-
|
|
2999
|
-
if (shaderNode === browser .getDefaultShader ())
|
|
3000
|
-
shaderNode = this .shaderNode;
|
|
3001
|
-
|
|
3029
|
+
const
|
|
3030
|
+
appearanceNode = this .getAppearance (),
|
|
3031
|
+
shaderNode = appearanceNode .shaderNode || this .shaderNode || appearanceNode .materialNode .getShader (context .browser, context .shadow);
|
|
3032
|
+
|
|
3002
3033
|
// Setup shader.
|
|
3003
|
-
|
|
3004
|
-
context .geometryType = this .shaderGeometryType;
|
|
3005
|
-
context .colorMaterial = this .colorMaterial;
|
|
3006
3034
|
|
|
3007
|
-
shaderNode .
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
// Setup vertex attributes.
|
|
3035
|
+
if (shaderNode .getValid ())
|
|
3036
|
+
{
|
|
3037
|
+
context .geometryContext = this .geometryContext;
|
|
3011
3038
|
|
|
3012
|
-
|
|
3013
|
-
shaderNode .enableFloatAttrib (gl, "x3d_ParticlePosition", this .positionBuffer, 3);
|
|
3014
|
-
shaderNode .enableFloatAttrib (gl, "x3d_ParticleElapsedTime", this .elapsedTimeBuffer, 1);
|
|
3015
|
-
shaderNode .enableFloatAttrib (gl, "x3d_ParticleLife", this .lifeBuffer, 1);
|
|
3039
|
+
const blendModeNode = appearanceNode .blendModeNode;
|
|
3016
3040
|
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
if (this .texCoordArray .length)
|
|
3021
|
-
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
3022
|
-
|
|
3023
|
-
if (this .normalArray .length)
|
|
3024
|
-
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
3025
|
-
|
|
3026
|
-
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
3027
|
-
|
|
3028
|
-
var testWireframe = false;
|
|
3029
|
-
|
|
3030
|
-
switch (this .geometryType)
|
|
3031
|
-
{
|
|
3032
|
-
case POINT:
|
|
3033
|
-
case LINE:
|
|
3034
|
-
break;
|
|
3035
|
-
case TRIANGLE:
|
|
3036
|
-
case QUAD:
|
|
3037
|
-
case SPRITE:
|
|
3038
|
-
testWireframe = true;
|
|
3039
|
-
break;
|
|
3040
|
-
case GEOMETRY:
|
|
3041
|
-
break;
|
|
3042
|
-
}
|
|
3043
|
-
|
|
3044
|
-
if (shaderNode .wireframe && testWireframe)
|
|
3045
|
-
{
|
|
3046
|
-
// Wireframes are always solid so only one drawing call is needed.
|
|
3047
|
-
|
|
3048
|
-
for (var i = 0, length = this .numParticles * this .vertexCount; i < length; i += 3)
|
|
3049
|
-
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
3050
|
-
}
|
|
3051
|
-
else
|
|
3052
|
-
{
|
|
3053
|
-
var positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
3054
|
-
|
|
3055
|
-
gl .frontFace (positiveScale ? gl .CCW : gl .CW);
|
|
3056
|
-
gl .enable (gl .CULL_FACE);
|
|
3057
|
-
gl .cullFace (gl .BACK);
|
|
3041
|
+
if (blendModeNode)
|
|
3042
|
+
blendModeNode .enable (gl);
|
|
3058
3043
|
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
shaderNode .disableFloatAttrib (gl, "x3d_ParticleId");
|
|
3063
|
-
shaderNode .disableFloatAttrib (gl, "x3d_ParticlePosition");
|
|
3064
|
-
shaderNode .disableFloatAttrib (gl, "x3d_ParticleElapsedTime");
|
|
3065
|
-
shaderNode .disableFloatAttrib (gl, "x3d_ParticleLife");
|
|
3044
|
+
shaderNode .enable (gl);
|
|
3045
|
+
shaderNode .setLocalUniforms (gl, context);
|
|
3066
3046
|
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3047
|
+
// Setup vertex attributes.
|
|
3048
|
+
|
|
3049
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticleId", this .idBuffer, 1);
|
|
3050
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticlePosition", this .positionBuffer, 3);
|
|
3051
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticleElapsedTime", this .elapsedTimeBuffer, 1);
|
|
3052
|
+
shaderNode .enableFloatAttrib (gl, "x3d_ParticleLife", this .lifeBuffer, 1);
|
|
3053
|
+
|
|
3054
|
+
if (this .geometryContext .colorMaterial)
|
|
3055
|
+
shaderNode .enableColorAttribute (gl, this .colorBuffer);
|
|
3056
|
+
|
|
3057
|
+
if (this .texCoordArray .length)
|
|
3058
|
+
shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers);
|
|
3059
|
+
|
|
3060
|
+
if (this .normalArray .length)
|
|
3061
|
+
shaderNode .enableNormalAttribute (gl, this .normalBuffer);
|
|
3062
|
+
|
|
3063
|
+
shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
|
|
3064
|
+
|
|
3065
|
+
if (shaderNode .wireframe && this .testWireframe)
|
|
3066
|
+
{
|
|
3067
|
+
// Wireframes are always solid so only one drawing call is needed.
|
|
3068
|
+
|
|
3069
|
+
for (var i = 0, length = this .numParticles * this .vertexCount; i < length; i += 3)
|
|
3070
|
+
gl .drawArrays (shaderNode .primitiveMode, i, 3);
|
|
3071
|
+
}
|
|
3072
|
+
else
|
|
3073
|
+
{
|
|
3074
|
+
const positiveScale = Matrix4 .prototype .determinant3 .call (context .modelViewMatrix) > 0;
|
|
3075
|
+
|
|
3076
|
+
gl .frontFace (positiveScale ? gl .CCW : gl .CW);
|
|
3077
|
+
gl .enable (gl .CULL_FACE);
|
|
3078
|
+
gl .cullFace (gl .BACK);
|
|
3079
|
+
|
|
3080
|
+
gl .drawArrays (this .primitiveMode, 0, this .numParticles * this .vertexCount);
|
|
3081
|
+
}
|
|
3072
3082
|
|
|
3073
|
-
|
|
3083
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticleId");
|
|
3084
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticlePosition");
|
|
3085
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticleElapsedTime");
|
|
3086
|
+
shaderNode .disableFloatAttrib (gl, "x3d_ParticleLife");
|
|
3087
|
+
|
|
3088
|
+
shaderNode .disableColorAttribute (gl);
|
|
3089
|
+
shaderNode .disableTexCoordAttribute (gl);
|
|
3090
|
+
shaderNode .disableNormalAttribute (gl);
|
|
3091
|
+
shaderNode .disable (gl);
|
|
3092
|
+
|
|
3093
|
+
if (blendModeNode)
|
|
3094
|
+
blendModeNode .disable (gl);
|
|
3095
|
+
|
|
3096
|
+
context .geometryContext = null;
|
|
3097
|
+
}
|
|
3098
|
+
}
|
|
3074
3099
|
}
|
|
3075
3100
|
catch (error)
|
|
3076
3101
|
{
|
|
@@ -3081,20 +3106,20 @@ function (Fields,
|
|
|
3081
3106
|
getScreenAlignedRotation: function (modelViewMatrix)
|
|
3082
3107
|
{
|
|
3083
3108
|
invModelViewMatrix .assign (modelViewMatrix) .inverse ();
|
|
3084
|
-
|
|
3109
|
+
|
|
3085
3110
|
invModelViewMatrix .multDirMatrix (billboardToScreen .assign (Vector3 .zAxis));
|
|
3086
3111
|
invModelViewMatrix .multDirMatrix (viewerYAxis .assign (Vector3 .yAxis));
|
|
3087
|
-
|
|
3112
|
+
|
|
3088
3113
|
x .assign (viewerYAxis) .cross (billboardToScreen);
|
|
3089
3114
|
y .assign (billboardToScreen) .cross (x);
|
|
3090
3115
|
var z = billboardToScreen;
|
|
3091
|
-
|
|
3116
|
+
|
|
3092
3117
|
// Compose rotation
|
|
3093
|
-
|
|
3118
|
+
|
|
3094
3119
|
x .normalize ();
|
|
3095
3120
|
y .normalize ();
|
|
3096
3121
|
z .normalize ();
|
|
3097
|
-
|
|
3122
|
+
|
|
3098
3123
|
return this .rotation .set (x .x, x .y, x .z,
|
|
3099
3124
|
y .x, y .y, y .z,
|
|
3100
3125
|
z .x, z .y, z .z);
|
|
@@ -3104,8 +3129,6 @@ function (Fields,
|
|
|
3104
3129
|
return ParticleSystem;
|
|
3105
3130
|
});
|
|
3106
3131
|
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
3132
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3110
3133
|
*******************************************************************************
|
|
3111
3134
|
*
|
|
@@ -3176,10 +3199,6 @@ function (Fields,
|
|
|
3176
3199
|
{
|
|
3177
3200
|
"use strict";
|
|
3178
3201
|
|
|
3179
|
-
var
|
|
3180
|
-
vertex1 = new Vector3 (0, 0, 0),
|
|
3181
|
-
vertex2 = new Vector3 (0, 0, 0);
|
|
3182
|
-
|
|
3183
3202
|
function PolylineEmitter (executionContext)
|
|
3184
3203
|
{
|
|
3185
3204
|
X3DParticleEmitterNode .call (this, executionContext);
|
|
@@ -3229,7 +3248,7 @@ function (Fields,
|
|
|
3229
3248
|
|
|
3230
3249
|
this .coordIndex_ .addFieldInterest (this .polylineNode .coordIndex_);
|
|
3231
3250
|
this .coord_ .addFieldInterest (this .polylineNode .coord_);
|
|
3232
|
-
|
|
3251
|
+
|
|
3233
3252
|
this .polylineNode .coordIndex_ = this .coordIndex_;
|
|
3234
3253
|
this .polylineNode .coord_ = this .coord_;
|
|
3235
3254
|
|
|
@@ -3249,34 +3268,41 @@ function (Fields,
|
|
|
3249
3268
|
else
|
|
3250
3269
|
delete this .getRandomVelocity;
|
|
3251
3270
|
},
|
|
3252
|
-
set_polyline: function ()
|
|
3271
|
+
set_polyline: (function ()
|
|
3253
3272
|
{
|
|
3254
|
-
var
|
|
3273
|
+
var
|
|
3274
|
+
vertex1 = new Vector3 (0, 0, 0),
|
|
3275
|
+
vertex2 = new Vector3 (0, 0, 0);
|
|
3255
3276
|
|
|
3256
|
-
|
|
3277
|
+
return function ()
|
|
3257
3278
|
{
|
|
3258
|
-
|
|
3279
|
+
var vertices = this .vertices = this .polylineNode .getVertices () .getValue ();
|
|
3259
3280
|
|
|
3260
|
-
|
|
3261
|
-
lengthSoFar = 0,
|
|
3262
|
-
lengthSoFarArray = this .lengthSoFarArray;
|
|
3263
|
-
|
|
3264
|
-
lengthSoFarArray .length = 1;
|
|
3265
|
-
|
|
3266
|
-
for (var i = 0, length = vertices .length; i < length; i += 8)
|
|
3281
|
+
if (vertices .length)
|
|
3267
3282
|
{
|
|
3268
|
-
|
|
3269
|
-
|
|
3283
|
+
delete this .getRandomPosition;
|
|
3284
|
+
|
|
3285
|
+
var
|
|
3286
|
+
lengthSoFar = 0,
|
|
3287
|
+
lengthSoFarArray = this .lengthSoFarArray;
|
|
3288
|
+
|
|
3289
|
+
lengthSoFarArray .length = 1;
|
|
3270
3290
|
|
|
3271
|
-
|
|
3272
|
-
|
|
3291
|
+
for (var i = 0, length = vertices .length; i < length; i += 8)
|
|
3292
|
+
{
|
|
3293
|
+
vertex1 .set (vertices [i], vertices [i + 1], vertices [i + 2]);
|
|
3294
|
+
vertex2 .set (vertices [i + 4], vertices [i + 5], vertices [i + 6]);
|
|
3295
|
+
|
|
3296
|
+
lengthSoFar += vertex2 .subtract (vertex1) .abs ();
|
|
3297
|
+
lengthSoFarArray .push (lengthSoFar);
|
|
3298
|
+
}
|
|
3273
3299
|
}
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
}
|
|
3279
|
-
},
|
|
3300
|
+
else
|
|
3301
|
+
{
|
|
3302
|
+
this .getRandomPosition = getPosition;
|
|
3303
|
+
}
|
|
3304
|
+
};
|
|
3305
|
+
})(),
|
|
3280
3306
|
getRandomPosition: function (position)
|
|
3281
3307
|
{
|
|
3282
3308
|
// Determine index0 and weight.
|
|
@@ -3284,7 +3310,7 @@ function (Fields,
|
|
|
3284
3310
|
var
|
|
3285
3311
|
lengthSoFarArray = this .lengthSoFarArray,
|
|
3286
3312
|
length = lengthSoFarArray .length,
|
|
3287
|
-
fraction = Math .random () * lengthSoFarArray
|
|
3313
|
+
fraction = Math .random () * lengthSoFarArray .at (-1),
|
|
3288
3314
|
index0 = 0,
|
|
3289
3315
|
index1 = 0,
|
|
3290
3316
|
weight = 0;
|
|
@@ -3294,7 +3320,7 @@ function (Fields,
|
|
|
3294
3320
|
index0 = 0;
|
|
3295
3321
|
weight = 0;
|
|
3296
3322
|
}
|
|
3297
|
-
else if (fraction >= lengthSoFarArray
|
|
3323
|
+
else if (fraction >= lengthSoFarArray .at (-1))
|
|
3298
3324
|
{
|
|
3299
3325
|
index0 = length - 2;
|
|
3300
3326
|
weight = 1;
|
|
@@ -3307,11 +3333,11 @@ function (Fields,
|
|
|
3307
3333
|
{
|
|
3308
3334
|
index1 = index;
|
|
3309
3335
|
index0 = index - 1;
|
|
3310
|
-
|
|
3336
|
+
|
|
3311
3337
|
var
|
|
3312
3338
|
key0 = lengthSoFarArray [index0],
|
|
3313
3339
|
key1 = lengthSoFarArray [index1];
|
|
3314
|
-
|
|
3340
|
+
|
|
3315
3341
|
weight = Algorithm .clamp ((fraction - key0) / (key1 - key0), 0, 1);
|
|
3316
3342
|
}
|
|
3317
3343
|
else
|
|
@@ -3326,14 +3352,18 @@ function (Fields,
|
|
|
3326
3352
|
index0 *= 8;
|
|
3327
3353
|
index1 = index0 + 4;
|
|
3328
3354
|
|
|
3329
|
-
var
|
|
3355
|
+
var
|
|
3356
|
+
vertices = this .vertices,
|
|
3357
|
+
x1 = vertices [index0],
|
|
3358
|
+
y1 = vertices [index0 + 1],
|
|
3359
|
+
z1 = vertices [index0 + 2],
|
|
3360
|
+
x2 = vertices [index1],
|
|
3361
|
+
y2 = vertices [index1 + 1],
|
|
3362
|
+
z2 = vertices [index1 + 2];
|
|
3330
3363
|
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
position .x = vertex1 .x + weight * (vertex2 .x - vertex1 .x);
|
|
3335
|
-
position .y = vertex1 .y + weight * (vertex2 .y - vertex1 .y);
|
|
3336
|
-
position .z = vertex1 .z + weight * (vertex2 .z - vertex1 .z);
|
|
3364
|
+
position .x = x1 + weight * (x2 - x1);
|
|
3365
|
+
position .y = y1 + weight * (y2 - y1);
|
|
3366
|
+
position .z = z1 + weight * (z2 - z1);
|
|
3337
3367
|
|
|
3338
3368
|
return position;
|
|
3339
3369
|
},
|
|
@@ -3359,8 +3389,6 @@ function (Fields,
|
|
|
3359
3389
|
return PolylineEmitter;
|
|
3360
3390
|
});
|
|
3361
3391
|
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
3392
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3365
3393
|
*******************************************************************************
|
|
3366
3394
|
*
|
|
@@ -3424,7 +3452,7 @@ define ('x_ite/Components/ParticleSystems/SurfaceEmitter',[
|
|
|
3424
3452
|
function (Fields,
|
|
3425
3453
|
X3DFieldDefinition,
|
|
3426
3454
|
FieldDefinitionArray,
|
|
3427
|
-
X3DParticleEmitterNode,
|
|
3455
|
+
X3DParticleEmitterNode,
|
|
3428
3456
|
X3DConstants,
|
|
3429
3457
|
X3DCast,
|
|
3430
3458
|
Triangle3,
|
|
@@ -3433,12 +3461,6 @@ function (Fields,
|
|
|
3433
3461
|
{
|
|
3434
3462
|
"use strict";
|
|
3435
3463
|
|
|
3436
|
-
var
|
|
3437
|
-
vertex1 = new Vector3 (0, 0, 0),
|
|
3438
|
-
vertex2 = new Vector3 (0, 0, 0),
|
|
3439
|
-
vertex3 = new Vector3 (0, 0, 0),
|
|
3440
|
-
direction = new Vector3 (0, 0, 0);
|
|
3441
|
-
|
|
3442
3464
|
function SurfaceEmitter (executionContext)
|
|
3443
3465
|
{
|
|
3444
3466
|
X3DParticleEmitterNode .call (this, executionContext);
|
|
@@ -3451,6 +3473,7 @@ function (Fields,
|
|
|
3451
3473
|
|
|
3452
3474
|
this .surfaceNode = null;
|
|
3453
3475
|
this .areaSoFarArray = [ 0 ];
|
|
3476
|
+
this .direction = new Vector3 (0, 0, 0);
|
|
3454
3477
|
}
|
|
3455
3478
|
|
|
3456
3479
|
SurfaceEmitter .prototype = Object .assign (Object .create (X3DParticleEmitterNode .prototype),
|
|
@@ -3496,41 +3519,47 @@ function (Fields,
|
|
|
3496
3519
|
|
|
3497
3520
|
this .set_geometry__ ();
|
|
3498
3521
|
},
|
|
3499
|
-
set_geometry__: function ()
|
|
3522
|
+
set_geometry__: (function ()
|
|
3500
3523
|
{
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3524
|
+
var
|
|
3525
|
+
vertex1 = new Vector3 (0, 0, 0),
|
|
3526
|
+
vertex2 = new Vector3 (0, 0, 0),
|
|
3527
|
+
vertex3 = new Vector3 (0, 0, 0);
|
|
3505
3528
|
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
this .vertices = vertices;
|
|
3529
|
+
return function ()
|
|
3530
|
+
{
|
|
3531
|
+
if (this .surfaceNode)
|
|
3532
|
+
{
|
|
3533
|
+
delete this .getRandomPosition;
|
|
3534
|
+
delete this .getRandomVelocity;
|
|
3513
3535
|
|
|
3514
|
-
|
|
3536
|
+
var
|
|
3537
|
+
areaSoFar = 0,
|
|
3538
|
+
areaSoFarArray = this .areaSoFarArray,
|
|
3539
|
+
vertices = this .surfaceNode .getVertices () .getValue ();
|
|
3515
3540
|
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
vertex1 .set (vertices [i], vertices [i + 1], vertices [i + 2]);
|
|
3519
|
-
vertex2 .set (vertices [i + 4], vertices [i + 5], vertices [i + 6]);
|
|
3520
|
-
vertex3 .set (vertices [i + 8], vertices [i + 9], vertices [i + 10]);
|
|
3541
|
+
this .normals = this .surfaceNode .getNormals () .getValue ();
|
|
3542
|
+
this .vertices = vertices;
|
|
3521
3543
|
|
|
3522
|
-
|
|
3523
|
-
areaSoFarArray .push (areaSoFar);
|
|
3524
|
-
}
|
|
3525
|
-
}
|
|
3526
|
-
else
|
|
3527
|
-
{
|
|
3528
|
-
this .getRandomPosition = getPosition;
|
|
3529
|
-
this .getRandomVelocity = this .getSphericalRandomVelocity;
|
|
3544
|
+
areaSoFarArray .length = 1;
|
|
3530
3545
|
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3546
|
+
for (var i = 0, length = vertices .length; i < length; i += 12)
|
|
3547
|
+
{
|
|
3548
|
+
vertex1 .set (vertices [i], vertices [i + 1], vertices [i + 2]);
|
|
3549
|
+
vertex2 .set (vertices [i + 4], vertices [i + 5], vertices [i + 6]);
|
|
3550
|
+
vertex3 .set (vertices [i + 8], vertices [i + 9], vertices [i + 10]);
|
|
3551
|
+
|
|
3552
|
+
areaSoFar += Triangle3 .area (vertex1, vertex2, vertex3);
|
|
3553
|
+
areaSoFarArray .push (areaSoFar);
|
|
3554
|
+
}
|
|
3555
|
+
}
|
|
3556
|
+
else
|
|
3557
|
+
{
|
|
3558
|
+
this .getRandomPosition = getPosition;
|
|
3559
|
+
this .getRandomVelocity = this .getSphericalRandomVelocity;
|
|
3560
|
+
}
|
|
3561
|
+
};
|
|
3562
|
+
})(),
|
|
3534
3563
|
getRandomPosition: function (position)
|
|
3535
3564
|
{
|
|
3536
3565
|
// Determine index0.
|
|
@@ -3538,14 +3567,14 @@ function (Fields,
|
|
|
3538
3567
|
var
|
|
3539
3568
|
areaSoFarArray = this .areaSoFarArray,
|
|
3540
3569
|
length = areaSoFarArray .length,
|
|
3541
|
-
fraction = Math .random () * areaSoFarArray
|
|
3570
|
+
fraction = Math .random () * areaSoFarArray .at (-1),
|
|
3542
3571
|
index0 = 0;
|
|
3543
3572
|
|
|
3544
3573
|
if (length == 1 || fraction <= areaSoFarArray [0])
|
|
3545
3574
|
{
|
|
3546
3575
|
index0 = 0;
|
|
3547
3576
|
}
|
|
3548
|
-
else if (fraction >= areaSoFarArray
|
|
3577
|
+
else if (fraction >= areaSoFarArray .at (-1))
|
|
3549
3578
|
{
|
|
3550
3579
|
index0 = length - 2;
|
|
3551
3580
|
}
|
|
@@ -3568,28 +3597,29 @@ function (Fields,
|
|
|
3568
3597
|
var
|
|
3569
3598
|
u = Math .random (),
|
|
3570
3599
|
v = Math .random ();
|
|
3571
|
-
|
|
3600
|
+
|
|
3572
3601
|
if (u + v > 1)
|
|
3573
3602
|
{
|
|
3574
3603
|
u = 1 - u;
|
|
3575
3604
|
v = 1 - v;
|
|
3576
3605
|
}
|
|
3577
3606
|
|
|
3607
|
+
var t = 1 - u - v;
|
|
3608
|
+
|
|
3578
3609
|
// Interpolate and set position.
|
|
3579
3610
|
|
|
3580
3611
|
var
|
|
3581
3612
|
i = index0 * 12,
|
|
3582
3613
|
vertices = this .vertices;
|
|
3583
3614
|
|
|
3584
|
-
var t = 1 - u - v;
|
|
3585
|
-
|
|
3586
3615
|
position .x = u * vertices [i] + v * vertices [i + 4] + t * vertices [i + 8];
|
|
3587
3616
|
position .y = u * vertices [i + 1] + v * vertices [i + 5] + t * vertices [i + 9];
|
|
3588
3617
|
position .z = u * vertices [i + 2] + v * vertices [i + 6] + t * vertices [i + 10];
|
|
3589
3618
|
|
|
3590
3619
|
var
|
|
3591
|
-
i
|
|
3592
|
-
normals
|
|
3620
|
+
i = index0 * 9,
|
|
3621
|
+
normals = this .normals,
|
|
3622
|
+
direction = this .direction;
|
|
3593
3623
|
|
|
3594
3624
|
direction .x = u * normals [i] + v * normals [i + 3] + t * normals [i + 6];
|
|
3595
3625
|
direction .y = u * normals [i + 1] + v * normals [i + 4] + t * normals [i + 7];
|
|
@@ -3599,7 +3629,9 @@ function (Fields,
|
|
|
3599
3629
|
},
|
|
3600
3630
|
getRandomVelocity: function (velocity)
|
|
3601
3631
|
{
|
|
3602
|
-
var
|
|
3632
|
+
var
|
|
3633
|
+
speed = this .getRandomSpeed (),
|
|
3634
|
+
direction = this .direction;
|
|
3603
3635
|
|
|
3604
3636
|
velocity .x = direction .x * speed;
|
|
3605
3637
|
velocity .y = direction .y * speed;
|
|
@@ -3617,8 +3649,6 @@ function (Fields,
|
|
|
3617
3649
|
return SurfaceEmitter;
|
|
3618
3650
|
});
|
|
3619
3651
|
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
3652
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3623
3653
|
*******************************************************************************
|
|
3624
3654
|
*
|
|
@@ -3701,21 +3731,6 @@ function (Fields,
|
|
|
3701
3731
|
{
|
|
3702
3732
|
"use strict";
|
|
3703
3733
|
|
|
3704
|
-
var
|
|
3705
|
-
vertex1 = new Vector3 (0, 0, 0),
|
|
3706
|
-
vertex2 = new Vector3 (0, 0, 0),
|
|
3707
|
-
vertex3 = new Vector3 (0, 0, 0),
|
|
3708
|
-
point = new Vector3 (0, 0, 0),
|
|
3709
|
-
normal = new Vector3 (0, 0, 0),
|
|
3710
|
-
rotation = new Rotation4 (0, 0, 1, 0),
|
|
3711
|
-
line = new Line3 (Vector3 .Zero, Vector3 .zAxis),
|
|
3712
|
-
plane = new Plane3 (Vector3 .Zero, Vector3 .zAxis);
|
|
3713
|
-
|
|
3714
|
-
function PlaneCompare (a, b)
|
|
3715
|
-
{
|
|
3716
|
-
return plane .getDistanceToPoint (a) < plane .getDistanceToPoint (b);
|
|
3717
|
-
}
|
|
3718
|
-
|
|
3719
3734
|
function VolumeEmitter (executionContext)
|
|
3720
3735
|
{
|
|
3721
3736
|
X3DParticleEmitterNode .call (this, executionContext);
|
|
@@ -3729,8 +3744,6 @@ function (Fields,
|
|
|
3729
3744
|
this .direction = new Vector3 (0, 0, 0);
|
|
3730
3745
|
this .volumeNode = new IndexedFaceSet (executionContext);
|
|
3731
3746
|
this .areaSoFarArray = [ 0 ];
|
|
3732
|
-
this .intersections = [ ];
|
|
3733
|
-
this .sorter = new QuickSort (this .intersections, PlaneCompare);
|
|
3734
3747
|
}
|
|
3735
3748
|
|
|
3736
3749
|
VolumeEmitter .prototype = Object .assign (Object .create (X3DParticleEmitterNode .prototype),
|
|
@@ -3767,7 +3780,7 @@ function (Fields,
|
|
|
3767
3780
|
|
|
3768
3781
|
this .coordIndex_ .addFieldInterest (this .volumeNode .coordIndex_);
|
|
3769
3782
|
this .coord_ .addFieldInterest (this .volumeNode .coord_);
|
|
3770
|
-
|
|
3783
|
+
|
|
3771
3784
|
this .volumeNode .creaseAngle_ = Math .PI;
|
|
3772
3785
|
this .volumeNode .convex_ = false;
|
|
3773
3786
|
this .volumeNode .coordIndex_ = this .coordIndex_;
|
|
@@ -3789,140 +3802,163 @@ function (Fields,
|
|
|
3789
3802
|
else
|
|
3790
3803
|
delete this .getRandomVelocity;
|
|
3791
3804
|
},
|
|
3792
|
-
set_geometry__: function ()
|
|
3805
|
+
set_geometry__: (function ()
|
|
3793
3806
|
{
|
|
3794
3807
|
var
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
vertices = this .volumeNode .getVertices () .getValue ();
|
|
3799
|
-
|
|
3800
|
-
this .normals = normals;
|
|
3801
|
-
this .vertices = vertices;
|
|
3808
|
+
vertex1 = new Vector3 (0, 0, 0),
|
|
3809
|
+
vertex2 = new Vector3 (0, 0, 0),
|
|
3810
|
+
vertex3 = new Vector3 (0, 0, 0);
|
|
3802
3811
|
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
for (var i = 0, length = vertices .length; i < length; i += 12)
|
|
3812
|
+
return function ()
|
|
3806
3813
|
{
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3814
|
+
var
|
|
3815
|
+
areaSoFar = 0,
|
|
3816
|
+
areaSoFarArray = this .areaSoFarArray,
|
|
3817
|
+
normals = this .volumeNode .getNormals () .getValue (),
|
|
3818
|
+
vertices = this .volumeNode .getVertices () .getValue ();
|
|
3810
3819
|
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
}
|
|
3820
|
+
this .normals = normals;
|
|
3821
|
+
this .vertices = vertices;
|
|
3814
3822
|
|
|
3815
|
-
|
|
3816
|
-
},
|
|
3817
|
-
getRandomPosition: function (position)
|
|
3818
|
-
{
|
|
3819
|
-
// Get random point on surface
|
|
3823
|
+
areaSoFarArray .length = 1;
|
|
3820
3824
|
|
|
3821
|
-
|
|
3825
|
+
for (var i = 0, length = vertices .length; i < length; i += 12)
|
|
3826
|
+
{
|
|
3827
|
+
vertex1 .set (vertices [i], vertices [i + 1], vertices [i + 2]);
|
|
3828
|
+
vertex2 .set (vertices [i + 4], vertices [i + 5], vertices [i + 6]);
|
|
3829
|
+
vertex3 .set (vertices [i + 8], vertices [i + 9], vertices [i + 10]);
|
|
3822
3830
|
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
fraction = Math .random () * areaSoFarArray [length - 1],
|
|
3827
|
-
index0 = 0;
|
|
3831
|
+
areaSoFar += Triangle3 .area (vertex1, vertex2, vertex3);
|
|
3832
|
+
areaSoFarArray .push (areaSoFar);
|
|
3833
|
+
}
|
|
3828
3834
|
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3835
|
+
this .bvh = new BVH (vertices, normals);
|
|
3836
|
+
};
|
|
3837
|
+
})(),
|
|
3838
|
+
getRandomPosition: (function ()
|
|
3839
|
+
{
|
|
3840
|
+
var
|
|
3841
|
+
point = new Vector3 (0, 0, 0),
|
|
3842
|
+
normal = new Vector3 (0, 0, 0),
|
|
3843
|
+
rotation = new Rotation4 (0, 0, 1, 0),
|
|
3844
|
+
line = new Line3 (Vector3 .Zero, Vector3 .zAxis),
|
|
3845
|
+
plane = new Plane3 (Vector3 .Zero, Vector3 .zAxis),
|
|
3846
|
+
intersections = [ ],
|
|
3847
|
+
sorter = new QuickSort (intersections, PlaneCompare);
|
|
3848
|
+
|
|
3849
|
+
function PlaneCompare (a, b)
|
|
3834
3850
|
{
|
|
3835
|
-
|
|
3851
|
+
return plane .getDistanceToPoint (a) < plane .getDistanceToPoint (b);
|
|
3836
3852
|
}
|
|
3837
|
-
|
|
3853
|
+
|
|
3854
|
+
return function (position)
|
|
3838
3855
|
{
|
|
3839
|
-
|
|
3856
|
+
// Get random point on surface
|
|
3840
3857
|
|
|
3841
|
-
|
|
3858
|
+
// Determine index0.
|
|
3859
|
+
|
|
3860
|
+
var
|
|
3861
|
+
areaSoFarArray = this .areaSoFarArray,
|
|
3862
|
+
length = areaSoFarArray .length,
|
|
3863
|
+
fraction = Math .random () * areaSoFarArray .at (-1),
|
|
3864
|
+
index0 = 0;
|
|
3865
|
+
|
|
3866
|
+
if (length == 1 || fraction <= areaSoFarArray [0])
|
|
3842
3867
|
{
|
|
3843
|
-
index0 =
|
|
3868
|
+
index0 = 0;
|
|
3869
|
+
}
|
|
3870
|
+
else if (fraction >= areaSoFarArray .at (-1))
|
|
3871
|
+
{
|
|
3872
|
+
index0 = length - 2;
|
|
3844
3873
|
}
|
|
3845
3874
|
else
|
|
3846
3875
|
{
|
|
3847
|
-
|
|
3876
|
+
var index = Algorithm .upperBound (areaSoFarArray, 0, length, fraction, Algorithm .less);
|
|
3877
|
+
|
|
3878
|
+
if (index < length)
|
|
3879
|
+
{
|
|
3880
|
+
index0 = index - 1;
|
|
3881
|
+
}
|
|
3882
|
+
else
|
|
3883
|
+
{
|
|
3884
|
+
index0 = 0;
|
|
3885
|
+
}
|
|
3848
3886
|
}
|
|
3849
|
-
}
|
|
3850
3887
|
|
|
3851
|
-
|
|
3888
|
+
// Random barycentric coordinates.
|
|
3852
3889
|
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
if (u + v > 1)
|
|
3858
|
-
{
|
|
3859
|
-
u = 1 - u;
|
|
3860
|
-
v = 1 - v;
|
|
3861
|
-
}
|
|
3890
|
+
var
|
|
3891
|
+
u = Math .random (),
|
|
3892
|
+
v = Math .random ();
|
|
3862
3893
|
|
|
3863
|
-
|
|
3894
|
+
if (u + v > 1)
|
|
3895
|
+
{
|
|
3896
|
+
u = 1 - u;
|
|
3897
|
+
v = 1 - v;
|
|
3898
|
+
}
|
|
3864
3899
|
|
|
3865
|
-
|
|
3900
|
+
var t = 1 - u - v;
|
|
3866
3901
|
|
|
3867
|
-
|
|
3868
|
-
i = index0 * 12,
|
|
3869
|
-
vertices = this .vertices;
|
|
3902
|
+
// Interpolate and determine random point on surface and normal.
|
|
3870
3903
|
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3904
|
+
var
|
|
3905
|
+
i = index0 * 12,
|
|
3906
|
+
vertices = this .vertices;
|
|
3874
3907
|
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3908
|
+
point .x = u * vertices [i] + v * vertices [i + 4] + t * vertices [i + 8];
|
|
3909
|
+
point .y = u * vertices [i + 1] + v * vertices [i + 5] + t * vertices [i + 9];
|
|
3910
|
+
point .z = u * vertices [i + 2] + v * vertices [i + 6] + t * vertices [i + 10];
|
|
3878
3911
|
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3912
|
+
var
|
|
3913
|
+
i = index0 * 9,
|
|
3914
|
+
normals = this .normals;
|
|
3882
3915
|
|
|
3883
|
-
|
|
3884
|
-
|
|
3916
|
+
normal .x = u * normals [i] + v * normals [i + 3] + t * normals [i + 6];
|
|
3917
|
+
normal .y = u * normals [i + 1] + v * normals [i + 4] + t * normals [i + 7];
|
|
3918
|
+
normal .z = u * normals [i + 2] + v * normals [i + 5] + t * normals [i + 8];
|
|
3885
3919
|
|
|
3886
|
-
|
|
3887
|
-
|
|
3920
|
+
rotation .setFromToVec (Vector3 .zAxis, normal);
|
|
3921
|
+
rotation .multVecRot (this .getRandomSurfaceNormal (normal));
|
|
3888
3922
|
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
// Find random point in volume.
|
|
3923
|
+
// Setup random line throu volume for intersection text
|
|
3924
|
+
// and a plane corresponding to the line for intersection sorting.
|
|
3893
3925
|
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
numIntersections = this .bvh .intersectsLine (line, intersections);
|
|
3926
|
+
line .set (point, normal);
|
|
3927
|
+
plane .set (point, normal);
|
|
3897
3928
|
|
|
3898
|
-
|
|
3929
|
+
// Find random point in volume.
|
|
3899
3930
|
|
|
3900
|
-
|
|
3901
|
-
{
|
|
3902
|
-
// Sort intersections along line with a little help from the plane.
|
|
3931
|
+
var numIntersections = this .bvh .intersectsLine (line, intersections);
|
|
3903
3932
|
|
|
3904
|
-
|
|
3933
|
+
numIntersections -= numIntersections % 2; // We need an even count of intersections.
|
|
3905
3934
|
|
|
3906
|
-
|
|
3935
|
+
if (numIntersections)
|
|
3936
|
+
{
|
|
3937
|
+
// Sort intersections along line with a little help from the plane.
|
|
3907
3938
|
|
|
3908
|
-
|
|
3909
|
-
index = Math .round (this .getRandomValue (0, numIntersections / 2 - 1)) * 2,
|
|
3910
|
-
point0 = intersections [index],
|
|
3911
|
-
point1 = intersections [index + 1],
|
|
3912
|
-
t = Math .random ();
|
|
3913
|
-
|
|
3914
|
-
// lerp
|
|
3915
|
-
position .x = point0 .x + (point1 .x - point0 .x) * t;
|
|
3916
|
-
position .y = point0 .y + (point1 .y - point0 .y) * t;
|
|
3917
|
-
position .z = point0 .z + (point1 .z - point0 .z) * t;
|
|
3918
|
-
|
|
3919
|
-
return position;
|
|
3920
|
-
}
|
|
3939
|
+
sorter .sort (0, numIntersections);
|
|
3921
3940
|
|
|
3922
|
-
|
|
3941
|
+
// Select random intersection pair.
|
|
3923
3942
|
|
|
3924
|
-
|
|
3925
|
-
|
|
3943
|
+
var
|
|
3944
|
+
index = Math .round (this .getRandomValue (0, numIntersections / 2 - 1)) * 2,
|
|
3945
|
+
point0 = intersections [index],
|
|
3946
|
+
point1 = intersections [index + 1],
|
|
3947
|
+
t = Math .random ();
|
|
3948
|
+
|
|
3949
|
+
// lerp
|
|
3950
|
+
position .x = point0 .x + (point1 .x - point0 .x) * t;
|
|
3951
|
+
position .y = point0 .y + (point1 .y - point0 .y) * t;
|
|
3952
|
+
position .z = point0 .z + (point1 .z - point0 .z) * t;
|
|
3953
|
+
|
|
3954
|
+
return position;
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
// Discard point.
|
|
3958
|
+
|
|
3959
|
+
return position .set (Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY, Number .POSITIVE_INFINITY);
|
|
3960
|
+
};
|
|
3961
|
+
})(),
|
|
3926
3962
|
getRandomVelocity: function (velocity)
|
|
3927
3963
|
{
|
|
3928
3964
|
var
|
|
@@ -3940,8 +3976,6 @@ function (Fields,
|
|
|
3940
3976
|
return VolumeEmitter;
|
|
3941
3977
|
});
|
|
3942
3978
|
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
3979
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
3946
3980
|
*******************************************************************************
|
|
3947
3981
|
*
|
|
@@ -4010,8 +4044,6 @@ function (Fields,
|
|
|
4010
4044
|
{
|
|
4011
4045
|
"use strict";
|
|
4012
4046
|
|
|
4013
|
-
var force = new Vector3 (0, 0, 0);
|
|
4014
|
-
|
|
4015
4047
|
function WindPhysicsModel (executionContext)
|
|
4016
4048
|
{
|
|
4017
4049
|
X3DParticlePhysicsModelNode .call (this, executionContext);
|
|
@@ -4052,25 +4084,30 @@ function (Fields,
|
|
|
4052
4084
|
|
|
4053
4085
|
return emitterNode .getRandomValue (Math .max (0, speed - variation), speed + variation);
|
|
4054
4086
|
},
|
|
4055
|
-
addForce: function (
|
|
4087
|
+
addForce: (function ()
|
|
4056
4088
|
{
|
|
4057
|
-
var
|
|
4089
|
+
var force = new Vector3 (0, 0, 0);
|
|
4058
4090
|
|
|
4059
|
-
|
|
4091
|
+
return function (i, emitterNode, forces, turbulences)
|
|
4060
4092
|
{
|
|
4061
|
-
var
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4093
|
+
var surfaceArea = emitterNode .surfaceArea_ .getValue ()
|
|
4094
|
+
|
|
4095
|
+
if (this .enabled_ .getValue ())
|
|
4096
|
+
{
|
|
4097
|
+
var
|
|
4098
|
+
randomSpeed = this .getRandomSpeed (emitterNode),
|
|
4099
|
+
pressure = Math .pow (10, 2 * Math .log (randomSpeed)) * 0.64615;
|
|
4100
|
+
|
|
4101
|
+
if (this .direction_ .getValue () .equals (Vector3 .Zero))
|
|
4102
|
+
emitterNode .getRandomNormal (force);
|
|
4103
|
+
else
|
|
4104
|
+
force .assign (this .direction_ .getValue ()) .normalize ();
|
|
4105
|
+
|
|
4106
|
+
forces [i] .assign (force .multiply (surfaceArea * pressure));
|
|
4107
|
+
turbulences [i] = Math .PI * Algorithm .clamp (this .turbulence_ .getValue (), 0, 1);
|
|
4108
|
+
}
|
|
4109
|
+
};
|
|
4110
|
+
})(),
|
|
4074
4111
|
});
|
|
4075
4112
|
|
|
4076
4113
|
return WindPhysicsModel;
|
|
@@ -4126,7 +4163,7 @@ function (Fields,
|
|
|
4126
4163
|
******************************************************************************/
|
|
4127
4164
|
|
|
4128
4165
|
|
|
4129
|
-
define ([
|
|
4166
|
+
define (require .getComponentUrl ("particle-systems"), [
|
|
4130
4167
|
"x_ite/Components",
|
|
4131
4168
|
"x_ite/Browser/ParticleSystems/X3DParticleSystemsContext",
|
|
4132
4169
|
"x_ite/Components/ParticleSystems/BoundedPhysicsModel",
|
|
@@ -4179,10 +4216,11 @@ function (Components,
|
|
|
4179
4216
|
X3DParticleEmitterNode: X3DParticleEmitterNode,
|
|
4180
4217
|
X3DParticlePhysicsModelNode: X3DParticlePhysicsModelNode,
|
|
4181
4218
|
},
|
|
4182
|
-
browser: X3DParticleSystemsContext
|
|
4219
|
+
browser: X3DParticleSystemsContext,
|
|
4183
4220
|
});
|
|
4184
4221
|
});
|
|
4185
4222
|
|
|
4186
4223
|
|
|
4187
4224
|
|
|
4188
|
-
}
|
|
4225
|
+
})
|
|
4226
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|