x_ite 4.0.5 → 4.7.5

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