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
@@ -0,0 +1,2481 @@
1
+ (function () {
2
+
3
+ var
4
+ define = X3D .define,
5
+ require = X3D .require,
6
+ module = { };
7
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
8
+ *******************************************************************************
9
+ *
10
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
11
+ *
12
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
13
+ *
14
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
15
+ *
16
+ * The copyright notice above does not evidence any actual of intended
17
+ * publication of such source code, and is an unpublished work by create3000.
18
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
19
+ * create3000.
20
+ *
21
+ * No permission is granted to copy, distribute, or create derivative works from
22
+ * the contents of this software, in whole or in part, without the prior written
23
+ * permission of create3000.
24
+ *
25
+ * NON-MILITARY USE ONLY
26
+ *
27
+ * All create3000 software are effectively free software with a non-military use
28
+ * restriction. It is free. Well commented source is provided. You may reuse the
29
+ * source in any way you please with the exception anything that uses it must be
30
+ * marked to indicate is contains 'non-military use only' components.
31
+ *
32
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
+ *
34
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
35
+ *
36
+ * This file is part of the X_ITE Project.
37
+ *
38
+ * X_ITE is free software: you can redistribute it and/or modify it under the
39
+ * terms of the GNU General Public License version 3 only, as published by the
40
+ * Free Software Foundation.
41
+ *
42
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
43
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
44
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
45
+ * details (a copy is included in the LICENSE file that accompanied this code).
46
+ *
47
+ * You should have received a copy of the GNU General Public License version 3
48
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
49
+ * copy of the GPLv3 License.
50
+ *
51
+ * For Silvio, Joy and Adi.
52
+ *
53
+ ******************************************************************************/
54
+
55
+
56
+ define ('x_ite/Browser/Picking/MatchCriterion',[],function ()
57
+ {
58
+ "use strict";
59
+
60
+ var i = 0;
61
+
62
+ var MatchCriterion =
63
+ {
64
+ MATCH_ANY: i ++,
65
+ MATCH_EVERY: i ++,
66
+ MATCH_ONLY_ONE: i ++,
67
+ };
68
+
69
+ return MatchCriterion;
70
+ });
71
+
72
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
73
+ *******************************************************************************
74
+ *
75
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
76
+ *
77
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
78
+ *
79
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
80
+ *
81
+ * The copyright notice above does not evidence any actual of intended
82
+ * publication of such source code, and is an unpublished work by create3000.
83
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
84
+ * create3000.
85
+ *
86
+ * No permission is granted to copy, distribute, or create derivative works from
87
+ * the contents of this software, in whole or in part, without the prior written
88
+ * permission of create3000.
89
+ *
90
+ * NON-MILITARY USE ONLY
91
+ *
92
+ * All create3000 software are effectively free software with a non-military use
93
+ * restriction. It is free. Well commented source is provided. You may reuse the
94
+ * source in any way you please with the exception anything that uses it must be
95
+ * marked to indicate is contains 'non-military use only' components.
96
+ *
97
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
98
+ *
99
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
100
+ *
101
+ * This file is part of the X_ITE Project.
102
+ *
103
+ * X_ITE is free software: you can redistribute it and/or modify it under the
104
+ * terms of the GNU General Public License version 3 only, as published by the
105
+ * Free Software Foundation.
106
+ *
107
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
108
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
109
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
110
+ * details (a copy is included in the LICENSE file that accompanied this code).
111
+ *
112
+ * You should have received a copy of the GNU General Public License version 3
113
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
114
+ * copy of the GPLv3 License.
115
+ *
116
+ * For Silvio, Joy and Adi.
117
+ *
118
+ ******************************************************************************/
119
+
120
+
121
+ define ('x_ite/Browser/Picking/IntersectionType',[],function ()
122
+ {
123
+ "use strict";
124
+
125
+ var i = 0;
126
+
127
+ var IntersectionType =
128
+ {
129
+ BOUNDS: i ++,
130
+ GEOMETRY: i ++,
131
+ };
132
+
133
+ return IntersectionType;
134
+ });
135
+
136
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
137
+ *******************************************************************************
138
+ *
139
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
140
+ *
141
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
142
+ *
143
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
144
+ *
145
+ * The copyright notice above does not evidence any actual of intended
146
+ * publication of such source code, and is an unpublished work by create3000.
147
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
148
+ * create3000.
149
+ *
150
+ * No permission is granted to copy, distribute, or create derivative works from
151
+ * the contents of this software, in whole or in part, without the prior written
152
+ * permission of create3000.
153
+ *
154
+ * NON-MILITARY USE ONLY
155
+ *
156
+ * All create3000 software are effectively free software with a non-military use
157
+ * restriction. It is free. Well commented source is provided. You may reuse the
158
+ * source in any way you please with the exception anything that uses it must be
159
+ * marked to indicate is contains 'non-military use only' components.
160
+ *
161
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
162
+ *
163
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
164
+ *
165
+ * This file is part of the X_ITE Project.
166
+ *
167
+ * X_ITE is free software: you can redistribute it and/or modify it under the
168
+ * terms of the GNU General Public License version 3 only, as published by the
169
+ * Free Software Foundation.
170
+ *
171
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
172
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
173
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
174
+ * details (a copy is included in the LICENSE file that accompanied this code).
175
+ *
176
+ * You should have received a copy of the GNU General Public License version 3
177
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
178
+ * copy of the GPLv3 License.
179
+ *
180
+ * For Silvio, Joy and Adi.
181
+ *
182
+ ******************************************************************************/
183
+
184
+
185
+ define ('x_ite/Browser/Picking/SortOrder',[],function ()
186
+ {
187
+ "use strict";
188
+
189
+ var i = 0;
190
+
191
+ var SortOrder =
192
+ {
193
+ ANY: i ++,
194
+ CLOSEST: i ++,
195
+ ALL: i ++,
196
+ ALL_SORTED: i ++,
197
+ };
198
+
199
+ return SortOrder;
200
+ });
201
+
202
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
203
+ *******************************************************************************
204
+ *
205
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
206
+ *
207
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
208
+ *
209
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
210
+ *
211
+ * The copyright notice above does not evidence any actual of intended
212
+ * publication of such source code, and is an unpublished work by create3000.
213
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
214
+ * create3000.
215
+ *
216
+ * No permission is granted to copy, distribute, or create derivative works from
217
+ * the contents of this software, in whole or in part, without the prior written
218
+ * permission of create3000.
219
+ *
220
+ * NON-MILITARY USE ONLY
221
+ *
222
+ * All create3000 software are effectively free software with a non-military use
223
+ * restriction. It is free. Well commented source is provided. You may reuse the
224
+ * source in any way you please with the exception anything that uses it must be
225
+ * marked to indicate is contains 'non-military use only' components.
226
+ *
227
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
228
+ *
229
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
230
+ *
231
+ * This file is part of the X_ITE Project.
232
+ *
233
+ * X_ITE is free software: you can redistribute it and/or modify it under the
234
+ * terms of the GNU General Public License version 3 only, as published by the
235
+ * Free Software Foundation.
236
+ *
237
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
238
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
239
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
240
+ * details (a copy is included in the LICENSE file that accompanied this code).
241
+ *
242
+ * You should have received a copy of the GNU General Public License version 3
243
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
244
+ * copy of the GPLv3 License.
245
+ *
246
+ * For Silvio, Joy and Adi.
247
+ *
248
+ ******************************************************************************/
249
+
250
+
251
+ define ('x_ite/Components/Picking/X3DPickSensorNode',[
252
+ "x_ite/Fields",
253
+ "x_ite/Components/Core/X3DSensorNode",
254
+ "x_ite/Bits/TraverseType",
255
+ "x_ite/Bits/X3DConstants",
256
+ "x_ite/Browser/Picking/MatchCriterion",
257
+ "x_ite/Browser/Picking/IntersectionType",
258
+ "x_ite/Browser/Picking/SortOrder",
259
+ "standard/Math/Numbers/Matrix4",
260
+ "standard/Math/Algorithms/QuickSort",
261
+ "standard/Utility/ObjectCache",
262
+ ],
263
+ function (Fields,
264
+ X3DSensorNode,
265
+ TraverseType,
266
+ X3DConstants,
267
+ MatchCriterion,
268
+ IntersectionType,
269
+ SortOrder,
270
+ Matrix4,
271
+ QuickSort,
272
+ ObjectCache)
273
+ {
274
+ "use strict";
275
+
276
+ var ModelMatrixCache = ObjectCache (Matrix4);
277
+
278
+ function compareDistance (lhs, rhs) { return lhs .distance < rhs .distance; }
279
+
280
+ function X3DPickSensorNode (executionContext)
281
+ {
282
+ X3DSensorNode .call (this, executionContext);
283
+
284
+ this .addType (X3DConstants .X3DPickSensorNode);
285
+
286
+ this .objectType = new Set ();
287
+ this .intersectionType = IntersectionType .BOUNDS;
288
+ this .sortOrder = SortOrder .CLOSEST;
289
+ this .pickTargetNodes = new Set ();
290
+ this .modelMatrices = [ ];
291
+ this .targets = [ ];
292
+ this .targets .size = 0;
293
+ this .pickedTargets = [ ];
294
+ this .pickedTargetsSorter = new QuickSort (this .pickedTargets, compareDistance);
295
+ this .pickedGeometries = new Fields .MFNode (); // Must be unique for each X3DPickSensorNode.
296
+ }
297
+
298
+ X3DPickSensorNode .prototype = Object .assign (Object .create (X3DSensorNode .prototype),
299
+ {
300
+ constructor: X3DPickSensorNode,
301
+ initialize: function ()
302
+ {
303
+ this .isLive () .addInterest ("set_live__", this);
304
+
305
+ this .enabled_ .addInterest ("set_live__", this);
306
+ this .objectType_ .addInterest ("set_objectType__", this);
307
+ this .matchCriterion_ .addInterest ("set_matchCriterion__", this);
308
+ this .intersectionType_ .addInterest ("set_intersectionType__", this);
309
+ this .sortOrder_ .addInterest ("set_sortOrder__", this);
310
+ this .pickTarget_ .addInterest ("set_pickTarget__", this);
311
+
312
+ this .set_objectType__ ();
313
+ this .set_matchCriterion__ ();
314
+ this .set_intersectionType__ ();
315
+ this .set_sortOrder__ ();
316
+ this .set_pickTarget__ ();
317
+ },
318
+ getObjectType: function ()
319
+ {
320
+ return this .objectType;
321
+ },
322
+ getMatchCriterion: function ()
323
+ {
324
+ return this .matchCriterion;
325
+ },
326
+ getIntersectionType: function ()
327
+ {
328
+ return this .intersectionType;
329
+ },
330
+ getSortOrder: function ()
331
+ {
332
+ return this .sortOrder;
333
+ },
334
+ getModelMatrices: function ()
335
+ {
336
+ return this .modelMatrices;
337
+ },
338
+ getTargets: function ()
339
+ {
340
+ return this .targets;
341
+ },
342
+ getPickShape: (function ()
343
+ {
344
+ var pickShapes = new WeakMap ();
345
+
346
+ return function (geometryNode)
347
+ {
348
+ var pickShape = pickShapes .get (geometryNode);
349
+
350
+ if (pickShape !== undefined)
351
+ return pickShape;
352
+
353
+ var
354
+ shapeNode = this .getExecutionContext () .createNode ("Shape", false),
355
+ collidableShapeNode = this .getExecutionContext () .createNode ("CollidableShape", false);
356
+
357
+ shapeNode .setPrivate (true);
358
+ collidableShapeNode .setPrivate (true);
359
+ collidableShapeNode .setConvex (true);
360
+
361
+ shapeNode .geometry_ = geometryNode;
362
+ collidableShapeNode .shape_ = shapeNode;
363
+
364
+ shapeNode .setup ();
365
+ collidableShapeNode .setup ();
366
+
367
+ pickShapes .set (geometryNode, collidableShapeNode);
368
+
369
+ return collidableShapeNode;
370
+ };
371
+ })(),
372
+ getPickedGeometries: (function ()
373
+ {
374
+ return function ()
375
+ {
376
+ var
377
+ targets = this .targets,
378
+ numTargets = targets .size,
379
+ pickedTargets = this .pickedTargets,
380
+ pickedGeometries = this .pickedGeometries;
381
+
382
+ // Filter intersecting targets.
383
+
384
+ pickedTargets .length = 0;
385
+
386
+ for (var i = 0; i < numTargets; ++ i)
387
+ {
388
+ var target = targets [i];
389
+
390
+ if (target .intersected)
391
+ pickedTargets .push (target);
392
+ }
393
+
394
+ // No pickedTargets, return.
395
+
396
+ if (pickedTargets .length === 0)
397
+ {
398
+ pickedGeometries .length = 0;
399
+
400
+ return pickedGeometries;
401
+ }
402
+
403
+ // Return sorted pickedTargets.
404
+
405
+ switch (this .sortOrder)
406
+ {
407
+ case SortOrder .ANY:
408
+ {
409
+ pickedTargets .length = 1;
410
+ pickedGeometries [0] = this .getPickedGeometry (pickedTargets [0]);
411
+ pickedGeometries .length = 1;
412
+ break;
413
+ }
414
+ case SortOrder .CLOSEST:
415
+ {
416
+ this .pickedTargetsSorter .sort (0, pickedTargets .length);
417
+
418
+ pickedTargets .length = 1;
419
+ pickedGeometries [0] = this .getPickedGeometry (pickedTargets [0]);
420
+ pickedGeometries .length = 1;
421
+ break;
422
+ }
423
+ case SortOrder .ALL:
424
+ {
425
+ for (var i = 0, length = pickedTargets .length; i < length; ++ i)
426
+ pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
427
+
428
+ pickedGeometries .length = length;
429
+ break;
430
+ }
431
+ case SortOrder .ALL_SORTED:
432
+ {
433
+ this .pickedTargetsSorter .sort (0, pickedTargets .length);
434
+
435
+ for (var i = 0, length = pickedTargets .length; i < length; ++ i)
436
+ pickedGeometries [i] = this .getPickedGeometry (pickedTargets [i]);
437
+
438
+ pickedGeometries .length = length;
439
+ break;
440
+ }
441
+ }
442
+
443
+ return pickedGeometries;
444
+ };
445
+ })(),
446
+ getPickedGeometry: function (target)
447
+ {
448
+ var
449
+ executionContext = this .getExecutionContext (),
450
+ geometryNode = target .geometryNode;
451
+
452
+ if (geometryNode .getExecutionContext () === executionContext)
453
+ return geometryNode;
454
+
455
+ var instance = geometryNode .getExecutionContext ();
456
+
457
+ if (instance .getType () .indexOf (X3DConstants .X3DPrototypeInstance) !== -1 && instance .getExecutionContext () === executionContext)
458
+ return instance;
459
+
460
+ var pickingHierarchy = target .pickingHierarchy;
461
+
462
+ for (var i = pickingHierarchy .length - 1; i >= 0; -- i)
463
+ {
464
+ var node = pickingHierarchy [i];
465
+
466
+ if (node .getExecutionContext () === executionContext)
467
+ return node;
468
+
469
+ var instance = node .getExecutionContext ();
470
+
471
+ if (instance .getType () .indexOf (X3DConstants .X3DPrototypeInstance) !== -1 && instance .getExecutionContext () === executionContext)
472
+ return instance;
473
+ }
474
+
475
+ return null;
476
+ },
477
+ getPickedTargets: function ()
478
+ {
479
+ return this .pickedTargets;
480
+ },
481
+ set_live__: function ()
482
+ {
483
+ if (this .isLive () .getValue () && this .enabled_ .getValue () && ! this .objectType .has ("NONE"))
484
+ {
485
+ this .getBrowser () .addPickSensor (this);
486
+ this .setPickableObject (true);
487
+ }
488
+ else
489
+ {
490
+ this .getBrowser () .removePickSensor (this);
491
+ this .setPickableObject (false);
492
+ }
493
+ },
494
+ set_objectType__: function ()
495
+ {
496
+ this .objectType .clear ();
497
+
498
+ for (var i = 0, length = this .objectType_ .length; i < length; ++ i)
499
+ {
500
+ this .objectType .add (this .objectType_ [i]);
501
+ }
502
+
503
+ this .set_live__ ();
504
+ },
505
+ set_matchCriterion__: (function ()
506
+ {
507
+ var matchCriterions = new Map ([
508
+ ["MATCH_ANY", MatchCriterion .MATCH_ANY],
509
+ ["MATCH_EVERY", MatchCriterion .MATCH_EVERY],
510
+ ["MATCH_ONLY_ONE", MatchCriterion .MATCH_ONLY_ONE],
511
+ ]);
512
+
513
+ return function ()
514
+ {
515
+ this .matchCriterion = matchCriterions .get (this .matchCriterion_ .getValue ());
516
+
517
+ if (this .matchCriterion === undefined)
518
+ this .matchCriterion = MatchCriterionType .MATCH_ANY;
519
+ };
520
+ })(),
521
+ set_intersectionType__: (function ()
522
+ {
523
+ var intersectionTypes = new Map ([
524
+ ["BOUNDS", IntersectionType .BOUNDS],
525
+ ["GEOMETRY", IntersectionType .GEOMETRY],
526
+ ]);
527
+
528
+ return function ()
529
+ {
530
+ this .intersectionType = intersectionTypes .get (this .intersectionType_ .getValue ());
531
+
532
+ if (this .intersectionType === undefined)
533
+ this .intersectionType = IntersectionType .BOUNDS;
534
+ };
535
+ })(),
536
+ set_sortOrder__: (function ()
537
+ {
538
+ var sortOrders = new Map ([
539
+ ["ANY", SortOrder .ANY],
540
+ ["CLOSEST", SortOrder .CLOSEST],
541
+ ["ALL", SortOrder .ALL],
542
+ ["ALL_SORTED", SortOrder .ALL_SORTED],
543
+ ]);
544
+
545
+ return function ()
546
+ {
547
+ this .sortOrder = sortOrders .get (this .sortOrder_ .getValue ());
548
+
549
+ if (this .sortOrder === undefined)
550
+ this .sortOrder = SortOrder .CLOSEST;
551
+ };
552
+ })(),
553
+ set_pickTarget__: function ()
554
+ {
555
+ this .pickTargetNodes .clear ();
556
+
557
+ for (var i = 0, length = this .pickTarget_ .length; i < length; ++ i)
558
+ {
559
+ try
560
+ {
561
+ var
562
+ node = this .pickTarget_ [i] .getValue () .getInnerNode (),
563
+ type = node .getType ();
564
+
565
+ for (var t = type .length - 1; t >= 0; -- t)
566
+ {
567
+ switch (type [t])
568
+ {
569
+ case X3DConstants .Inline:
570
+ case X3DConstants .Shape:
571
+ case X3DConstants .X3DGroupingNode:
572
+ {
573
+ this .pickTargetNodes .add (node);
574
+ break;
575
+ }
576
+ default:
577
+ continue;
578
+ }
579
+ }
580
+ }
581
+ catch (error)
582
+ { }
583
+ }
584
+ },
585
+ traverse: function (type, renderObject)
586
+ {
587
+ // X3DPickSensorNode nodes are sorted out and only traversed during PICKING, except if is child of a LOD or Switch node.
588
+
589
+ if (type !== TraverseType .PICKING)
590
+ return;
591
+
592
+ if (this .getPickableObject ())
593
+ this .modelMatrices .push (ModelMatrixCache .pop () .assign (renderObject .getModelViewMatrix () .get ()));
594
+ },
595
+ collect: function (geometryNode, modelMatrix, pickingHierarchy)
596
+ {
597
+ var pickTargetNodes = this .pickTargetNodes;
598
+
599
+ var haveTarget = pickingHierarchy .some (function (node)
600
+ {
601
+ return pickTargetNodes .has (node);
602
+ });
603
+
604
+ if (haveTarget)
605
+ {
606
+ var targets = this .targets;
607
+
608
+ if (targets .size < targets .length)
609
+ {
610
+ var target = targets [targets .size];
611
+ }
612
+ else
613
+ {
614
+ var target = { modelMatrix: new Matrix4 (), pickingHierarchy: [ ], pickedPoint: [ ], intersections: [ ] };
615
+
616
+ targets .push (target);
617
+ }
618
+
619
+ ++ targets .size;
620
+
621
+ target .intersected = false;
622
+ target .geometryNode = geometryNode;
623
+ target .pickedPoint .length = 0;
624
+ target .intersections .length = 0;
625
+ target .modelMatrix .assign (modelMatrix);
626
+
627
+ var destPickingHierarchy = target .pickingHierarchy;
628
+
629
+ for (var i = 0, length = pickingHierarchy .length; i < length; ++ i)
630
+ destPickingHierarchy [i] = pickingHierarchy [i];
631
+
632
+ destPickingHierarchy .length = length;
633
+ }
634
+ },
635
+ process: function ()
636
+ {
637
+ var modelMatrices = this .modelMatrices;
638
+
639
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
640
+ ModelMatrixCache .push (modelMatrices [m]);
641
+
642
+ this .modelMatrices .length = 0;
643
+ this .targets .size = 0;
644
+ },
645
+ });
646
+
647
+ return X3DPickSensorNode;
648
+ });
649
+
650
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
651
+ *******************************************************************************
652
+ *
653
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
654
+ *
655
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
656
+ *
657
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
658
+ *
659
+ * The copyright notice above does not evidence any actual of intended
660
+ * publication of such source code, and is an unpublished work by create3000.
661
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
662
+ * create3000.
663
+ *
664
+ * No permission is granted to copy, distribute, or create derivative works from
665
+ * the contents of this software, in whole or in part, without the prior written
666
+ * permission of create3000.
667
+ *
668
+ * NON-MILITARY USE ONLY
669
+ *
670
+ * All create3000 software are effectively free software with a non-military use
671
+ * restriction. It is free. Well commented source is provided. You may reuse the
672
+ * source in any way you please with the exception anything that uses it must be
673
+ * marked to indicate is contains 'non-military use only' components.
674
+ *
675
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
676
+ *
677
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
678
+ *
679
+ * This file is part of the X_ITE Project.
680
+ *
681
+ * X_ITE is free software: you can redistribute it and/or modify it under the
682
+ * terms of the GNU General Public License version 3 only, as published by the
683
+ * Free Software Foundation.
684
+ *
685
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
686
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
687
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
688
+ * details (a copy is included in the LICENSE file that accompanied this code).
689
+ *
690
+ * You should have received a copy of the GNU General Public License version 3
691
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
692
+ * copy of the GPLv3 License.
693
+ *
694
+ * For Silvio, Joy and Adi.
695
+ *
696
+ ******************************************************************************/
697
+
698
+
699
+ define ('x_ite/Components/Picking/LinePickSensor',[
700
+ "x_ite/Fields",
701
+ "x_ite/Basic/X3DFieldDefinition",
702
+ "x_ite/Basic/FieldDefinitionArray",
703
+ "x_ite/Components/Picking/X3DPickSensorNode",
704
+ "x_ite/Bits/X3DConstants",
705
+ "x_ite/Browser/Picking/IntersectionType",
706
+ "standard/Math/Numbers/Vector3",
707
+ "standard/Math/Numbers/Matrix4",
708
+ "standard/Math/Geometry/Box3",
709
+ "standard/Math/Geometry/Line3",
710
+ ],
711
+ function (Fields,
712
+ X3DFieldDefinition,
713
+ FieldDefinitionArray,
714
+ X3DPickSensorNode,
715
+ X3DConstants,
716
+ IntersectionType,
717
+ Vector3,
718
+ Matrix4,
719
+ Box3,
720
+ Line3)
721
+ {
722
+ "use strict";
723
+
724
+ function LinePickSensor (executionContext)
725
+ {
726
+ X3DPickSensorNode .call (this, executionContext);
727
+
728
+ this .addType (X3DConstants .LinePickSensor);
729
+
730
+ this .pickingGeometryNode = null;
731
+ }
732
+
733
+ LinePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
734
+ {
735
+ constructor: LinePickSensor,
736
+ fieldDefinitions: new FieldDefinitionArray ([
737
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
738
+ new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
739
+ new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
740
+ new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
741
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
742
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
743
+ new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
744
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedTextureCoordinate", new Fields .MFVec3f ()),
745
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedNormal", new Fields .MFVec3f ()),
746
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedPoint", new Fields .MFVec3f ()),
747
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
748
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
749
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
750
+ ]),
751
+ getTypeName: function ()
752
+ {
753
+ return "LinePickSensor";
754
+ },
755
+ getComponentName: function ()
756
+ {
757
+ return "Picking";
758
+ },
759
+ getContainerField: function ()
760
+ {
761
+ return "children";
762
+ },
763
+ initialize: function ()
764
+ {
765
+ X3DPickSensorNode .prototype .initialize .call (this);
766
+
767
+ this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
768
+
769
+ this .set_pickingGeometry__ ();
770
+ },
771
+ set_pickingGeometry__: function ()
772
+ {
773
+ this .pickingGeometryNode = null;
774
+
775
+ try
776
+ {
777
+ var
778
+ node = this .pickingGeometry_ .getValue () .getInnerNode (),
779
+ type = node .getType ();
780
+
781
+ for (var t = type .length - 1; t >= 0; -- t)
782
+ {
783
+ switch (type [t])
784
+ {
785
+ case X3DConstants .IndexedLineSet:
786
+ case X3DConstants .LineSet:
787
+ {
788
+ this .pickingGeometryNode = node;
789
+ break;
790
+ }
791
+ default:
792
+ continue;
793
+ }
794
+ }
795
+ }
796
+ catch (error)
797
+ { }
798
+ },
799
+ process: (function ()
800
+ {
801
+ var
802
+ pickingBBox = new Box3 (),
803
+ targetBBox = new Box3 (),
804
+ pickingCenter = new Vector3 (0, 0, 0),
805
+ targetCenter = new Vector3 (0, 0, 0),
806
+ matrix = new Matrix4 (),
807
+ point1 = new Vector3 (0, 0, 0),
808
+ point2 = new Vector3 (0, 0, 0),
809
+ line = new Line3 (Vector3 .Zero, Vector3 .zAxis),
810
+ a = new Vector3 (0, 0, 0),
811
+ b = new Vector3 (0, 0, 0),
812
+ clipPlanes = [ ],
813
+ intersections = [ ],
814
+ texCoord = new Vector3 (0, 0, 0),
815
+ pickedTextureCoordinate = new Fields .MFVec3f (),
816
+ pickedNormal = new Fields .MFVec3f (),
817
+ pickedPoint = new Fields .MFVec3f ();
818
+
819
+ return function ()
820
+ {
821
+ if (this .pickingGeometryNode)
822
+ {
823
+ var
824
+ modelMatrices = this .getModelMatrices (),
825
+ targets = this .getTargets ();
826
+
827
+ switch (this .getIntersectionType ())
828
+ {
829
+ case IntersectionType .BOUNDS:
830
+ {
831
+ // Intersect bboxes.
832
+
833
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
834
+ {
835
+ var modelMatrix = modelMatrices [m];
836
+
837
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
838
+
839
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
840
+ {
841
+ var target = targets [t];
842
+
843
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
844
+
845
+ if (pickingBBox .intersectsBox (targetBBox))
846
+ {
847
+ pickingCenter .assign (pickingBBox .center);
848
+ targetCenter .assign (targetBBox .center);
849
+
850
+ target .intersected = true;
851
+ target .distance = pickingCenter .distance (targetCenter);
852
+ }
853
+ }
854
+ }
855
+
856
+ // Send events.
857
+
858
+ var
859
+ pickedGeometries = this .getPickedGeometries (),
860
+ active = Boolean (pickedGeometries .length);
861
+
862
+ pickedGeometries .remove (0, pickedGeometries .length, null);
863
+
864
+ if (active !== this .isActive_ .getValue ())
865
+ this .isActive_ = active;
866
+
867
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
868
+ this .pickedGeometry_ = pickedGeometries;
869
+
870
+ break;
871
+ }
872
+ case IntersectionType .GEOMETRY:
873
+ {
874
+ // Intersect geometry.
875
+
876
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
877
+ {
878
+ var modelMatrix = modelMatrices [m];
879
+
880
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
881
+
882
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
883
+ {
884
+ try
885
+ {
886
+ var
887
+ target = targets [t],
888
+ geometryNode = target .geometryNode,
889
+ vertices = this .pickingGeometryNode .getVertices ();
890
+
891
+ targetBBox .assign (geometryNode .getBBox ()) .multRight (target .modelMatrix);
892
+ matrix .assign (target .modelMatrix) .inverse () .multLeft (modelMatrix);
893
+
894
+ for (var v = 0, vLength = vertices .length; v < vLength; v += 8)
895
+ {
896
+ matrix .multVecMatrix (point1 .set (vertices [v + 0], vertices [v + 1], vertices [v + 2]));
897
+ matrix .multVecMatrix (point2 .set (vertices [v + 4], vertices [v + 5], vertices [v + 6]));
898
+ line .setPoints (point1, point2);
899
+
900
+ intersections .length = 0;
901
+
902
+ if (geometryNode .intersectsLine (line, clipPlanes, target .modelMatrix, intersections))
903
+ {
904
+ for (var i = 0, iLength = intersections .length; i < iLength; ++ i)
905
+ {
906
+ // Test if intersection.point is between point1 and point2.
907
+
908
+ var intersection = intersections [i];
909
+
910
+ a .assign (intersection .point) .subtract (point1);
911
+ b .assign (intersection .point) .subtract (point2);
912
+
913
+ var
914
+ c = a .add (b) .abs (),
915
+ s = point1 .distance (point2);
916
+
917
+ if (c <= s)
918
+ target .intersections .push (intersection);
919
+ }
920
+ }
921
+ }
922
+
923
+ if (target .intersections .length)
924
+ {
925
+ pickingCenter .assign (pickingBBox .center);
926
+ targetCenter .assign (targetBBox .center);
927
+
928
+ target .intersected = true;
929
+ target .distance = pickingCenter .distance (targetCenter);
930
+ }
931
+ }
932
+ catch (error)
933
+ {
934
+ // Catch inverse.
935
+ console .log (error);
936
+ }
937
+ }
938
+ }
939
+
940
+ // Send events.
941
+
942
+ var
943
+ pickedGeometries = this .getPickedGeometries (),
944
+ active = Boolean (pickedGeometries .length);
945
+
946
+ pickedGeometries .remove (0, pickedGeometries .length, null);
947
+
948
+ if (active !== this .isActive_ .getValue ())
949
+ this .isActive_ = active;
950
+
951
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
952
+ this .pickedGeometry_ = pickedGeometries;
953
+
954
+ var pickedTargets = this .getPickedTargets ();
955
+
956
+ pickedTextureCoordinate .length = 0;
957
+ pickedNormal .length = 0;
958
+ pickedPoint .length = 0;
959
+
960
+ for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
961
+ {
962
+ var pickedIntersections = pickedTargets [t] .intersections;
963
+
964
+ for (var i = 0, iLength = pickedIntersections .length; i < iLength; ++ i)
965
+ {
966
+ var
967
+ intersection = pickedIntersections [i],
968
+ t = intersection .texCoord;
969
+
970
+ texCoord .set (t .x, t .y, t .z);
971
+
972
+ pickedTextureCoordinate .push (texCoord);
973
+ pickedNormal .push (intersection .normal);
974
+ pickedPoint .push (intersection .point);
975
+ }
976
+ }
977
+
978
+ if (! this .pickedTextureCoordinate_ .equals (pickedTextureCoordinate))
979
+ this .pickedTextureCoordinate_ = pickedTextureCoordinate;
980
+
981
+ if (! this .pickedNormal_ .equals (pickedNormal))
982
+ this .pickedNormal_ = pickedNormal;
983
+
984
+ if (! this .pickedPoint_ .equals (pickedPoint))
985
+ this .pickedPoint_ = pickedPoint;
986
+
987
+ break;
988
+ }
989
+ }
990
+ }
991
+
992
+ X3DPickSensorNode .prototype .process .call (this);
993
+ };
994
+ })(),
995
+ });
996
+
997
+ return LinePickSensor;
998
+ });
999
+
1000
+
1001
+
1002
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1003
+ *******************************************************************************
1004
+ *
1005
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1006
+ *
1007
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1008
+ *
1009
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1010
+ *
1011
+ * The copyright notice above does not evidence any actual of intended
1012
+ * publication of such source code, and is an unpublished work by create3000.
1013
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1014
+ * create3000.
1015
+ *
1016
+ * No permission is granted to copy, distribute, or create derivative works from
1017
+ * the contents of this software, in whole or in part, without the prior written
1018
+ * permission of create3000.
1019
+ *
1020
+ * NON-MILITARY USE ONLY
1021
+ *
1022
+ * All create3000 software are effectively free software with a non-military use
1023
+ * restriction. It is free. Well commented source is provided. You may reuse the
1024
+ * source in any way you please with the exception anything that uses it must be
1025
+ * marked to indicate is contains 'non-military use only' components.
1026
+ *
1027
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1028
+ *
1029
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1030
+ *
1031
+ * This file is part of the X_ITE Project.
1032
+ *
1033
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1034
+ * terms of the GNU General Public License version 3 only, as published by the
1035
+ * Free Software Foundation.
1036
+ *
1037
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1038
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1039
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1040
+ * details (a copy is included in the LICENSE file that accompanied this code).
1041
+ *
1042
+ * You should have received a copy of the GNU General Public License version 3
1043
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1044
+ * copy of the GPLv3 License.
1045
+ *
1046
+ * For Silvio, Joy and Adi.
1047
+ *
1048
+ ******************************************************************************/
1049
+
1050
+
1051
+ define ('x_ite/Components/Picking/X3DPickableObject',[
1052
+ "x_ite/Bits/X3DConstants",
1053
+ ],
1054
+ function (X3DConstants)
1055
+ {
1056
+ "use strict";
1057
+
1058
+ function X3DPickableObject (executionContext)
1059
+ {
1060
+ this .addType (X3DConstants .X3DPickableObject);
1061
+
1062
+ this .objectType = new Set ();
1063
+ }
1064
+
1065
+ X3DPickableObject .prototype =
1066
+ {
1067
+ constructor: X3DPickableObject,
1068
+ initialize: function ()
1069
+ {
1070
+ this .objectType_ .addInterest ("set_objectType__", this);
1071
+
1072
+ this .set_objectType__ ();
1073
+ },
1074
+ getObjectType: function ()
1075
+ {
1076
+ return this .objectType;
1077
+ },
1078
+ set_objectType__: function ()
1079
+ {
1080
+ this .objectType .clear ();
1081
+
1082
+ for (var i = 0, length = this .objectType_ .length; i < length; ++ i)
1083
+ {
1084
+ this .objectType .add (this .objectType_ [i]);
1085
+ }
1086
+ },
1087
+ };
1088
+
1089
+ return X3DPickableObject;
1090
+ });
1091
+
1092
+
1093
+
1094
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1095
+ *******************************************************************************
1096
+ *
1097
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1098
+ *
1099
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1100
+ *
1101
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1102
+ *
1103
+ * The copyright notice above does not evidence any actual of intended
1104
+ * publication of such source code, and is an unpublished work by create3000.
1105
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1106
+ * create3000.
1107
+ *
1108
+ * No permission is granted to copy, distribute, or create derivative works from
1109
+ * the contents of this software, in whole or in part, without the prior written
1110
+ * permission of create3000.
1111
+ *
1112
+ * NON-MILITARY USE ONLY
1113
+ *
1114
+ * All create3000 software are effectively free software with a non-military use
1115
+ * restriction. It is free. Well commented source is provided. You may reuse the
1116
+ * source in any way you please with the exception anything that uses it must be
1117
+ * marked to indicate is contains 'non-military use only' components.
1118
+ *
1119
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1120
+ *
1121
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1122
+ *
1123
+ * This file is part of the X_ITE Project.
1124
+ *
1125
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1126
+ * terms of the GNU General Public License version 3 only, as published by the
1127
+ * Free Software Foundation.
1128
+ *
1129
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1130
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1131
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1132
+ * details (a copy is included in the LICENSE file that accompanied this code).
1133
+ *
1134
+ * You should have received a copy of the GNU General Public License version 3
1135
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1136
+ * copy of the GPLv3 License.
1137
+ *
1138
+ * For Silvio, Joy and Adi.
1139
+ *
1140
+ ******************************************************************************/
1141
+
1142
+
1143
+ define ('x_ite/Components/Picking/PickableGroup',[
1144
+ "x_ite/Fields",
1145
+ "x_ite/Basic/X3DFieldDefinition",
1146
+ "x_ite/Basic/FieldDefinitionArray",
1147
+ "x_ite/Components/Grouping/X3DGroupingNode",
1148
+ "x_ite/Components/Picking/X3DPickableObject",
1149
+ "x_ite/Browser/Picking/MatchCriterion",
1150
+ "x_ite/Bits/X3DConstants",
1151
+ "x_ite/Bits/TraverseType",
1152
+ ],
1153
+ function (Fields,
1154
+ X3DFieldDefinition,
1155
+ FieldDefinitionArray,
1156
+ X3DGroupingNode,
1157
+ X3DPickableObject,
1158
+ MatchCriterion,
1159
+ X3DConstants,
1160
+ TraverseType)
1161
+ {
1162
+ "use strict";
1163
+
1164
+ function PickableGroup (executionContext)
1165
+ {
1166
+ X3DGroupingNode .call (this, executionContext);
1167
+ X3DPickableObject .call (this, executionContext);
1168
+
1169
+ this .addType (X3DConstants .PickableGroup);
1170
+ }
1171
+
1172
+ PickableGroup .prototype = Object .assign (Object .create (X3DGroupingNode .prototype),
1173
+ X3DPickableObject .prototype,
1174
+ {
1175
+ constructor: PickableGroup,
1176
+ fieldDefinitions: new FieldDefinitionArray ([
1177
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1178
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickable", new Fields .SFBool (true)),
1179
+ new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
1180
+ new X3DFieldDefinition (X3DConstants .inputOutput, "visible", new Fields .SFBool (true)),
1181
+ new X3DFieldDefinition (X3DConstants .inputOutput, "bboxDisplay", new Fields .SFBool ()),
1182
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxSize", new Fields .SFVec3f (-1, -1, -1)),
1183
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "bboxCenter", new Fields .SFVec3f ()),
1184
+ new X3DFieldDefinition (X3DConstants .inputOnly, "addChildren", new Fields .MFNode ()),
1185
+ new X3DFieldDefinition (X3DConstants .inputOnly, "removeChildren", new Fields .MFNode ()),
1186
+ new X3DFieldDefinition (X3DConstants .inputOutput, "children", new Fields .MFNode ()),
1187
+ ]),
1188
+ getTypeName: function ()
1189
+ {
1190
+ return "PickableGroup";
1191
+ },
1192
+ getComponentName: function ()
1193
+ {
1194
+ return "Picking";
1195
+ },
1196
+ getContainerField: function ()
1197
+ {
1198
+ return "children";
1199
+ },
1200
+ initialize: function ()
1201
+ {
1202
+ X3DGroupingNode .prototype .initialize .call (this);
1203
+ X3DPickableObject .prototype .initialize .call (this);
1204
+
1205
+ this .pickable_ .addInterest ("set_pickable__", this);
1206
+
1207
+ this .set_pickable__ ();
1208
+ },
1209
+ set_pickableObjects__: function ()
1210
+ {
1211
+ this .set_pickable__ ();
1212
+ },
1213
+ set_pickable__: function ()
1214
+ {
1215
+ this .setPickableObject (Boolean (this .pickable_ .getValue () || this .getTransformSensors () .size));
1216
+ },
1217
+ traverse: (function ()
1218
+ {
1219
+ const pickSensorNodes = new Set ();
1220
+
1221
+ return function (type, renderObject)
1222
+ {
1223
+ if (type === TraverseType .PICKING)
1224
+ {
1225
+ if (this .pickable_ .getValue ())
1226
+ {
1227
+ if (this .getObjectType () .has ("NONE"))
1228
+ return;
1229
+
1230
+ const
1231
+ browser = renderObject .getBrowser (),
1232
+ pickableStack = browser .getPickable ();
1233
+
1234
+ if (this .getObjectType () .has ("ALL"))
1235
+ {
1236
+ pickableStack .push (true);
1237
+ X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
1238
+ pickableStack .pop ();
1239
+ }
1240
+ else
1241
+ {
1242
+ // Filter pick sensors.
1243
+
1244
+ const pickSensorStack = browser .getPickSensors ();
1245
+
1246
+ for (const pickSensorNode of pickSensorStack .at (-1))
1247
+ {
1248
+ if (! pickSensorNode .getObjectType () .has ("ALL"))
1249
+ {
1250
+ let intersection = 0;
1251
+
1252
+ for (const objectType of this .getObjectType ())
1253
+ {
1254
+ if (pickSensorNode .getObjectType () .has (objectType))
1255
+ {
1256
+ ++ intersection;
1257
+ break;
1258
+ }
1259
+ }
1260
+
1261
+ switch (pickSensorNode .getMatchCriterion ())
1262
+ {
1263
+ case MatchCriterion .MATCH_ANY:
1264
+ {
1265
+ if (intersection === 0)
1266
+ continue;
1267
+
1268
+ break;
1269
+ }
1270
+ case MatchCriterion .MATCH_EVERY:
1271
+ {
1272
+ if (intersection !== pickSensor .getObjectType () .size)
1273
+ continue;
1274
+
1275
+ break;
1276
+ }
1277
+ case MatchCriterion .MATCH_ONLY_ONE:
1278
+ {
1279
+ if (intersection !== 1)
1280
+ continue;
1281
+
1282
+ break;
1283
+ }
1284
+ }
1285
+ }
1286
+
1287
+ pickSensorNodes .add (pickSensorNode);
1288
+ }
1289
+
1290
+ pickableStack .push (true);
1291
+ pickSensorStack .push (pickSensorNodes);
1292
+
1293
+ X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
1294
+
1295
+ pickSensorStack .pop ();
1296
+ pickableStack .pop ();
1297
+
1298
+ pickSensorNodes .clear ();
1299
+ }
1300
+ }
1301
+ }
1302
+ else
1303
+ {
1304
+ X3DGroupingNode .prototype .traverse .call (this, type, renderObject);
1305
+ }
1306
+ };
1307
+ })(),
1308
+ });
1309
+
1310
+ return PickableGroup;
1311
+ });
1312
+
1313
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1314
+ *******************************************************************************
1315
+ *
1316
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1317
+ *
1318
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1319
+ *
1320
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1321
+ *
1322
+ * The copyright notice above does not evidence any actual of intended
1323
+ * publication of such source code, and is an unpublished work by create3000.
1324
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1325
+ * create3000.
1326
+ *
1327
+ * No permission is granted to copy, distribute, or create derivative works from
1328
+ * the contents of this software, in whole or in part, without the prior written
1329
+ * permission of create3000.
1330
+ *
1331
+ * NON-MILITARY USE ONLY
1332
+ *
1333
+ * All create3000 software are effectively free software with a non-military use
1334
+ * restriction. It is free. Well commented source is provided. You may reuse the
1335
+ * source in any way you please with the exception anything that uses it must be
1336
+ * marked to indicate is contains 'non-military use only' components.
1337
+ *
1338
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1339
+ *
1340
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1341
+ *
1342
+ * This file is part of the X_ITE Project.
1343
+ *
1344
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1345
+ * terms of the GNU General Public License version 3 only, as published by the
1346
+ * Free Software Foundation.
1347
+ *
1348
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1349
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1350
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1351
+ * details (a copy is included in the LICENSE file that accompanied this code).
1352
+ *
1353
+ * You should have received a copy of the GNU General Public License version 3
1354
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1355
+ * copy of the GPLv3 License.
1356
+ *
1357
+ * For Silvio, Joy and Adi.
1358
+ *
1359
+ ******************************************************************************/
1360
+
1361
+
1362
+ define ('x_ite/Browser/Picking/VolumePicker',[
1363
+ "standard/Math/Numbers/Vector3",
1364
+ "standard/Math/Numbers/Rotation4",
1365
+ "standard/Math/Numbers/Matrix4",
1366
+ X3D .getComponentUrl ("rigid-body-physics"),
1367
+ ],
1368
+ function (Vector3,
1369
+ Rotation4,
1370
+ Matrix4,
1371
+ RigidBodyPhysics)
1372
+ {
1373
+ "use strict";
1374
+
1375
+ var Ammo = RigidBodyPhysics .Ammo;
1376
+
1377
+ function VolumePicker ()
1378
+ {
1379
+ this .broadphase = new Ammo .btDbvtBroadphase ();
1380
+ this .collisionConfiguration = new Ammo .btDefaultCollisionConfiguration ();
1381
+ this .dispatcher = new Ammo .btCollisionDispatcher (this .collisionConfiguration);
1382
+ this .collisionWorld = new Ammo .btCollisionWorld (this .dispatcher, this .broadphase, this .collisionConfiguration);
1383
+
1384
+ this .compoundShape1 = new Ammo .btCompoundShape ();
1385
+ this .motionState1 = new Ammo .btDefaultMotionState ();
1386
+ this .constructionInfo1 = new Ammo .btRigidBodyConstructionInfo (0, this .motionState1, this .compoundShape1);
1387
+ this .rigidBody1 = new Ammo .btRigidBody (this .constructionInfo1);
1388
+
1389
+ this .compoundShape2 = new Ammo .btCompoundShape ();
1390
+ this .motionState2 = new Ammo .btDefaultMotionState ();
1391
+ this .constructionInfo2 = new Ammo .btRigidBodyConstructionInfo (0, this .motionState2, this .compoundShape2);
1392
+ this .rigidBody2 = new Ammo .btRigidBody (this .constructionInfo2);
1393
+
1394
+ this .collisionWorld .addCollisionObject (this .rigidBody1);
1395
+ this .collisionWorld .addCollisionObject (this .rigidBody2);
1396
+ }
1397
+
1398
+ VolumePicker .prototype =
1399
+ {
1400
+ constuctor: VolumePicker,
1401
+ setChildShape1: function (matrix, childShape)
1402
+ {
1403
+ this .setChildShape (this .compoundShape1, matrix, childShape);
1404
+ },
1405
+ setChildShape2: function (matrix, childShape)
1406
+ {
1407
+ this .setChildShape (this .compoundShape2, matrix, childShape);
1408
+ },
1409
+ setChildShape1Components: function (transform, localScaling, childShape)
1410
+ {
1411
+ this .setChildShapeComponents (this .compoundShape1, transform, localScaling, childShape);
1412
+ },
1413
+ setChildShape2Components: function (transform, localScaling, childShape)
1414
+ {
1415
+ this .setChildShapeComponents (this .compoundShape2, transform, localScaling, childShape);
1416
+ },
1417
+ setChildShape: (function ()
1418
+ {
1419
+ var
1420
+ translation = new Vector3 (0, 0, 0),
1421
+ rotation = new Rotation4 (0, 0, 1, 0),
1422
+ scale = new Vector3 (1, 1, 1),
1423
+ s = new Ammo .btVector3 (0, 0, 0);
1424
+
1425
+ return function (compoundShape, matrix, childShape)
1426
+ {
1427
+ try
1428
+ {
1429
+ if (compoundShape .getNumChildShapes ())
1430
+ compoundShape .removeChildShapeByIndex (0);
1431
+
1432
+ if (childShape .getNumChildShapes ())
1433
+ {
1434
+ matrix .get (translation, rotation, scale);
1435
+
1436
+ s .setValue (scale .x, scale .y, scale .z);
1437
+
1438
+ childShape .setLocalScaling (s);
1439
+ compoundShape .addChildShape (this .getTransform (translation, rotation), childShape);
1440
+ }
1441
+ }
1442
+ catch (error)
1443
+ {
1444
+ // matrix .get
1445
+ }
1446
+ };
1447
+ })(),
1448
+ setChildShapeComponents: function (compoundShape, transform, localScaling, childShape)
1449
+ {
1450
+ if (compoundShape .getNumChildShapes ())
1451
+ compoundShape .removeChildShapeByIndex (0);
1452
+
1453
+ if (childShape .getNumChildShapes ())
1454
+ {
1455
+ childShape .setLocalScaling (localScaling);
1456
+ compoundShape .addChildShape (transform, childShape);
1457
+ }
1458
+ },
1459
+ contactTest: function ()
1460
+ {
1461
+ this .collisionWorld .performDiscreteCollisionDetection ();
1462
+
1463
+ var numManifolds = this .dispatcher .getNumManifolds ();
1464
+
1465
+ for (var i = 0; i < numManifolds; ++ i)
1466
+ {
1467
+ var
1468
+ contactManifold = this .dispatcher .getManifoldByIndexInternal (i),
1469
+ numContacts = contactManifold .getNumContacts ();
1470
+
1471
+ for (var j = 0; j < numContacts; ++ j)
1472
+ {
1473
+ var pt = contactManifold .getContactPoint (j);
1474
+
1475
+ if (pt .getDistance () <= 0)
1476
+ return true;
1477
+ }
1478
+ }
1479
+
1480
+ return false;
1481
+ },
1482
+ getTransform: (function ()
1483
+ {
1484
+ var
1485
+ T = new Ammo .btTransform (),
1486
+ o = new Ammo .btVector3 (0, 0, 0),
1487
+ m = new Matrix4 ();
1488
+
1489
+ return function (translation, rotation, transform)
1490
+ {
1491
+ var t = transform || T;
1492
+
1493
+ m .set (translation, rotation);
1494
+
1495
+ o .setValue (m [12], m [13], m [14]);
1496
+
1497
+ t .getBasis () .setValue (m [0], m [4], m [8],
1498
+ m [1], m [5], m [9],
1499
+ m [2], m [6], m [10]);
1500
+
1501
+ t .setOrigin (o);
1502
+
1503
+ return t;
1504
+ };
1505
+ })(),
1506
+ };
1507
+
1508
+ return VolumePicker;
1509
+ });
1510
+
1511
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1512
+ *******************************************************************************
1513
+ *
1514
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1515
+ *
1516
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1517
+ *
1518
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1519
+ *
1520
+ * The copyright notice above does not evidence any actual of intended
1521
+ * publication of such source code, and is an unpublished work by create3000.
1522
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1523
+ * create3000.
1524
+ *
1525
+ * No permission is granted to copy, distribute, or create derivative works from
1526
+ * the contents of this software, in whole or in part, without the prior written
1527
+ * permission of create3000.
1528
+ *
1529
+ * NON-MILITARY USE ONLY
1530
+ *
1531
+ * All create3000 software are effectively free software with a non-military use
1532
+ * restriction. It is free. Well commented source is provided. You may reuse the
1533
+ * source in any way you please with the exception anything that uses it must be
1534
+ * marked to indicate is contains 'non-military use only' components.
1535
+ *
1536
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1537
+ *
1538
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1539
+ *
1540
+ * This file is part of the X_ITE Project.
1541
+ *
1542
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1543
+ * terms of the GNU General Public License version 3 only, as published by the
1544
+ * Free Software Foundation.
1545
+ *
1546
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1547
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1548
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1549
+ * details (a copy is included in the LICENSE file that accompanied this code).
1550
+ *
1551
+ * You should have received a copy of the GNU General Public License version 3
1552
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1553
+ * copy of the GPLv3 License.
1554
+ *
1555
+ * For Silvio, Joy and Adi.
1556
+ *
1557
+ ******************************************************************************/
1558
+
1559
+
1560
+ define ('x_ite/Components/Picking/PointPickSensor',[
1561
+ "x_ite/Fields",
1562
+ "x_ite/Basic/X3DFieldDefinition",
1563
+ "x_ite/Basic/FieldDefinitionArray",
1564
+ "x_ite/Components/Picking/X3DPickSensorNode",
1565
+ "x_ite/Bits/X3DCast",
1566
+ "x_ite/Bits/X3DConstants",
1567
+ "x_ite/Browser/Picking/IntersectionType",
1568
+ "x_ite/Browser/Picking/VolumePicker",
1569
+ "standard/Math/Numbers/Vector3",
1570
+ "standard/Math/Numbers/Rotation4",
1571
+ "standard/Math/Geometry/Box3",
1572
+ X3D .getComponentUrl ("rigid-body-physics"),
1573
+ ],
1574
+ function (Fields,
1575
+ X3DFieldDefinition,
1576
+ FieldDefinitionArray,
1577
+ X3DPickSensorNode,
1578
+ X3DCast,
1579
+ X3DConstants,
1580
+ IntersectionType,
1581
+ VolumePicker,
1582
+ Vector3,
1583
+ Rotation4,
1584
+ Box3,
1585
+ RigidBodyPhysics)
1586
+ {
1587
+ "use strict";
1588
+
1589
+ var Ammo = RigidBodyPhysics .Ammo;
1590
+
1591
+ function PointPickSensor (executionContext)
1592
+ {
1593
+ X3DPickSensorNode .call (this, executionContext);
1594
+
1595
+ this .addType (X3DConstants .PointPickSensor);
1596
+
1597
+ this .pickingGeometryNode = null;
1598
+ this .picker = new VolumePicker ();
1599
+ this .compoundShapes = [ ];
1600
+ }
1601
+
1602
+ PointPickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
1603
+ {
1604
+ constructor: PointPickSensor,
1605
+ fieldDefinitions: new FieldDefinitionArray ([
1606
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1607
+ new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
1608
+ new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
1609
+ new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
1610
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
1611
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
1612
+ new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
1613
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedPoint", new Fields .MFVec3f ()),
1614
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
1615
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
1616
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
1617
+ ]),
1618
+ getTypeName: function ()
1619
+ {
1620
+ return "PointPickSensor";
1621
+ },
1622
+ getComponentName: function ()
1623
+ {
1624
+ return "Picking";
1625
+ },
1626
+ getContainerField: function ()
1627
+ {
1628
+ return "children";
1629
+ },
1630
+ initialize: function ()
1631
+ {
1632
+ X3DPickSensorNode .prototype .initialize .call (this);
1633
+
1634
+ this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
1635
+
1636
+ this .set_pickingGeometry__ ();
1637
+ },
1638
+ set_pickingGeometry__: function ()
1639
+ {
1640
+ if (this .pickingGeometryNode)
1641
+ this .pickingGeometryNode .rebuild_ .removeInterest ("set_geometry__", this);
1642
+
1643
+ this .pickingGeometryNode = X3DCast (X3DConstants .PointSet, this .pickingGeometry_);
1644
+
1645
+ if (this .pickingGeometryNode)
1646
+ this .pickingGeometryNode .rebuild_ .addInterest ("set_geometry__", this);
1647
+
1648
+ this .set_geometry__ ();
1649
+ },
1650
+ set_geometry__: (function ()
1651
+ {
1652
+ var
1653
+ defaultScale = new Ammo .btVector3 (1, 1, 1),
1654
+ o = new Ammo .btVector3 (),
1655
+ t = new Ammo .btTransform ();
1656
+
1657
+ return function ()
1658
+ {
1659
+ var compoundShapes = this .compoundShapes;
1660
+
1661
+ if (this .pickingGeometryNode)
1662
+ {
1663
+ var coord = this .pickingGeometryNode .getCoord ();
1664
+
1665
+ if (coord)
1666
+ {
1667
+ for (var i = 0, length = coord .getSize (); i < length; ++ i)
1668
+ {
1669
+ if (i < compoundShapes .length)
1670
+ {
1671
+ var
1672
+ compoundShape = compoundShapes [i],
1673
+ point = coord .get1Point (i, compoundShape .point);
1674
+
1675
+ o .setValue (point .x, point .y, point .z);
1676
+ t .setOrigin (o);
1677
+
1678
+ compoundShape .setLocalScaling (defaultScale);
1679
+ compoundShape .updateChildTransform (0, t);
1680
+ }
1681
+ else
1682
+ {
1683
+ var
1684
+ compoundShape = new Ammo .btCompoundShape (),
1685
+ sphereShape = new Ammo .btSphereShape (0),
1686
+ point = coord .get1Point (i, new Vector3 (0, 0, 0));
1687
+
1688
+ compoundShape .point = point;
1689
+
1690
+ o .setValue (point .x, point .y, point .z);
1691
+ t .setOrigin (o);
1692
+
1693
+ compoundShape .addChildShape (t, sphereShape);
1694
+ compoundShapes .push (compoundShape);
1695
+ }
1696
+ }
1697
+
1698
+ compoundShapes .length = length;
1699
+ }
1700
+ else
1701
+ {
1702
+ compoundShapes .length = 0;
1703
+ }
1704
+ }
1705
+ else
1706
+ {
1707
+ compoundShapes .length = 0;
1708
+ }
1709
+ };
1710
+ })(),
1711
+ process: (function ()
1712
+ {
1713
+ var
1714
+ pickingBBox = new Box3 (),
1715
+ targetBBox = new Box3 (),
1716
+ pickingCenter = new Vector3 (0, 0, 0),
1717
+ targetCenter = new Vector3 (0, 0, 0),
1718
+ transform = new Ammo .btTransform (),
1719
+ localScaling = new Ammo .btVector3 (),
1720
+ translation = new Vector3 (0, 0, 0),
1721
+ rotation = new Rotation4 (0, 0, 1, 0),
1722
+ scale = new Vector3 (1, 1, 1),
1723
+ pickedPoint = new Fields .MFVec3f ();
1724
+
1725
+ return function ()
1726
+ {
1727
+ if (this .pickingGeometryNode)
1728
+ {
1729
+ var
1730
+ modelMatrices = this .getModelMatrices (),
1731
+ targets = this .getTargets ();
1732
+
1733
+ switch (this .getIntersectionType ())
1734
+ {
1735
+ case IntersectionType .BOUNDS:
1736
+ {
1737
+ // Intersect bboxes.
1738
+
1739
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
1740
+ {
1741
+ var modelMatrix = modelMatrices [m];
1742
+
1743
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
1744
+
1745
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
1746
+ {
1747
+ var target = targets [t];
1748
+
1749
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
1750
+
1751
+ if (pickingBBox .intersectsBox (targetBBox))
1752
+ {
1753
+ pickingCenter .assign (pickingBBox .center);
1754
+ targetCenter .assign (targetBBox .center);
1755
+
1756
+ target .intersected = true;
1757
+ target .distance = pickingCenter .distance (targetCenter);
1758
+ }
1759
+ }
1760
+ }
1761
+
1762
+ // Send events.
1763
+
1764
+ var
1765
+ pickedGeometries = this .getPickedGeometries (),
1766
+ active = Boolean (pickedGeometries .length);
1767
+
1768
+ pickedGeometries .remove (0, pickedGeometries .length, null);
1769
+
1770
+ if (active !== this .isActive_ .getValue ())
1771
+ this .isActive_ = active;
1772
+
1773
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
1774
+ this .pickedGeometry_ = pickedGeometries;
1775
+
1776
+ break;
1777
+ }
1778
+ case IntersectionType .GEOMETRY:
1779
+ {
1780
+ // Intersect geometry.
1781
+
1782
+ var
1783
+ picker = this .picker,
1784
+ compoundShapes = this .compoundShapes;
1785
+
1786
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
1787
+ {
1788
+ var modelMatrix = modelMatrices [m];
1789
+
1790
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
1791
+
1792
+ modelMatrix .get (translation, rotation, scale);
1793
+
1794
+ picker .getTransform (translation, rotation, transform);
1795
+ localScaling .setValue (scale .x, scale .y, scale .z);
1796
+
1797
+ for (var c = 0, cLength = compoundShapes .length; c < cLength; ++ c)
1798
+ {
1799
+ var compoundShape = compoundShapes [c];
1800
+
1801
+ picker .setChildShape1Components (transform, localScaling, compoundShape);
1802
+
1803
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
1804
+ {
1805
+ var
1806
+ target = targets [t],
1807
+ targetShape = this .getPickShape (target .geometryNode);
1808
+
1809
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
1810
+
1811
+ picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
1812
+
1813
+ if (picker .contactTest ())
1814
+ {
1815
+ pickingCenter .assign (pickingBBox .center);
1816
+ targetCenter .assign (targetBBox .center);
1817
+
1818
+ target .intersected = true;
1819
+ target .distance = pickingCenter .distance (targetCenter);
1820
+ target .pickedPoint .push (compoundShape .point);
1821
+ }
1822
+ }
1823
+ }
1824
+ }
1825
+
1826
+ // Send events.
1827
+
1828
+ var
1829
+ pickedGeometries = this .getPickedGeometries (),
1830
+ active = Boolean (pickedGeometries .length);
1831
+
1832
+ pickedGeometries .remove (0, pickedGeometries .length, null);
1833
+
1834
+ if (active !== this .isActive_ .getValue ())
1835
+ this .isActive_ = active;
1836
+
1837
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
1838
+ this .pickedGeometry_ = pickedGeometries;
1839
+
1840
+ var pickedTargets = this .getPickedTargets ();
1841
+
1842
+ pickedPoint .length = 0;
1843
+
1844
+ for (var t = 0, tLength = pickedTargets .length; t < tLength; ++ t)
1845
+ {
1846
+ var pp = pickedTargets [t] .pickedPoint;
1847
+
1848
+ for (var p = 0, pLength = pp .length; p < pLength; ++ p)
1849
+ pickedPoint .push (pp [p]);
1850
+ }
1851
+
1852
+ if (! this .pickedPoint_ .equals (pickedPoint))
1853
+ this .pickedPoint_ = pickedPoint;
1854
+
1855
+ break;
1856
+ }
1857
+ }
1858
+ }
1859
+
1860
+ X3DPickSensorNode .prototype .process .call (this);
1861
+ };
1862
+ })(),
1863
+ });
1864
+
1865
+ return PointPickSensor;
1866
+ });
1867
+
1868
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1869
+ *******************************************************************************
1870
+ *
1871
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1872
+ *
1873
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1874
+ *
1875
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1876
+ *
1877
+ * The copyright notice above does not evidence any actual of intended
1878
+ * publication of such source code, and is an unpublished work by create3000.
1879
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1880
+ * create3000.
1881
+ *
1882
+ * No permission is granted to copy, distribute, or create derivative works from
1883
+ * the contents of this software, in whole or in part, without the prior written
1884
+ * permission of create3000.
1885
+ *
1886
+ * NON-MILITARY USE ONLY
1887
+ *
1888
+ * All create3000 software are effectively free software with a non-military use
1889
+ * restriction. It is free. Well commented source is provided. You may reuse the
1890
+ * source in any way you please with the exception anything that uses it must be
1891
+ * marked to indicate is contains 'non-military use only' components.
1892
+ *
1893
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1894
+ *
1895
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1896
+ *
1897
+ * This file is part of the X_ITE Project.
1898
+ *
1899
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1900
+ * terms of the GNU General Public License version 3 only, as published by the
1901
+ * Free Software Foundation.
1902
+ *
1903
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1904
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1905
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1906
+ * details (a copy is included in the LICENSE file that accompanied this code).
1907
+ *
1908
+ * You should have received a copy of the GNU General Public License version 3
1909
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1910
+ * copy of the GPLv3 License.
1911
+ *
1912
+ * For Silvio, Joy and Adi.
1913
+ *
1914
+ ******************************************************************************/
1915
+
1916
+
1917
+ define ('x_ite/Components/Picking/PrimitivePickSensor',[
1918
+ "x_ite/Fields",
1919
+ "x_ite/Basic/X3DFieldDefinition",
1920
+ "x_ite/Basic/FieldDefinitionArray",
1921
+ "x_ite/Components/Picking/X3DPickSensorNode",
1922
+ "x_ite/Bits/X3DConstants",
1923
+ "x_ite/Browser/Picking/IntersectionType",
1924
+ "x_ite/Browser/Picking/VolumePicker",
1925
+ "standard/Math/Numbers/Vector3",
1926
+ "standard/Math/Geometry/Box3",
1927
+ ],
1928
+ function (Fields,
1929
+ X3DFieldDefinition,
1930
+ FieldDefinitionArray,
1931
+ X3DPickSensorNode,
1932
+ X3DConstants,
1933
+ IntersectionType,
1934
+ VolumePicker,
1935
+ Vector3,
1936
+ Box3)
1937
+ {
1938
+ "use strict";
1939
+
1940
+ function PrimitivePickSensor (executionContext)
1941
+ {
1942
+ X3DPickSensorNode .call (this, executionContext);
1943
+
1944
+ this .addType (X3DConstants .PrimitivePickSensor);
1945
+
1946
+ this .pickingGeometryNode = null;
1947
+ this .picker = new VolumePicker ();
1948
+ }
1949
+
1950
+ PrimitivePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
1951
+ {
1952
+ constructor: PrimitivePickSensor,
1953
+ fieldDefinitions: new FieldDefinitionArray ([
1954
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1955
+ new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
1956
+ new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
1957
+ new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
1958
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
1959
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
1960
+ new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
1961
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
1962
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
1963
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
1964
+ ]),
1965
+ getTypeName: function ()
1966
+ {
1967
+ return "PrimitivePickSensor";
1968
+ },
1969
+ getComponentName: function ()
1970
+ {
1971
+ return "Picking";
1972
+ },
1973
+ getContainerField: function ()
1974
+ {
1975
+ return "children";
1976
+ },
1977
+ initialize: function ()
1978
+ {
1979
+ X3DPickSensorNode .prototype .initialize .call (this);
1980
+
1981
+ this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
1982
+
1983
+ this .set_pickingGeometry__ ();
1984
+ },
1985
+ set_pickingGeometry__: function ()
1986
+ {
1987
+ this .pickingGeometryNode = null;
1988
+
1989
+ try
1990
+ {
1991
+ var
1992
+ node = this .pickingGeometry_ .getValue () .getInnerNode (),
1993
+ type = node .getType ();
1994
+
1995
+ for (var t = type .length - 1; t >= 0; -- t)
1996
+ {
1997
+ switch (type [t])
1998
+ {
1999
+ case X3DConstants .Box:
2000
+ case X3DConstants .Cone:
2001
+ case X3DConstants .Cylinder:
2002
+ case X3DConstants .Sphere:
2003
+ {
2004
+ this .pickingGeometryNode = node;
2005
+ break;
2006
+ }
2007
+ default:
2008
+ continue;
2009
+ }
2010
+ }
2011
+ }
2012
+ catch (error)
2013
+ { }
2014
+ },
2015
+ process: (function ()
2016
+ {
2017
+ var
2018
+ pickingBBox = new Box3 (),
2019
+ targetBBox = new Box3 (),
2020
+ pickingCenter = new Vector3 (0, 0, 0),
2021
+ targetCenter = new Vector3 (0, 0, 0);
2022
+
2023
+ return function ()
2024
+ {
2025
+ if (this .pickingGeometryNode)
2026
+ {
2027
+ var
2028
+ modelMatrices = this .getModelMatrices (),
2029
+ targets = this .getTargets ();
2030
+
2031
+ switch (this .getIntersectionType ())
2032
+ {
2033
+ case IntersectionType .BOUNDS:
2034
+ {
2035
+ // Intersect bboxes.
2036
+
2037
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
2038
+ {
2039
+ var modelMatrix = modelMatrices [m];
2040
+
2041
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2042
+
2043
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
2044
+ {
2045
+ var target = targets [t];
2046
+
2047
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2048
+
2049
+ if (pickingBBox .intersectsBox (targetBBox))
2050
+ {
2051
+ pickingCenter .assign (pickingBBox .center);
2052
+ targetCenter .assign (targetBBox .center);
2053
+
2054
+ target .intersected = true;
2055
+ target .distance = pickingCenter .distance (targetCenter);
2056
+ }
2057
+ }
2058
+ }
2059
+
2060
+ // Send events.
2061
+
2062
+ var
2063
+ pickedGeometries = this .getPickedGeometries (),
2064
+ active = Boolean (pickedGeometries .length);
2065
+
2066
+ pickedGeometries .remove (0, pickedGeometries .length, null);
2067
+
2068
+ if (active !== this .isActive_ .getValue ())
2069
+ this .isActive_ = active;
2070
+
2071
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
2072
+ this .pickedGeometry_ = pickedGeometries;
2073
+
2074
+ break;
2075
+ }
2076
+ case IntersectionType .GEOMETRY:
2077
+ {
2078
+ // Intersect geometry.
2079
+
2080
+ var picker = this .picker;
2081
+
2082
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
2083
+ {
2084
+ var
2085
+ modelMatrix = modelMatrices [m],
2086
+ pickingShape = this .getPickShape (this .pickingGeometryNode);
2087
+
2088
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2089
+
2090
+ picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
2091
+
2092
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
2093
+ {
2094
+ var
2095
+ target = targets [t],
2096
+ targetShape = this .getPickShape (target .geometryNode);
2097
+
2098
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2099
+
2100
+ picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
2101
+
2102
+ if (picker .contactTest ())
2103
+ {
2104
+ pickingCenter .assign (pickingBBox .center);
2105
+ targetCenter .assign (targetBBox .center);
2106
+
2107
+ target .intersected = true;
2108
+ target .distance = pickingCenter .distance (targetCenter);
2109
+ }
2110
+ }
2111
+ }
2112
+
2113
+ // Send events.
2114
+
2115
+ var
2116
+ pickedGeometries = this .getPickedGeometries (),
2117
+ active = Boolean (pickedGeometries .length);
2118
+
2119
+ pickedGeometries .remove (0, pickedGeometries .length, null);
2120
+
2121
+ if (active !== this .isActive_ .getValue ())
2122
+ this .isActive_ = active;
2123
+
2124
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
2125
+ this .pickedGeometry_ = pickedGeometries;
2126
+
2127
+ break;
2128
+ }
2129
+ }
2130
+ }
2131
+
2132
+ X3DPickSensorNode .prototype .process .call (this);
2133
+ };
2134
+ })(),
2135
+ });
2136
+
2137
+ return PrimitivePickSensor;
2138
+ });
2139
+
2140
+
2141
+
2142
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
2143
+ *******************************************************************************
2144
+ *
2145
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2146
+ *
2147
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
2148
+ *
2149
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
2150
+ *
2151
+ * The copyright notice above does not evidence any actual of intended
2152
+ * publication of such source code, and is an unpublished work by create3000.
2153
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
2154
+ * create3000.
2155
+ *
2156
+ * No permission is granted to copy, distribute, or create derivative works from
2157
+ * the contents of this software, in whole or in part, without the prior written
2158
+ * permission of create3000.
2159
+ *
2160
+ * NON-MILITARY USE ONLY
2161
+ *
2162
+ * All create3000 software are effectively free software with a non-military use
2163
+ * restriction. It is free. Well commented source is provided. You may reuse the
2164
+ * source in any way you please with the exception anything that uses it must be
2165
+ * marked to indicate is contains 'non-military use only' components.
2166
+ *
2167
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2168
+ *
2169
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
2170
+ *
2171
+ * This file is part of the X_ITE Project.
2172
+ *
2173
+ * X_ITE is free software: you can redistribute it and/or modify it under the
2174
+ * terms of the GNU General Public License version 3 only, as published by the
2175
+ * Free Software Foundation.
2176
+ *
2177
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
2178
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
2179
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
2180
+ * details (a copy is included in the LICENSE file that accompanied this code).
2181
+ *
2182
+ * You should have received a copy of the GNU General Public License version 3
2183
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
2184
+ * copy of the GPLv3 License.
2185
+ *
2186
+ * For Silvio, Joy and Adi.
2187
+ *
2188
+ ******************************************************************************/
2189
+
2190
+
2191
+ define ('x_ite/Components/Picking/VolumePickSensor',[
2192
+ "x_ite/Fields",
2193
+ "x_ite/Basic/X3DFieldDefinition",
2194
+ "x_ite/Basic/FieldDefinitionArray",
2195
+ "x_ite/Components/Picking/X3DPickSensorNode",
2196
+ "x_ite/Bits/X3DCast",
2197
+ "x_ite/Bits/X3DConstants",
2198
+ "x_ite/Browser/Picking/IntersectionType",
2199
+ "x_ite/Browser/Picking/VolumePicker",
2200
+ "standard/Math/Numbers/Vector3",
2201
+ "standard/Math/Geometry/Box3",
2202
+ ],
2203
+ function (Fields,
2204
+ X3DFieldDefinition,
2205
+ FieldDefinitionArray,
2206
+ X3DPickSensorNode,
2207
+ X3DCast,
2208
+ X3DConstants,
2209
+ IntersectionType,
2210
+ VolumePicker,
2211
+ Vector3,
2212
+ Box3)
2213
+ {
2214
+ "use strict";
2215
+
2216
+ function VolumePickSensor (executionContext)
2217
+ {
2218
+ X3DPickSensorNode .call (this, executionContext);
2219
+
2220
+ this .addType (X3DConstants .VolumePickSensor);
2221
+
2222
+ this .pickingGeometryNode = null;
2223
+ this .picker = new VolumePicker ();
2224
+ }
2225
+
2226
+ VolumePickSensor .prototype = Object .assign (Object .create (X3DPickSensorNode .prototype),
2227
+ {
2228
+ constructor: VolumePickSensor,
2229
+ fieldDefinitions: new FieldDefinitionArray ([
2230
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
2231
+ new X3DFieldDefinition (X3DConstants .inputOutput, "enabled", new Fields .SFBool (true)),
2232
+ new X3DFieldDefinition (X3DConstants .inputOutput, "objectType", new Fields .MFString ("ALL")),
2233
+ new X3DFieldDefinition (X3DConstants .inputOutput, "matchCriterion", new Fields .SFString ("MATCH_ANY")),
2234
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "intersectionType", new Fields .SFString ("BOUNDS")),
2235
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "sortOrder", new Fields .SFString ("CLOSEST")),
2236
+ new X3DFieldDefinition (X3DConstants .outputOnly, "isActive", new Fields .SFBool ()),
2237
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickingGeometry", new Fields .SFNode ()),
2238
+ new X3DFieldDefinition (X3DConstants .inputOutput, "pickTarget", new Fields .MFNode ()),
2239
+ new X3DFieldDefinition (X3DConstants .outputOnly, "pickedGeometry", new Fields .MFNode ()),
2240
+ ]),
2241
+ getTypeName: function ()
2242
+ {
2243
+ return "VolumePickSensor";
2244
+ },
2245
+ getComponentName: function ()
2246
+ {
2247
+ return "Picking";
2248
+ },
2249
+ getContainerField: function ()
2250
+ {
2251
+ return "children";
2252
+ },
2253
+ initialize: function ()
2254
+ {
2255
+ X3DPickSensorNode .prototype .initialize .call (this);
2256
+
2257
+ this .pickingGeometry_ .addInterest ("set_pickingGeometry__", this);
2258
+
2259
+ this .set_pickingGeometry__ ();
2260
+ },
2261
+ set_pickingGeometry__: function ()
2262
+ {
2263
+ this .pickingGeometryNode = X3DCast (X3DConstants .X3DGeometryNode, this .pickingGeometry_);
2264
+ },
2265
+ process: (function ()
2266
+ {
2267
+ var
2268
+ pickingBBox = new Box3 (),
2269
+ targetBBox = new Box3 (),
2270
+ pickingCenter = new Vector3 (0, 0, 0),
2271
+ targetCenter = new Vector3 (0, 0, 0);
2272
+
2273
+ return function ()
2274
+ {
2275
+ if (this .pickingGeometryNode)
2276
+ {
2277
+ var
2278
+ modelMatrices = this .getModelMatrices (),
2279
+ targets = this .getTargets ();
2280
+
2281
+ switch (this .getIntersectionType ())
2282
+ {
2283
+ case IntersectionType .BOUNDS:
2284
+ {
2285
+ // Intersect bboxes.
2286
+
2287
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
2288
+ {
2289
+ var modelMatrix = modelMatrices [m];
2290
+
2291
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2292
+
2293
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
2294
+ {
2295
+ var target = targets [t];
2296
+
2297
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2298
+
2299
+ if (pickingBBox .intersectsBox (targetBBox))
2300
+ {
2301
+ pickingCenter .assign (pickingBBox .center);
2302
+ targetCenter .assign (targetBBox .center);
2303
+
2304
+ target .intersected = true;
2305
+ target .distance = pickingCenter .distance (targetCenter);
2306
+ }
2307
+ }
2308
+ }
2309
+
2310
+ // Send events.
2311
+
2312
+ var
2313
+ pickedGeometries = this .getPickedGeometries (),
2314
+ active = Boolean (pickedGeometries .length);
2315
+
2316
+ pickedGeometries .remove (0, pickedGeometries .length, null);
2317
+
2318
+ if (active !== this .isActive_ .getValue ())
2319
+ this .isActive_ = active;
2320
+
2321
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
2322
+ this .pickedGeometry_ = pickedGeometries;
2323
+
2324
+ break;
2325
+ }
2326
+ case IntersectionType .GEOMETRY:
2327
+ {
2328
+ // Intersect geometry.
2329
+
2330
+ var picker = this .picker;
2331
+
2332
+ for (var m = 0, mLength = modelMatrices .length; m < mLength; ++ m)
2333
+ {
2334
+ var
2335
+ modelMatrix = modelMatrices [m],
2336
+ pickingShape = this .getPickShape (this .pickingGeometryNode);
2337
+
2338
+ pickingBBox .assign (this .pickingGeometryNode .getBBox ()) .multRight (modelMatrix);
2339
+
2340
+ picker .setChildShape1 (modelMatrix, pickingShape .getCompoundShape ());
2341
+
2342
+ for (var t = 0, tLength = targets .size; t < tLength; ++ t)
2343
+ {
2344
+ var
2345
+ target = targets [t],
2346
+ targetShape = this .getPickShape (target .geometryNode);
2347
+
2348
+ targetBBox .assign (target .geometryNode .getBBox ()) .multRight (target .modelMatrix);
2349
+
2350
+ picker .setChildShape2 (target .modelMatrix, targetShape .getCompoundShape ());
2351
+
2352
+ if (picker .contactTest ())
2353
+ {
2354
+ pickingCenter .assign (pickingBBox .center);
2355
+ targetCenter .assign (targetBBox .center);
2356
+
2357
+ target .intersected = true;
2358
+ target .distance = pickingCenter .distance (targetCenter);
2359
+ }
2360
+ }
2361
+ }
2362
+
2363
+ // Send events.
2364
+
2365
+ var
2366
+ pickedGeometries = this .getPickedGeometries (),
2367
+ active = Boolean (pickedGeometries .length);
2368
+
2369
+ pickedGeometries .remove (0, pickedGeometries .length, null);
2370
+
2371
+ if (active !== this .isActive_ .getValue ())
2372
+ this .isActive_ = active;
2373
+
2374
+ if (! this .pickedGeometry_ .equals (pickedGeometries))
2375
+ this .pickedGeometry_ = pickedGeometries;
2376
+
2377
+ break;
2378
+ }
2379
+ }
2380
+ }
2381
+
2382
+ X3DPickSensorNode .prototype .process .call (this);
2383
+ };
2384
+ })(),
2385
+ });
2386
+
2387
+ return VolumePickSensor;
2388
+ });
2389
+
2390
+
2391
+
2392
+ /*******************************************************************************
2393
+ *
2394
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2395
+ *
2396
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
2397
+ *
2398
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
2399
+ *
2400
+ * The copyright notice above does not evidence any actual of intended
2401
+ * publication of such source code, and is an unpublished work by create3000.
2402
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
2403
+ * create3000.
2404
+ *
2405
+ * No permission is granted to copy, distribute, or create derivative works from
2406
+ * the contents of this software, in whole or in part, without the prior written
2407
+ * permission of create3000.
2408
+ *
2409
+ * NON-MILITARY USE ONLY
2410
+ *
2411
+ * All create3000 software are effectively free software with a non-military use
2412
+ * restriction. It is free. Well commented source is provided. You may reuse the
2413
+ * source in any way you please with the exception anything that uses it must be
2414
+ * marked to indicate is contains 'non-military use only' components.
2415
+ *
2416
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2417
+ *
2418
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
2419
+ *
2420
+ * This file is part of the X_ITE Project.
2421
+ *
2422
+ * X_ITE is free software: you can redistribute it and/or modify it under the
2423
+ * terms of the GNU General Public License version 3 only, as published by the
2424
+ * Free Software Foundation.
2425
+ *
2426
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
2427
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
2428
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
2429
+ * details (a copy is included in the LICENSE file that accompanied this code).
2430
+ *
2431
+ * You should have received a copy of the GNU General Public License version 3
2432
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
2433
+ * copy of the GPLv3 License.
2434
+ *
2435
+ * For Silvio, Joy and Adi.
2436
+ *
2437
+ ******************************************************************************/
2438
+
2439
+ define ([
2440
+ "x_ite/Components",
2441
+ "x_ite/Components/Picking/LinePickSensor",
2442
+ "x_ite/Components/Picking/PickableGroup",
2443
+ "x_ite/Components/Picking/PointPickSensor",
2444
+ "x_ite/Components/Picking/PrimitivePickSensor",
2445
+ "x_ite/Components/Picking/VolumePickSensor",
2446
+ "x_ite/Components/Picking/X3DPickSensorNode",
2447
+ "x_ite/Components/Picking/X3DPickableObject",
2448
+ X3D .getComponentUrl ("rigid-body-physics"),
2449
+ ],
2450
+ function (Components,
2451
+ LinePickSensor,
2452
+ PickableGroup,
2453
+ PointPickSensor,
2454
+ PrimitivePickSensor,
2455
+ VolumePickSensor,
2456
+ X3DPickSensorNode,
2457
+ X3DPickableObject)
2458
+ {
2459
+ "use strict";
2460
+
2461
+ Components .addComponent ({
2462
+ name: "Picking",
2463
+ types:
2464
+ {
2465
+ LinePickSensor: LinePickSensor,
2466
+ PickableGroup: PickableGroup,
2467
+ PointPickSensor: PointPickSensor,
2468
+ PrimitivePickSensor: PrimitivePickSensor,
2469
+ VolumePickSensor: VolumePickSensor,
2470
+ },
2471
+ abstractTypes:
2472
+ {
2473
+ X3DPickSensorNode: X3DPickSensorNode,
2474
+ X3DPickableObject: X3DPickableObject,
2475
+ },
2476
+ });
2477
+ });
2478
+
2479
+
2480
+
2481
+ }());