x_ite 4.2.17 → 4.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (903) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  2. package/.vscode/launch.json +15 -0
  3. package/.vscode/settings.json +12 -0
  4. package/.vscode/tasks.json +25 -0
  5. package/Makefile +27 -10
  6. package/README.md +13 -145
  7. package/build/bin/dist.pl +65 -8
  8. package/build/bin/version-number.pl +25 -0
  9. package/build/bin/version.pl +54 -14
  10. package/build/components/annotation.build.js +15 -0
  11. package/build/components/cad-geometry.build.js +15 -0
  12. package/build/components/cube-map-texturing.build.js +15 -0
  13. package/build/components/dis.build.js +15 -0
  14. package/build/components/event-utilities.build.js +15 -0
  15. package/build/components/geometry2d.build.js +15 -0
  16. package/build/components/geospatial.build.js +15 -0
  17. package/build/components/h-anim.build.js +15 -0
  18. package/build/components/key-device-sensor.build.js +15 -0
  19. package/build/components/layout.build.js +15 -0
  20. package/build/components/nurbs.build.js +15 -0
  21. package/build/components/particle-systems.build.js +15 -0
  22. package/build/components/picking.build.js +15 -0
  23. package/build/components/projective-texture-mapping.build.js +15 -0
  24. package/build/components/rigid-body-physics.build.js +15 -0
  25. package/build/components/scripting.build.js +15 -0
  26. package/build/components/texturing-3d.build.js +15 -0
  27. package/build/components/volume-rendering.build.js +15 -0
  28. package/build/components/x_ite.build.js +15 -0
  29. package/build/parts/default.end.frag.js +3 -0
  30. package/build/parts/default.start.frag.js +15 -0
  31. package/build/parts/x_ite.end.frag.js +25 -0
  32. package/build/parts/x_ite.start.frag.js +16 -0
  33. package/build/x_ite.build.js +5 -2
  34. package/dist/{components/texturing-3d.js → assets/components/annotation.js} +341 -263
  35. package/dist/assets/components/annotation.min.js +1 -0
  36. package/dist/{components → assets/components}/cad-geometry.js +180 -76
  37. package/dist/assets/components/cad-geometry.min.js +1 -0
  38. package/dist/assets/components/cube-map-texturing.js +1222 -0
  39. package/dist/assets/components/cube-map-texturing.min.js +1 -0
  40. package/dist/assets/components/dis.js +918 -0
  41. package/dist/assets/components/dis.min.js +1 -0
  42. package/dist/assets/components/event-utilities.js +1124 -0
  43. package/dist/assets/components/event-utilities.min.js +1 -0
  44. package/dist/assets/components/geometry2d.js +2200 -0
  45. package/dist/assets/components/geometry2d.min.js +1 -0
  46. package/dist/{components → assets/components}/geospatial.js +364 -269
  47. package/dist/assets/components/geospatial.min.js +2 -0
  48. package/dist/{components → assets/components}/h-anim.js +224 -62
  49. package/dist/assets/components/h-anim.min.js +1 -0
  50. package/dist/assets/components/key-device-sensor.js +860 -0
  51. package/dist/assets/components/key-device-sensor.min.js +1 -0
  52. package/dist/assets/components/layout.js +2018 -0
  53. package/dist/assets/components/layout.min.js +1 -0
  54. package/dist/{components → assets/components}/nurbs.js +632 -348
  55. package/dist/assets/components/nurbs.min.js +2 -0
  56. package/dist/{components → assets/components}/particle-systems.js +514 -476
  57. package/dist/assets/components/particle-systems.min.js +2 -0
  58. package/dist/assets/components/picking.js +2491 -0
  59. package/dist/assets/components/picking.min.js +1 -0
  60. package/dist/assets/components/projective-texture-mapping.js +823 -0
  61. package/dist/assets/components/projective-texture-mapping.min.js +1 -0
  62. package/dist/assets/components/rigid-body-physics.js +4579 -0
  63. package/dist/assets/components/rigid-body-physics.min.js +59 -0
  64. package/dist/assets/components/scripting.js +816 -0
  65. package/dist/assets/components/scripting.min.js +1 -0
  66. package/dist/assets/components/texturing-3d.js +10064 -0
  67. package/dist/assets/components/texturing-3d.min.js +48 -0
  68. package/dist/assets/components/volume-rendering.js +3976 -0
  69. package/dist/assets/components/volume-rendering.min.js +3 -0
  70. package/dist/assets/components/x_ite.js +295 -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 +15 -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 +107 -0
  151. package/dist/assets/shaders/webgl1/Phong.fs +837 -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 +538 -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 +108 -0
  165. package/dist/assets/shaders/webgl2/Phong.fs +1013 -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 +693 -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 +167 -49
  175. package/dist/x_ite.js +66263 -60020
  176. package/dist/x_ite.min.js +41 -41
  177. package/dist/x_ite.zip +0 -0
  178. package/docs/404.md +5 -0
  179. package/docs/Accessing-the-External-Browser.md +319 -0
  180. package/docs/Browser-Support.md +47 -0
  181. package/docs/Custom-Shaders.md +896 -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 +1295 -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 +1033 -0
  194. package/docs/reference/Browser-Services.md +361 -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 +342 -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 +3 -3
  239. package/package.json +43 -28
  240. package/src/assets/components/annotation.js +87 -0
  241. package/src/{components → assets/components}/cad-geometry.js +0 -0
  242. package/src/{x_ite/Components/CubeMapTexturing.js → assets/components/cube-map-texturing.js} +15 -21
  243. package/src/assets/components/dis.js +84 -0
  244. package/src/{x_ite/Components/EventUtilities.js → assets/components/event-utilities.js} +20 -26
  245. package/src/{x_ite/Components/Geometry2D.js → assets/components/geometry2d.js} +22 -25
  246. package/src/{components → assets/components}/geospatial.js +0 -0
  247. package/src/{components → assets/components}/h-anim.js +9 -7
  248. package/src/{x_ite/Components/KeyDeviceSensor.js → assets/components/key-device-sensor.js} +17 -20
  249. package/src/{x_ite/Components/Layout.js → assets/components/layout.js} +20 -23
  250. package/src/{components → assets/components}/nurbs.js +0 -0
  251. package/src/{components → assets/components}/particle-systems.js +1 -1
  252. package/src/assets/components/picking.js +87 -0
  253. package/src/assets/components/projective-texture-mapping.js +75 -0
  254. package/src/{components → assets/components}/rigid-body-physics.js +7 -2
  255. package/src/{x_ite/Components/Scripting.js → assets/components/scripting.js} +13 -19
  256. package/src/{components → assets/components}/texturing-3d.js +12 -13
  257. package/src/assets/components/volume-rendering.js +118 -0
  258. package/src/{x_ite/Components/X_ITE.js → assets/components/x_ite.js} +12 -30
  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 +21 -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 +147 -0
  339. package/src/assets/shaders/webgl1/Phong.fs +172 -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 +86 -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/{x_ite/Browser/Shaders/Include/Pack.h → assets/shaders/webgl1/include/Pack.glsl} +0 -1
  351. package/src/assets/shaders/webgl1/include/Perlin.glsl +40 -0
  352. package/src/{x_ite/Browser/Shaders/Include/Shadow.h → assets/shaders/webgl1/include/Shadow.glsl} +33 -33
  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 +148 -0
  360. package/src/assets/shaders/webgl2/Phong.fs +170 -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 +85 -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 +33 -12
  376. package/src/dummy.js +1 -0
  377. package/src/example.html +8 -7
  378. package/src/examples.js +21 -3
  379. package/src/lib/ammojs/AmmoJS.js +58 -0
  380. package/src/lib/ammojs/Makefile +4 -0
  381. package/src/lib/ammojs/ammo.idl +72 -1
  382. package/src/lib/ammojs/ammo.js +25 -21
  383. package/src/lib/jpeg/jpeg.js +1019 -0
  384. package/src/lib/nurbs/extras/sample.js +137 -80
  385. package/src/locale/de.po +18 -73
  386. package/src/locale/fr.po +18 -74
  387. package/src/spinner.css +18 -6
  388. package/src/standard/Geospatial/Geodetic.js +43 -43
  389. package/src/standard/Geospatial/ReferenceEllipsoids.js +1 -1
  390. package/src/standard/Geospatial/UniversalTransverseMercator.js +42 -42
  391. package/src/standard/Math/Algorithm.js +22 -39
  392. package/src/standard/Math/Algorithms/Bezier.js +147 -0
  393. package/src/standard/Math/Algorithms/MergeSort.js +2 -2
  394. package/src/standard/Math/Algorithms/PartialSort.js +6 -6
  395. package/src/standard/Math/Algorithms/QuickSort.js +8 -6
  396. package/src/standard/Math/Algorithms/SAT.js +4 -8
  397. package/src/standard/Math/Algorithms/eigendecomposition.js +37 -33
  398. package/src/standard/Math/Geometry/Box2.js +84 -56
  399. package/src/standard/Math/Geometry/Box3.js +400 -358
  400. package/src/standard/Math/Geometry/Camera.js +19 -16
  401. package/src/standard/Math/Geometry/Cylinder3.js +13 -13
  402. package/src/standard/Math/Geometry/Line3.js +34 -34
  403. package/src/standard/Math/Geometry/Plane3.js +15 -15
  404. package/src/standard/Math/Geometry/Sphere3.js +122 -105
  405. package/src/standard/Math/Geometry/Spheroid3.js +1 -1
  406. package/src/standard/Math/Geometry/Triangle2.js +5 -5
  407. package/src/standard/Math/Geometry/Triangle3.js +12 -14
  408. package/src/standard/Math/Geometry/ViewVolume.js +303 -106
  409. package/src/standard/Math/Numbers/Color3.js +26 -23
  410. package/src/standard/Math/Numbers/Color4.js +9 -9
  411. package/src/standard/Math/Numbers/Complex.js +13 -17
  412. package/src/standard/Math/Numbers/Matrix2.js +20 -13
  413. package/src/standard/Math/Numbers/Matrix3.js +129 -205
  414. package/src/standard/Math/Numbers/Matrix4.js +136 -257
  415. package/src/standard/Math/Numbers/Quaternion.js +49 -138
  416. package/src/standard/Math/Numbers/Rotation4.js +42 -55
  417. package/src/standard/Math/Numbers/Vector2.js +32 -115
  418. package/src/standard/Math/Numbers/Vector3.js +46 -151
  419. package/src/standard/Math/Numbers/Vector4.js +44 -163
  420. package/src/standard/Math/Utility/BVH.js +21 -20
  421. package/src/standard/Math/Utility/MatrixStack.js +4 -4
  422. package/src/standard/Networking/BinaryTransport.js +8 -8
  423. package/src/standard/Time/MicroTime.js +81 -0
  424. package/src/standard/Utility/DataStorage.js +11 -14
  425. package/src/standard/Utility/MapUtilities.js +69 -0
  426. package/src/standard/Utility/ObjectCache.js +2 -3
  427. package/src/standard/Utility/Shuffle.js +5 -6
  428. package/src/tests.js +84 -5
  429. package/src/x_ite/Base/Events.js +9 -10
  430. package/src/x_ite/Base/X3DChildObject.js +20 -16
  431. package/src/x_ite/Base/X3DEventObject.js +3 -7
  432. package/src/x_ite/Base/X3DObject.js +44 -27
  433. package/src/x_ite/Basic/FieldDefinitionArray.js +11 -4
  434. package/src/x_ite/Basic/X3DBaseNode.js +427 -246
  435. package/src/x_ite/Basic/X3DField.js +48 -69
  436. package/src/x_ite/Basic/X3DFieldDefinition.js +0 -4
  437. package/src/x_ite/Basic/X3DObjectArrayField.js +102 -108
  438. package/src/x_ite/Basic/X3DTypedArrayField.js +194 -163
  439. package/src/x_ite/Bits/TraverseType.js +2 -5
  440. package/src/x_ite/Bits/X3DConstants.js +11 -2
  441. package/src/x_ite/Browser/Core/BrowserOptions.js +89 -68
  442. package/src/x_ite/Browser/Core/BrowserTimings.js +21 -29
  443. package/src/x_ite/Browser/Core/ContextMenu.js +139 -60
  444. package/src/x_ite/Browser/Core/Notification.js +3 -3
  445. package/src/x_ite/Browser/Core/PrimitiveQuality.js +3 -7
  446. package/src/x_ite/Browser/Core/Shading.js +3 -7
  447. package/src/x_ite/Browser/Core/TextureQuality.js +3 -7
  448. package/src/x_ite/Browser/Core/X3DCoreContext.js +398 -58
  449. package/src/x_ite/Browser/Core/X3DCoreContext.js.~1~ +714 -0
  450. package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +17 -28
  451. package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +5 -14
  452. package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +81 -28
  453. package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +53 -44
  454. package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +51 -12
  455. package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +8 -9
  456. package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +98 -0
  457. package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +14 -206
  458. package/src/x_ite/Browser/Layout/ScreenText.js +226 -254
  459. package/src/x_ite/Browser/Layout/X3DLayoutContext.js +13 -11
  460. package/src/x_ite/Browser/Lighting/X3DLightingContext.js +15 -9
  461. package/src/x_ite/Browser/NURBS/NURBS.js +84 -72
  462. package/src/x_ite/Browser/Navigation/ExamineViewer.js +125 -83
  463. package/src/x_ite/Browser/Navigation/FlyViewer.js +14 -9
  464. package/src/x_ite/Browser/Navigation/LookAtViewer.js +60 -40
  465. package/src/x_ite/Browser/Navigation/NoneViewer.js +12 -1
  466. package/src/x_ite/Browser/Navigation/PlaneViewer.js +39 -20
  467. package/src/x_ite/Browser/Navigation/WalkViewer.js +21 -6
  468. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +110 -85
  469. package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +11 -6
  470. package/src/x_ite/Browser/Navigation/X3DViewer.js +73 -48
  471. package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +18 -24
  472. package/src/x_ite/Browser/Networking/urls.js +31 -16
  473. package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +5 -6
  474. package/src/x_ite/Browser/Picking/IntersectionType.js +63 -0
  475. package/src/x_ite/Browser/Picking/MatchCriterion.js +64 -0
  476. package/src/x_ite/Browser/Picking/SortOrder.js +65 -0
  477. package/src/x_ite/Browser/Picking/VolumePicker.js +197 -0
  478. package/src/x_ite/Browser/Picking/X3DPickingContext.js +130 -0
  479. package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +26 -20
  480. package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -10
  481. package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +38 -27
  482. package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +70 -0
  483. package/src/x_ite/Browser/Shaders/Shader.js +112 -92
  484. package/src/x_ite/Browser/Shaders/ShaderSource.js +140 -0
  485. package/src/x_ite/Browser/Shaders/ShaderTest.js +92 -77
  486. package/src/x_ite/Browser/Shaders/X3DShadersContext.js +134 -74
  487. package/src/x_ite/Browser/Shape/AlphaMode.js +65 -0
  488. package/src/x_ite/Browser/Shape/LineStipples.xcf +0 -0
  489. package/src/x_ite/Browser/Shape/X3DShapeContext.js +108 -4
  490. package/src/x_ite/Browser/Text/PolygonText.js +153 -170
  491. package/src/x_ite/Browser/Text/TextAlignment.js +3 -7
  492. package/src/x_ite/Browser/Text/X3DTextContext.js +38 -30
  493. package/src/x_ite/Browser/Text/X3DTextGeometry.js +49 -74
  494. package/src/x_ite/Browser/Texturing/MultiTextureFunctionType.js +64 -0
  495. package/src/x_ite/Browser/Texturing/MultiTextureModeType.js +81 -0
  496. package/src/x_ite/Browser/Texturing/MultiTextureSourceType.js +65 -0
  497. package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +73 -0
  498. package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +147 -45
  499. package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1126 -0
  500. package/src/x_ite/Browser/Texturing3D/NRRDParser.js +686 -0
  501. package/src/x_ite/Browser/Time/X3DTimeContext.js +20 -17
  502. package/src/x_ite/Browser/VERSION.js +1 -1
  503. package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs +120 -0
  504. package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs +28 -0
  505. package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +114 -0
  506. package/src/x_ite/Browser/X3DBrowser.js +282 -224
  507. package/src/x_ite/Browser/X3DBrowserContext.js +60 -27
  508. package/src/x_ite/Components/Annotation/AnnotationLayer.js +108 -0
  509. package/src/x_ite/Components/Annotation/AnnotationTarget.js +101 -0
  510. package/src/x_ite/Components/Annotation/GroupAnnotation.js +112 -0
  511. package/src/x_ite/Components/Annotation/IconAnnotation.js +110 -0
  512. package/src/x_ite/Components/Annotation/TextAnnotation.js +102 -0
  513. package/src/x_ite/Components/Annotation/URLAnnotation.js +101 -0
  514. package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +76 -0
  515. package/src/x_ite/Components/CADGeometry/CADAssembly.js +4 -4
  516. package/src/x_ite/Components/CADGeometry/CADFace.js +135 -30
  517. package/src/x_ite/Components/CADGeometry/CADLayer.js +3 -18
  518. package/src/x_ite/Components/CADGeometry/CADPart.js +4 -8
  519. package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +18 -10
  520. package/src/x_ite/Components/Core/WorldInfo.js +16 -6
  521. package/src/x_ite/Components/Core/X3DBindableNode.js +4 -33
  522. package/src/x_ite/Components/Core/X3DChildNode.js +14 -1
  523. package/src/x_ite/Components/Core/X3DNode.js +0 -63
  524. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +128 -168
  525. package/src/x_ite/Components/Core.js +6 -9
  526. package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +38 -46
  527. package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +31 -30
  528. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +42 -57
  529. package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +36 -48
  530. package/src/x_ite/Components/DIS/EspduTransform.js +12 -6
  531. package/src/x_ite/Components/DIS/ReceiverPdu.js +12 -6
  532. package/src/x_ite/Components/DIS/SignalPdu.js +12 -6
  533. package/src/x_ite/Components/DIS/TransmitterPdu.js +12 -6
  534. package/src/x_ite/Components/EnvironmentalEffects/Fog.js +5 -16
  535. package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +55 -3
  536. package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +3 -5
  537. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +116 -116
  538. package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +5 -6
  539. package/src/x_ite/Components/EnvironmentalEffects.js +6 -9
  540. package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +116 -117
  541. package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +169 -49
  542. package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +31 -27
  543. package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +12 -5
  544. package/src/x_ite/Components/EnvironmentalSensor.js +6 -9
  545. package/src/x_ite/Components/Followers/ColorChaser.js +1 -3
  546. package/src/x_ite/Components/Followers/ColorDamper.js +1 -3
  547. package/src/x_ite/Components/Followers/CoordinateChaser.js +1 -7
  548. package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -6
  549. package/src/x_ite/Components/Followers/OrientationChaser.js +7 -3
  550. package/src/x_ite/Components/Followers/OrientationDamper.js +7 -3
  551. package/src/x_ite/Components/Followers/PositionChaser.js +1 -3
  552. package/src/x_ite/Components/Followers/PositionChaser2D.js +1 -3
  553. package/src/x_ite/Components/Followers/PositionDamper.js +1 -3
  554. package/src/x_ite/Components/Followers/PositionDamper2D.js +1 -3
  555. package/src/x_ite/Components/Followers/ScalarChaser.js +1 -3
  556. package/src/x_ite/Components/Followers/ScalarDamper.js +1 -3
  557. package/src/x_ite/Components/Followers/TexCoordChaser2D.js +1 -7
  558. package/src/x_ite/Components/Followers/TexCoordDamper2D.js +1 -7
  559. package/src/x_ite/Components/Followers/X3DChaserNode.js +20 -18
  560. package/src/x_ite/Components/Followers/X3DDamperNode.js +5 -7
  561. package/src/x_ite/Components/Followers/X3DFollowerNode.js +5 -7
  562. package/src/x_ite/Components/Followers.js +6 -9
  563. package/src/x_ite/Components/Geometry2D/Arc2D.js +10 -14
  564. package/src/x_ite/Components/Geometry2D/ArcClose2D.js +87 -86
  565. package/src/x_ite/Components/Geometry2D/Circle2D.js +1 -3
  566. package/src/x_ite/Components/Geometry2D/Disk2D.js +43 -58
  567. package/src/x_ite/Components/Geometry2D/Polyline2D.js +4 -8
  568. package/src/x_ite/Components/Geometry2D/Polypoint2D.js +3 -5
  569. package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +20 -16
  570. package/src/x_ite/Components/Geometry3D/Cone.js +1 -3
  571. package/src/x_ite/Components/Geometry3D/Cylinder.js +3 -5
  572. package/src/x_ite/Components/Geometry3D/ElevationGrid.js +35 -17
  573. package/src/x_ite/Components/Geometry3D/Extrusion.js +125 -107
  574. package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +164 -142
  575. package/src/x_ite/Components/Geometry3D/Sphere.js +3 -5
  576. package/src/x_ite/Components/Geometry3D.js +6 -9
  577. package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +7 -7
  578. package/src/x_ite/Components/Geospatial/GeoLOD.js +207 -124
  579. package/src/x_ite/Components/Geospatial/GeoLocation.js +6 -6
  580. package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +5 -3
  581. package/src/x_ite/Components/Geospatial/GeoTransform.js +9 -9
  582. package/src/x_ite/Components/Geospatial/GeoViewpoint.js +27 -27
  583. package/src/x_ite/Components/Grouping/Group.js +3 -3
  584. package/src/x_ite/Components/Grouping/StaticGroup.js +49 -56
  585. package/src/x_ite/Components/Grouping/Switch.js +171 -21
  586. package/src/x_ite/Components/Grouping/Transform.js +3 -3
  587. package/src/x_ite/Components/Grouping/X3DBoundedObject.js +68 -15
  588. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +339 -180
  589. package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +51 -25
  590. package/src/x_ite/Components/Grouping/X3DTransformNode.js +2 -4
  591. package/src/x_ite/Components/Grouping.js +6 -9
  592. package/src/x_ite/Components/{H-Anim → HAnim}/HAnimDisplacer.js +4 -4
  593. package/src/x_ite/Components/{H-Anim → HAnim}/HAnimHumanoid.js +24 -14
  594. package/src/x_ite/Components/{H-Anim → HAnim}/HAnimJoint.js +44 -20
  595. package/src/x_ite/Components/HAnim/HAnimMotion.js +113 -0
  596. package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSegment.js +6 -4
  597. package/src/x_ite/Components/{H-Anim → HAnim}/HAnimSite.js +4 -4
  598. package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +8 -7
  599. package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +4 -3
  600. package/src/x_ite/Components/Interpolation.js +6 -9
  601. package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +1 -3
  602. package/src/x_ite/Components/Layering/Layer.js +12 -2
  603. package/src/x_ite/Components/Layering/LayerSet.js +4 -6
  604. package/src/x_ite/Components/Layering/Viewport.js +8 -8
  605. package/src/x_ite/Components/Layering/X3DLayerNode.js +67 -62
  606. package/src/x_ite/Components/Layering.js +6 -9
  607. package/src/x_ite/Components/Layout/LayoutGroup.js +18 -15
  608. package/src/x_ite/Components/Layout/LayoutLayer.js +10 -5
  609. package/src/x_ite/Components/Layout/ScreenFontStyle.js +12 -14
  610. package/src/x_ite/Components/Layout/ScreenGroup.js +25 -31
  611. package/src/x_ite/Components/Lighting/DirectionalLight.js +27 -22
  612. package/src/x_ite/Components/Lighting/PointLight.js +26 -29
  613. package/src/x_ite/Components/Lighting/SpotLight.js +29 -24
  614. package/src/x_ite/Components/Lighting/X3DLightNode.js +85 -66
  615. package/src/x_ite/Components/Lighting.js +6 -9
  616. package/src/x_ite/Components/NURBS/Contour2D.js +45 -1
  617. package/src/x_ite/Components/NURBS/ContourPolyline2D.js +53 -25
  618. package/src/x_ite/Components/NURBS/NurbsCurve.js +21 -24
  619. package/src/x_ite/Components/NURBS/NurbsCurve2D.js +44 -25
  620. package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +19 -21
  621. package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +18 -20
  622. package/src/x_ite/Components/NURBS/NurbsSet.js +17 -6
  623. package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +2 -2
  624. package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +2 -2
  625. package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +15 -16
  626. package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +38 -1
  627. package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +116 -43
  628. package/src/x_ite/Components/Navigation/Billboard.js +12 -11
  629. package/src/x_ite/Components/Navigation/Collision.js +10 -8
  630. package/src/x_ite/Components/Navigation/LOD.js +207 -59
  631. package/src/x_ite/Components/Navigation/NavigationInfo.js +29 -43
  632. package/src/x_ite/Components/Navigation/OrthoViewpoint.js +99 -18
  633. package/src/x_ite/Components/Navigation/Viewpoint.js +15 -15
  634. package/src/x_ite/Components/Navigation/ViewpointGroup.js +12 -5
  635. package/src/x_ite/Components/Navigation/X3DViewpointNode.js +137 -148
  636. package/src/x_ite/Components/Navigation.js +6 -9
  637. package/src/x_ite/Components/Networking/Anchor.js +22 -24
  638. package/src/x_ite/Components/Networking/Inline.js +63 -44
  639. package/src/x_ite/Components/Networking/X3DUrlObject.js +88 -8
  640. package/src/x_ite/Components/Networking.js +6 -9
  641. package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +2 -2
  642. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +215 -199
  643. package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +44 -39
  644. package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +48 -46
  645. package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +121 -117
  646. package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +21 -18
  647. package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +20 -22
  648. package/src/x_ite/Components/Picking/LinePickSensor.js +251 -6
  649. package/src/x_ite/Components/Picking/PickableGroup.js +120 -7
  650. package/src/x_ite/Components/Picking/PointPickSensor.js +260 -8
  651. package/src/x_ite/Components/Picking/PrimitivePickSensor.js +174 -4
  652. package/src/x_ite/Components/Picking/VolumePickSensor.js +150 -4
  653. package/src/x_ite/Components/Picking/X3DPickSensorNode.js +377 -4
  654. package/src/x_ite/Components/Picking/X3DPickableObject.js +21 -1
  655. package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +26 -11
  656. package/src/x_ite/Components/PointingDeviceSensor.js +6 -9
  657. package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorParallel.js +282 -0
  658. package/src/x_ite/Components/ProjectiveTextureMapping/TextureProjectorPerspective.js +227 -0
  659. package/src/x_ite/Components/ProjectiveTextureMapping/X3DTextureProjectorNode.js +217 -0
  660. package/src/x_ite/Components/Rendering/ClipPlane.js +8 -10
  661. package/src/x_ite/Components/Rendering/Color.js +22 -13
  662. package/src/x_ite/Components/Rendering/ColorRGBA.js +28 -16
  663. package/src/x_ite/Components/Rendering/IndexedLineSet.js +52 -33
  664. package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +17 -14
  665. package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +9 -4
  666. package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +17 -17
  667. package/src/x_ite/Components/Rendering/LineSet.js +44 -27
  668. package/src/x_ite/Components/Rendering/Normal.js +20 -4
  669. package/src/x_ite/Components/Rendering/PointSet.js +38 -16
  670. package/src/x_ite/Components/Rendering/TriangleFanSet.js +7 -9
  671. package/src/x_ite/Components/Rendering/TriangleStripSet.js +6 -8
  672. package/src/x_ite/Components/Rendering/X3DColorNode.js +16 -1
  673. package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +80 -55
  674. package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +11 -13
  675. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +622 -477
  676. package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +159 -90
  677. package/src/x_ite/Components/Rendering.js +6 -9
  678. package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +8 -10
  679. package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +142 -26
  680. package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +312 -128
  681. package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +91 -7
  682. package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +189 -4
  683. package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +82 -4
  684. package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
  685. package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +49 -37
  686. package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +45 -39
  687. package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +41 -34
  688. package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +25 -20
  689. package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +8 -10
  690. package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +15 -16
  691. package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +2 -4
  692. package/src/x_ite/Components/Scripting/Script.js +147 -101
  693. package/src/x_ite/Components/Scripting/X3DScriptNode.js +2 -4
  694. package/src/x_ite/Components/Shaders/ComposedShader.js +17 -19
  695. package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +9 -3
  696. package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +10 -3
  697. package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +10 -3
  698. package/src/x_ite/Components/Shaders/PackagedShader.js +18 -14
  699. package/src/x_ite/Components/Shaders/ShaderPart.js +30 -18
  700. package/src/x_ite/Components/Shaders/ShaderProgram.js +15 -11
  701. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +681 -558
  702. package/src/x_ite/Components/Shaders/X3DShaderNode.js +48 -12
  703. package/src/x_ite/Components/Shaders.js +15 -18
  704. package/src/x_ite/Components/Shape/Appearance.js +153 -77
  705. package/src/x_ite/Components/Shape/FillProperties.js +63 -4
  706. package/src/x_ite/Components/Shape/LineProperties.js +27 -5
  707. package/src/x_ite/Components/Shape/Material.js +48 -62
  708. package/src/x_ite/Components/Shape/PointProperties.js +162 -0
  709. package/src/x_ite/Components/Shape/Shape.js +86 -39
  710. package/src/x_ite/Components/Shape/TwoSidedMaterial.js +53 -59
  711. package/src/x_ite/Components/Shape/UnlitMaterial.js +109 -0
  712. package/src/x_ite/Components/Shape/X3DAppearanceNode.js +9 -6
  713. package/src/x_ite/Components/Shape/X3DMaterialNode.js +16 -3
  714. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +111 -0
  715. package/src/x_ite/Components/Shape/X3DShapeNode.js +41 -17
  716. package/src/x_ite/Components/Shape.js +22 -16
  717. package/src/x_ite/Components/Sound/AudioClip.js +36 -50
  718. package/src/x_ite/Components/Sound/Sound.js +36 -36
  719. package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +18 -6
  720. package/src/x_ite/Components/Sound.js +6 -9
  721. package/src/x_ite/Components/Text/FontStyle.js +10 -12
  722. package/src/x_ite/Components/Text/Text.js +6 -6
  723. package/src/x_ite/Components/Text/X3DFontStyleNode.js +56 -87
  724. package/src/x_ite/Components/Text.js +6 -9
  725. package/src/x_ite/Components/Texturing/ImageTexture.js +48 -63
  726. package/src/x_ite/Components/Texturing/MovieTexture.js +42 -56
  727. package/src/x_ite/Components/Texturing/MultiTexture.js +236 -11
  728. package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +73 -6
  729. package/src/x_ite/Components/Texturing/MultiTextureTransform.js +45 -4
  730. package/src/x_ite/Components/Texturing/PixelTexture.js +45 -11
  731. package/src/x_ite/Components/Texturing/TextureCoordinate.js +32 -17
  732. package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +68 -8
  733. package/src/x_ite/Components/Texturing/TextureProperties.js +96 -65
  734. package/src/x_ite/Components/Texturing/TextureTransform.js +55 -47
  735. package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +91 -0
  736. package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +183 -0
  737. package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +77 -0
  738. package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +42 -95
  739. package/src/x_ite/Components/Texturing/X3DTexture2DNode.js.~1~ +209 -0
  740. package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +3 -17
  741. package/src/x_ite/Components/Texturing/X3DTextureNode.js +6 -67
  742. package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +4 -11
  743. package/src/x_ite/Components/Texturing.js +31 -25
  744. package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +88 -4
  745. package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +105 -13
  746. package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +124 -4
  747. package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +35 -18
  748. package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +35 -18
  749. package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +41 -31
  750. package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +18 -11
  751. package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +110 -6
  752. package/src/x_ite/Components/Time/TimeSensor.js +23 -19
  753. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +11 -7
  754. package/src/x_ite/Components/Time.js +6 -9
  755. package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +309 -8
  756. package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +58 -4
  757. package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +217 -6
  758. package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +132 -3
  759. package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +86 -5
  760. package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +309 -11
  761. package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +85 -3
  762. package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +134 -2
  763. package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +222 -9
  764. package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +191 -8
  765. package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +85 -6
  766. package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +95 -5
  767. package/src/x_ite/Components/VolumeRendering/VolumeData.js +153 -8
  768. package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +155 -3
  769. package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +62 -0
  770. package/src/x_ite/Components/X_ITE/BlendMode.js +51 -51
  771. package/src/x_ite/Components.js +11 -16
  772. package/src/x_ite/Configuration/ComponentInfo.js +12 -6
  773. package/src/x_ite/Configuration/ComponentInfoArray.js +4 -7
  774. package/src/x_ite/Configuration/ProfileInfo.js +10 -6
  775. package/src/x_ite/Configuration/SupportedComponents.js +66 -40
  776. package/src/x_ite/Configuration/SupportedNodes.js +22 -6
  777. package/src/x_ite/Configuration/SupportedProfiles.js +91 -89
  778. package/src/x_ite/Configuration/UnitInfo.js +12 -2
  779. package/src/x_ite/Configuration/X3DInfoArray.js +37 -18
  780. package/src/x_ite/Execution/BindableList.js +63 -38
  781. package/src/x_ite/Execution/BindableStack.js +63 -71
  782. package/src/x_ite/Execution/ExportedNode.js +25 -2
  783. package/src/x_ite/Execution/ImportedNode.js +122 -39
  784. package/src/x_ite/Execution/Scene.js +22 -14
  785. package/src/x_ite/Execution/World.js +22 -19
  786. package/src/x_ite/Execution/X3DExecutionContext.js +381 -221
  787. package/src/x_ite/Execution/X3DScene.js +213 -53
  788. package/src/x_ite/{Error.js → Fallback.js} +26 -29
  789. package/src/x_ite/Fields/ArrayFields.js +176 -57
  790. package/src/x_ite/Fields/SFBool.js +6 -5
  791. package/src/x_ite/Fields/SFColor.js +24 -21
  792. package/src/x_ite/Fields/SFColorRGBA.js +23 -23
  793. package/src/x_ite/Fields/SFDouble.js +6 -5
  794. package/src/x_ite/Fields/SFFloat.js +7 -6
  795. package/src/x_ite/Fields/SFImage.js +37 -36
  796. package/src/x_ite/Fields/SFInt32.js +5 -4
  797. package/src/x_ite/Fields/SFMatrix3.js +19 -15
  798. package/src/x_ite/Fields/SFMatrix4.js +19 -15
  799. package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +10 -2
  800. package/src/x_ite/Fields/SFNode.js +105 -53
  801. package/src/x_ite/Fields/SFNodeCache.js +93 -0
  802. package/src/x_ite/Fields/SFRotation.js +31 -27
  803. package/src/x_ite/Fields/SFString.js +9 -8
  804. package/src/x_ite/Fields/SFTime.js +6 -5
  805. package/src/x_ite/Fields/SFVec2.js +17 -13
  806. package/src/x_ite/Fields/SFVec3.js +21 -17
  807. package/src/x_ite/Fields/SFVec4.js +24 -20
  808. package/src/x_ite/Fields/SFVecPrototypeTemplate.js +8 -4
  809. package/src/x_ite/Fields.js +2 -6
  810. package/src/x_ite/InputOutput/FileLoader.js +174 -190
  811. package/src/x_ite/InputOutput/Generator.js +133 -104
  812. package/src/x_ite/Parser/HTMLSupport.js +3 -596
  813. package/src/x_ite/Parser/JSONParser.js +348 -245
  814. package/src/x_ite/Parser/Parser.js +314 -303
  815. package/src/x_ite/Parser/X3DParser.js +41 -20
  816. package/src/x_ite/Parser/XMLParser.js +178 -60
  817. package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +17 -0
  818. package/src/x_ite/Prototype/ProtoDeclarationArray.js +17 -0
  819. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +104 -44
  820. package/src/x_ite/Prototype/X3DProtoDeclaration.js +111 -42
  821. package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +16 -14
  822. package/src/x_ite/Rendering/DependentRenderer.js +7 -9
  823. package/src/x_ite/Rendering/TextureBuffer.js +24 -19
  824. package/src/x_ite/Rendering/X3DRenderObject.js +455 -428
  825. package/src/x_ite/Routing/RouteArray.js +34 -11
  826. package/src/x_ite/Routing/X3DRoute.js +60 -60
  827. package/src/x_ite/Routing/X3DRoutingContext.js +6 -6
  828. package/src/x_ite/X3D.js +30 -37
  829. package/src/x_ite.config.js +40 -5
  830. package/src/x_ite.css +165 -45
  831. package/src/x_ite.html +49 -29
  832. package/src/x_ite.js +86 -25
  833. package/x_ite.min.html +49 -22
  834. package/.bzrignore +0 -3
  835. package/AUTHORS.md +0 -6
  836. package/STYLE_GUIDE.md +0 -51
  837. package/X_ITE.sln +0 -54
  838. package/X_ITE.userprefs +0 -14
  839. package/build/build.mdproj +0 -47
  840. package/build/cad-geometry.build.js +0 -15
  841. package/build/geospatial.build.js +0 -15
  842. package/build/h-anim.build.js +0 -15
  843. package/build/nurbs.build.js +0 -15
  844. package/build/particle-systems.build.js +0 -15
  845. package/build/parts/cad-geometry.end.frag +0 -2
  846. package/build/parts/cad-geometry.start.frag +0 -6
  847. package/build/parts/geospatial.end.frag +0 -2
  848. package/build/parts/geospatial.start.frag +0 -6
  849. package/build/parts/h-anim.end.frag +0 -2
  850. package/build/parts/h-anim.start.frag +0 -6
  851. package/build/parts/nurbs.end.frag +0 -2
  852. package/build/parts/nurbs.start.frag +0 -6
  853. package/build/parts/particle-systems.end.frag +0 -2
  854. package/build/parts/particle-systems.start.frag +0 -6
  855. package/build/parts/rigid-body-physics.end.frag +0 -2
  856. package/build/parts/rigid-body-physics.start.frag +0 -6
  857. package/build/parts/texturing-3d.end.frag +0 -2
  858. package/build/parts/texturing-3d.start.frag +0 -6
  859. package/build/parts/x_ite.end.frag +0 -9
  860. package/build/parts/x_ite.start.frag +0 -6
  861. package/build/rigid-body-physics.build.js +0 -15
  862. package/build/texturing-3d.build.js +0 -15
  863. package/dist/components/README +0 -3
  864. package/dist/components/cad-geometry.min.js +0 -1
  865. package/dist/components/geospatial.min.js +0 -2
  866. package/dist/components/h-anim.min.js +0 -1
  867. package/dist/components/nurbs.min.js +0 -2
  868. package/dist/components/particle-systems.min.js +0 -2
  869. package/dist/components/rigid-body-physics.js +0 -3761
  870. package/dist/components/rigid-body-physics.min.js +0 -56
  871. package/dist/components/texturing-3d.min.js +0 -1
  872. package/dist/dist.mdproj +0 -61
  873. package/dist/images/logo.128.png +0 -0
  874. package/fonts/fonts.mdproj +0 -29
  875. package/meta/meta.mdproj +0 -35
  876. package/src/components/cad-geometry.config.js +0 -56
  877. package/src/components/geospatial.config.js +0 -56
  878. package/src/components/h-anim.config.js +0 -56
  879. package/src/components/nurbs.config.js +0 -61
  880. package/src/components/particle-systems.config.js +0 -56
  881. package/src/components/rigid-body-physics.config.js +0 -61
  882. package/src/components/texturing-3d.config.js +0 -56
  883. package/src/images/logo.128.png +0 -0
  884. package/src/locale/de.mo +0 -0
  885. package/src/locale/fr.mo +0 -0
  886. package/src/src.mdproj +0 -698
  887. package/src/standard/Networking/URI.js +0 -785
  888. package/src/test.x3d +0 -225
  889. package/src/x_ite/Browser/Shaders/Background.fs +0 -31
  890. package/src/x_ite/Browser/Shaders/Background.vs +0 -23
  891. package/src/x_ite/Browser/Shaders/Depth.fs +0 -32
  892. package/src/x_ite/Browser/Shaders/Depth.vs +0 -21
  893. package/src/x_ite/Browser/Shaders/Gouraud.fs +0 -135
  894. package/src/x_ite/Browser/Shaders/Gouraud.vs +0 -145
  895. package/src/x_ite/Browser/Shaders/Phong.fs +0 -269
  896. package/src/x_ite/Browser/Shaders/Phong.vs +0 -47
  897. package/src/x_ite/Browser/Shaders/PointSet.fs +0 -86
  898. package/src/x_ite/Browser/Shaders/Types.h +0 -55
  899. package/src/x_ite/Browser/Shaders/Wireframe.fs +0 -82
  900. package/src/x_ite/Browser/Shaders/Wireframe.vs +0 -61
  901. package/src/x_ite/Components/DIS.js +0 -91
  902. package/src/x_ite/Components/Picking.js +0 -94
  903. package/src/x_ite/Components/VolumeRendering.js +0 -121
@@ -0,0 +1,2200 @@
1
+ (function (globalModule, globalRequire)
2
+ {
3
+
4
+ if (typeof __filename === "undefined")
5
+ {
6
+ globalModule = undefined;
7
+ globalRequire = undefined;
8
+ }
9
+
10
+ // Undefine global variables.
11
+ var module = { }, exports, process;
12
+
13
+ const
14
+ define = X3D .define,
15
+ require = X3D .require;
16
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
17
+ *******************************************************************************
18
+ *
19
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
20
+ *
21
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
22
+ *
23
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
24
+ *
25
+ * The copyright notice above does not evidence any actual of intended
26
+ * publication of such source code, and is an unpublished work by create3000.
27
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
28
+ * create3000.
29
+ *
30
+ * No permission is granted to copy, distribute, or create derivative works from
31
+ * the contents of this software, in whole or in part, without the prior written
32
+ * permission of create3000.
33
+ *
34
+ * NON-MILITARY USE ONLY
35
+ *
36
+ * All create3000 software are effectively free software with a non-military use
37
+ * restriction. It is free. Well commented source is provided. You may reuse the
38
+ * source in any way you please with the exception anything that uses it must be
39
+ * marked to indicate is contains 'non-military use only' components.
40
+ *
41
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
42
+ *
43
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
44
+ *
45
+ * This file is part of the X_ITE Project.
46
+ *
47
+ * X_ITE is free software: you can redistribute it and/or modify it under the
48
+ * terms of the GNU General Public License version 3 only, as published by the
49
+ * Free Software Foundation.
50
+ *
51
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
52
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
53
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
54
+ * details (a copy is included in the LICENSE file that accompanied this code).
55
+ *
56
+ * You should have received a copy of the GNU General Public License version 3
57
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
58
+ * copy of the GPLv3 License.
59
+ *
60
+ * For Silvio, Joy and Adi.
61
+ *
62
+ ******************************************************************************/
63
+
64
+
65
+ define ('x_ite/Browser/Geometry2D/Arc2DOptions',[
66
+ "x_ite/Basic/X3DBaseNode",
67
+ "x_ite/Fields",
68
+ ],
69
+ function (X3DBaseNode,
70
+ Fields)
71
+ {
72
+ "use strict";
73
+
74
+ function ArcClose2DOptions (executionContext)
75
+ {
76
+ X3DBaseNode .call (this, executionContext);
77
+
78
+ this .addChildObjects ("dimension", new Fields .SFInt32 (40))
79
+ }
80
+
81
+ ArcClose2DOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
82
+ {
83
+ constructor: ArcClose2DOptions,
84
+ getTypeName: function ()
85
+ {
86
+ return "ArcClose2DOptions";
87
+ },
88
+ getComponentName: function ()
89
+ {
90
+ return "X_ITE";
91
+ },
92
+ getContainerField: function ()
93
+ {
94
+ return "arcClose2DOptions";
95
+ },
96
+ });
97
+
98
+ return ArcClose2DOptions;
99
+ });
100
+
101
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
102
+ *******************************************************************************
103
+ *
104
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
105
+ *
106
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
107
+ *
108
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
109
+ *
110
+ * The copyright notice above does not evidence any actual of intended
111
+ * publication of such source code, and is an unpublished work by create3000.
112
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
113
+ * create3000.
114
+ *
115
+ * No permission is granted to copy, distribute, or create derivative works from
116
+ * the contents of this software, in whole or in part, without the prior written
117
+ * permission of create3000.
118
+ *
119
+ * NON-MILITARY USE ONLY
120
+ *
121
+ * All create3000 software are effectively free software with a non-military use
122
+ * restriction. It is free. Well commented source is provided. You may reuse the
123
+ * source in any way you please with the exception anything that uses it must be
124
+ * marked to indicate is contains 'non-military use only' components.
125
+ *
126
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
127
+ *
128
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
129
+ *
130
+ * This file is part of the X_ITE Project.
131
+ *
132
+ * X_ITE is free software: you can redistribute it and/or modify it under the
133
+ * terms of the GNU General Public License version 3 only, as published by the
134
+ * Free Software Foundation.
135
+ *
136
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
137
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
138
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
139
+ * details (a copy is included in the LICENSE file that accompanied this code).
140
+ *
141
+ * You should have received a copy of the GNU General Public License version 3
142
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
143
+ * copy of the GPLv3 License.
144
+ *
145
+ * For Silvio, Joy and Adi.
146
+ *
147
+ ******************************************************************************/
148
+
149
+
150
+ define ('x_ite/Browser/Geometry2D/ArcClose2DOptions',[
151
+ "x_ite/Basic/X3DBaseNode",
152
+ "x_ite/Fields",
153
+ ],
154
+ function (X3DBaseNode,
155
+ Fields)
156
+ {
157
+ "use strict";
158
+
159
+ function Arc2DOptions (executionContext)
160
+ {
161
+ X3DBaseNode .call (this, executionContext);
162
+
163
+ this .addChildObjects ("dimension", new Fields .SFInt32 (40))
164
+ }
165
+
166
+ Arc2DOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
167
+ {
168
+ constructor: Arc2DOptions,
169
+ getTypeName: function ()
170
+ {
171
+ return "Arc2DOptions";
172
+ },
173
+ getComponentName: function ()
174
+ {
175
+ return "X_ITE";
176
+ },
177
+ getContainerField: function ()
178
+ {
179
+ return "arc2DOptions";
180
+ },
181
+ });
182
+
183
+ return Arc2DOptions;
184
+ });
185
+
186
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
187
+ *******************************************************************************
188
+ *
189
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
190
+ *
191
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
192
+ *
193
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
194
+ *
195
+ * The copyright notice above does not evidence any actual of intended
196
+ * publication of such source code, and is an unpublished work by create3000.
197
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
198
+ * create3000.
199
+ *
200
+ * No permission is granted to copy, distribute, or create derivative works from
201
+ * the contents of this software, in whole or in part, without the prior written
202
+ * permission of create3000.
203
+ *
204
+ * NON-MILITARY USE ONLY
205
+ *
206
+ * All create3000 software are effectively free software with a non-military use
207
+ * restriction. It is free. Well commented source is provided. You may reuse the
208
+ * source in any way you please with the exception anything that uses it must be
209
+ * marked to indicate is contains 'non-military use only' components.
210
+ *
211
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
212
+ *
213
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
214
+ *
215
+ * This file is part of the X_ITE Project.
216
+ *
217
+ * X_ITE is free software: you can redistribute it and/or modify it under the
218
+ * terms of the GNU General Public License version 3 only, as published by the
219
+ * Free Software Foundation.
220
+ *
221
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
222
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
223
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
224
+ * details (a copy is included in the LICENSE file that accompanied this code).
225
+ *
226
+ * You should have received a copy of the GNU General Public License version 3
227
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
228
+ * copy of the GPLv3 License.
229
+ *
230
+ * For Silvio, Joy and Adi.
231
+ *
232
+ ******************************************************************************/
233
+
234
+
235
+ define ('x_ite/Browser/Geometry2D/Circle2DOptions',[
236
+ "x_ite/Basic/X3DBaseNode",
237
+ "x_ite/Fields",
238
+ "x_ite/Components/Rendering/X3DGeometryNode",
239
+ "standard/Math/Numbers/Complex",
240
+ "standard/Math/Numbers/Vector3",
241
+ ],
242
+ function (X3DBaseNode,
243
+ Fields,
244
+ X3DGeometryNode,
245
+ Complex,
246
+ Vector3)
247
+ {
248
+ "use strict";
249
+
250
+ function Circle2DOptions (executionContext)
251
+ {
252
+ X3DBaseNode .call (this, executionContext);
253
+
254
+ this .addChildObjects ("dimension", new Fields .SFInt32 (40))
255
+
256
+ this .vertices = X3DGeometryNode .createArray ();
257
+ }
258
+
259
+ Circle2DOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
260
+ {
261
+ constructor: Circle2DOptions,
262
+ getTypeName: function ()
263
+ {
264
+ return "Circle2DOptions";
265
+ },
266
+ getComponentName: function ()
267
+ {
268
+ return "X_ITE";
269
+ },
270
+ getContainerField: function ()
271
+ {
272
+ return "circle2DOptions";
273
+ },
274
+ initialize: function ()
275
+ {
276
+ this .addInterest ("build", this);
277
+
278
+ this .build ();
279
+ },
280
+ getVertices: function ()
281
+ {
282
+ return this .vertices;
283
+ },
284
+ build: function ()
285
+ {
286
+ var
287
+ dimension = this .dimension_ .getValue (),
288
+ angle = Math .PI * 2 / dimension,
289
+ vertices = this .vertices;
290
+
291
+ vertices .length = 0;
292
+
293
+ for (var n = 0; n < dimension; ++ n)
294
+ {
295
+ var point = Complex .Polar (1, angle * n);
296
+
297
+ vertices .push (point .real, point .imag, 0, 1);
298
+ }
299
+
300
+ vertices .shrinkToFit ();
301
+ },
302
+ });
303
+
304
+ return Circle2DOptions;
305
+ });
306
+
307
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
308
+ *******************************************************************************
309
+ *
310
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
311
+ *
312
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
313
+ *
314
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
315
+ *
316
+ * The copyright notice above does not evidence any actual of intended
317
+ * publication of such source code, and is an unpublished work by create3000.
318
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
319
+ * create3000.
320
+ *
321
+ * No permission is granted to copy, distribute, or create derivative works from
322
+ * the contents of this software, in whole or in part, without the prior written
323
+ * permission of create3000.
324
+ *
325
+ * NON-MILITARY USE ONLY
326
+ *
327
+ * All create3000 software are effectively free software with a non-military use
328
+ * restriction. It is free. Well commented source is provided. You may reuse the
329
+ * source in any way you please with the exception anything that uses it must be
330
+ * marked to indicate is contains 'non-military use only' components.
331
+ *
332
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
333
+ *
334
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
335
+ *
336
+ * This file is part of the X_ITE Project.
337
+ *
338
+ * X_ITE is free software: you can redistribute it and/or modify it under the
339
+ * terms of the GNU General Public License version 3 only, as published by the
340
+ * Free Software Foundation.
341
+ *
342
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
343
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
344
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
345
+ * details (a copy is included in the LICENSE file that accompanied this code).
346
+ *
347
+ * You should have received a copy of the GNU General Public License version 3
348
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
349
+ * copy of the GPLv3 License.
350
+ *
351
+ * For Silvio, Joy and Adi.
352
+ *
353
+ ******************************************************************************/
354
+
355
+
356
+ define ('x_ite/Browser/Geometry2D/Disk2DOptions',[
357
+ "x_ite/Basic/X3DBaseNode",
358
+ "x_ite/Fields",
359
+ "x_ite/Components/Rendering/X3DGeometryNode",
360
+ "standard/Math/Numbers/Complex",
361
+ "standard/Math/Numbers/Vector3",
362
+ ],
363
+ function (X3DBaseNode,
364
+ Fields,
365
+ X3DGeometryNode,
366
+ Complex,
367
+ Vector3)
368
+ {
369
+ "use strict";
370
+
371
+ function Disk2DOptions (executionContext)
372
+ {
373
+ X3DBaseNode .call (this, executionContext);
374
+
375
+ this .addChildObjects ("dimension", new Fields .SFInt32 (40))
376
+
377
+ this .circleVertices = X3DGeometryNode .createArray ();
378
+ this .diskTexCoords = X3DGeometryNode .createArray ();
379
+ this .diskNormals = X3DGeometryNode .createArray ();
380
+ this .diskVertices = X3DGeometryNode .createArray ();
381
+ }
382
+
383
+ Disk2DOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
384
+ {
385
+ constructor: Disk2DOptions,
386
+ getTypeName: function ()
387
+ {
388
+ return "Disk2DOptions";
389
+ },
390
+ getComponentName: function ()
391
+ {
392
+ return "X_ITE";
393
+ },
394
+ getContainerField: function ()
395
+ {
396
+ return "circle2DOptions";
397
+ },
398
+ initialize: function ()
399
+ {
400
+ this .addInterest ("build", this);
401
+
402
+ this .build ();
403
+ },
404
+ getCircleVertices: function ()
405
+ {
406
+ return this .circleVertices;
407
+ },
408
+ getDiskTexCoords: function ()
409
+ {
410
+ return this .diskTexCoords;
411
+ },
412
+ getDiskNormals: function ()
413
+ {
414
+ return this .diskNormals;
415
+ },
416
+ getDiskVertices: function ()
417
+ {
418
+ return this .diskVertices;
419
+ },
420
+ build: (function ()
421
+ {
422
+ var
423
+ half = new Complex (0.5, 0.5),
424
+ texCoord1 = new Complex (0, 0),
425
+ texCoord2 = new Complex (0, 0),
426
+ point1 = new Complex (0, 0),
427
+ point2 = new Complex (0, 0);
428
+
429
+ return function ()
430
+ {
431
+ var
432
+ dimension = this .dimension_ .getValue (),
433
+ angle = Math .PI * 2 / dimension,
434
+ circleVertices = this .circleVertices,
435
+ diskTexCoords = this .diskTexCoords,
436
+ diskNormals = this .diskNormals,
437
+ diskVertices = this .diskVertices;
438
+
439
+ circleVertices .length = 0;
440
+ diskTexCoords .length = 0;
441
+ diskNormals .length = 0;
442
+ diskVertices .length = 0;
443
+
444
+ for (var n = 0; n < dimension; ++ n)
445
+ {
446
+ var
447
+ theta1 = angle * n,
448
+ theta2 = angle * (n + 1);
449
+
450
+ texCoord1 .setPolar (0.5, theta1) .add (half);
451
+ texCoord2 .setPolar (0.5, theta2) .add (half);
452
+ point1 .setPolar (1, theta1);
453
+ point2 .setPolar (1, theta2);
454
+
455
+ // Circle
456
+
457
+ circleVertices .push (point1 .real, point1 .imag, 0, 1);
458
+
459
+ // Disk
460
+
461
+ diskTexCoords .push (0.5, 0.5, 0, 1,
462
+ texCoord1 .real, texCoord1 .imag, 0, 1,
463
+ texCoord2 .real, texCoord2 .imag, 0, 1);
464
+
465
+ diskNormals .push (0, 0, 1, 0, 0, 1, 0, 0, 1);
466
+
467
+ diskVertices .push (0, 0, 0, 1,
468
+ point1 .real, point1 .imag, 0, 1,
469
+ point2 .real, point2 .imag, 0, 1);
470
+ }
471
+
472
+ circleVertices .shrinkToFit ();
473
+ diskTexCoords .shrinkToFit ();
474
+ diskNormals .shrinkToFit ();
475
+ diskVertices .shrinkToFit ();
476
+ };
477
+ })(),
478
+ });
479
+
480
+ return Disk2DOptions;
481
+ });
482
+
483
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
484
+ *******************************************************************************
485
+ *
486
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
487
+ *
488
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
489
+ *
490
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
491
+ *
492
+ * The copyright notice above does not evidence any actual of intended
493
+ * publication of such source code, and is an unpublished work by create3000.
494
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
495
+ * create3000.
496
+ *
497
+ * No permission is granted to copy, distribute, or create derivative works from
498
+ * the contents of this software, in whole or in part, without the prior written
499
+ * permission of create3000.
500
+ *
501
+ * NON-MILITARY USE ONLY
502
+ *
503
+ * All create3000 software are effectively free software with a non-military use
504
+ * restriction. It is free. Well commented source is provided. You may reuse the
505
+ * source in any way you please with the exception anything that uses it must be
506
+ * marked to indicate is contains 'non-military use only' components.
507
+ *
508
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
509
+ *
510
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
511
+ *
512
+ * This file is part of the X_ITE Project.
513
+ *
514
+ * X_ITE is free software: you can redistribute it and/or modify it under the
515
+ * terms of the GNU General Public License version 3 only, as published by the
516
+ * Free Software Foundation.
517
+ *
518
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
519
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
520
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
521
+ * details (a copy is included in the LICENSE file that accompanied this code).
522
+ *
523
+ * You should have received a copy of the GNU General Public License version 3
524
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
525
+ * copy of the GPLv3 License.
526
+ *
527
+ * For Silvio, Joy and Adi.
528
+ *
529
+ ******************************************************************************/
530
+
531
+
532
+ define ('x_ite/Browser/Geometry2D/Rectangle2DOptions',[
533
+ "x_ite/Fields",
534
+ "x_ite/Basic/X3DBaseNode",
535
+ "x_ite/Components/Geometry3D/IndexedFaceSet",
536
+ "x_ite/Components/Rendering/Coordinate",
537
+ "x_ite/Components/Texturing/TextureCoordinate",
538
+ ],
539
+ function (Fields,
540
+ X3DBaseNode,
541
+ IndexedFaceSet,
542
+ Coordinate,
543
+ TextureCoordinate)
544
+ {
545
+ "use strict";
546
+
547
+ function Rectangle2DOptions (executionContext)
548
+ {
549
+ X3DBaseNode .call (this, executionContext);
550
+ }
551
+
552
+ Rectangle2DOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
553
+ {
554
+ constructor: Rectangle2DOptions,
555
+ getTypeName: function ()
556
+ {
557
+ return "Rectangle2DOptions";
558
+ },
559
+ getComponentName: function ()
560
+ {
561
+ return "X_ITE";
562
+ },
563
+ getContainerField: function ()
564
+ {
565
+ return "rectangle2DOptions";
566
+ },
567
+ initialize: function ()
568
+ {
569
+ X3DBaseNode .prototype .initialize .call (this);
570
+ },
571
+ getGeometry: function ()
572
+ {
573
+ if (this .geometry)
574
+ return this .geometry;
575
+
576
+ this .geometry = new IndexedFaceSet (this .getExecutionContext ());
577
+ this .geometry .texCoord_ = new TextureCoordinate (this .getExecutionContext ());
578
+ this .geometry .coord_ = new Coordinate (this .getExecutionContext ());
579
+
580
+ var
581
+ geometry = this .geometry,
582
+ texCoord = this .geometry .texCoord_ .getValue (),
583
+ coord = this .geometry .coord_ .getValue ();
584
+
585
+ geometry .texCoordIndex_ = new Fields .MFInt32 (
586
+ 0, 1, 2, 3, -1
587
+ );
588
+
589
+ geometry .coordIndex_ = new Fields .MFInt32 (
590
+ 0, 1, 2, 3, -1
591
+ );
592
+
593
+ texCoord .point_ = new Fields .MFVec2f (
594
+ new Fields .SFVec2f (1, 1), new Fields .SFVec2f (0, 1), new Fields .SFVec2f (0, 0), new Fields .SFVec2f (1, 0)
595
+ );
596
+
597
+ coord .point_ = new Fields .MFVec3f (
598
+ new Fields .SFVec3f (1, 1, 0), new Fields .SFVec3f (-1, 1, 0), new Fields .SFVec3f (-1, -1, 0), new Fields .SFVec3f (1, -1, 0)
599
+ );
600
+
601
+ texCoord .setup ();
602
+ coord .setup ();
603
+ geometry .setup ();
604
+
605
+ return this .geometry;
606
+ },
607
+ });
608
+
609
+ return Rectangle2DOptions;
610
+ });
611
+
612
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
613
+ *******************************************************************************
614
+ *
615
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
616
+ *
617
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
618
+ *
619
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
620
+ *
621
+ * The copyright notice above does not evidence any actual of intended
622
+ * publication of such source code, and is an unpublished work by create3000.
623
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
624
+ * create3000.
625
+ *
626
+ * No permission is granted to copy, distribute, or create derivative works from
627
+ * the contents of this software, in whole or in part, without the prior written
628
+ * permission of create3000.
629
+ *
630
+ * NON-MILITARY USE ONLY
631
+ *
632
+ * All create3000 software are effectively free software with a non-military use
633
+ * restriction. It is free. Well commented source is provided. You may reuse the
634
+ * source in any way you please with the exception anything that uses it must be
635
+ * marked to indicate is contains 'non-military use only' components.
636
+ *
637
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
638
+ *
639
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
640
+ *
641
+ * This file is part of the X_ITE Project.
642
+ *
643
+ * X_ITE is free software: you can redistribute it and/or modify it under the
644
+ * terms of the GNU General Public License version 3 only, as published by the
645
+ * Free Software Foundation.
646
+ *
647
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
648
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
649
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
650
+ * details (a copy is included in the LICENSE file that accompanied this code).
651
+ *
652
+ * You should have received a copy of the GNU General Public License version 3
653
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
654
+ * copy of the GPLv3 License.
655
+ *
656
+ * For Silvio, Joy and Adi.
657
+ *
658
+ ******************************************************************************/
659
+
660
+
661
+ define ('x_ite/Browser/Geometry2D/X3DGeometry2DContext',[
662
+ "x_ite/Browser/Geometry2D/Arc2DOptions",
663
+ "x_ite/Browser/Geometry2D/ArcClose2DOptions",
664
+ "x_ite/Browser/Geometry2D/Circle2DOptions",
665
+ "x_ite/Browser/Geometry2D/Disk2DOptions",
666
+ "x_ite/Browser/Geometry2D/Rectangle2DOptions",
667
+ "x_ite/Browser/Core/PrimitiveQuality",
668
+ ],
669
+ function (Arc2DOptions,
670
+ ArcClose2DOptions,
671
+ Circle2DOptions,
672
+ Disk2DOptions,
673
+ Rectangle2DOptions,
674
+ PrimitiveQuality)
675
+ {
676
+ "use strict";
677
+
678
+ function getOptionNode (fun, name, Type)
679
+ {
680
+ this [name] = new Type (this .getPrivateScene ());
681
+ this [name] .setup ();
682
+
683
+ this [fun] = function () { return this [name]; };
684
+
685
+ return this [name];
686
+ }
687
+
688
+ function X3DGeometry2DContext () { }
689
+
690
+ X3DGeometry2DContext .prototype =
691
+ {
692
+ initialize: function ()
693
+ {
694
+ this .setGeometry2DPrimitiveQuality (this .getBrowserOptions () .getPrimitiveQuality ());
695
+ },
696
+ getArc2DOptions: function ()
697
+ {
698
+ return getOptionNode .call (this, "getArc2DOptions", "arc2DOptions", Arc2DOptions);
699
+ },
700
+ getArcClose2DOptions: function ()
701
+ {
702
+ return getOptionNode .call (this, "getArcClose2DOptions", "arcClose2DOptions", ArcClose2DOptions);
703
+ },
704
+ getCircle2DOptions: function ()
705
+ {
706
+ return getOptionNode .call (this, "getCircle2DOptions", "circle2DOptions", Circle2DOptions);
707
+ },
708
+ getDisk2DOptions: function ()
709
+ {
710
+ return getOptionNode .call (this, "getDisk2DOptions", "disk2DOptions", Disk2DOptions);
711
+ },
712
+ getRectangle2DOptions: function ()
713
+ {
714
+ return getOptionNode .call (this, "getRectangle2DOptions", "rectangle2DOptions", Rectangle2DOptions);
715
+ },
716
+ setGeometry2DPrimitiveQuality: function (primitiveQuality)
717
+ {
718
+ var
719
+ arc = this .getArc2DOptions (),
720
+ arcClose = this .getArcClose2DOptions (),
721
+ circle = this .getCircle2DOptions (),
722
+ disk = this .getDisk2DOptions ();
723
+
724
+ switch (primitiveQuality)
725
+ {
726
+ case PrimitiveQuality .LOW:
727
+ {
728
+ arc .dimension_ = 20;
729
+ arcClose .dimension_ = 20;
730
+ circle .dimension_ = 20;
731
+ disk .dimension_ = 20;
732
+ break;
733
+ }
734
+ case PrimitiveQuality .MEDIUM:
735
+ {
736
+ arc .dimension_ = 40;
737
+ arcClose .dimension_ = 40;
738
+ circle .dimension_ = 40;
739
+ disk .dimension_ = 40;
740
+ break;
741
+ }
742
+ case PrimitiveQuality .HIGH:
743
+ {
744
+ arc .dimension_ = 80;
745
+ arcClose .dimension_ = 80;
746
+ circle .dimension_ = 80;
747
+ disk .dimension_ = 80;
748
+ break;
749
+ }
750
+ }
751
+ },
752
+ };
753
+
754
+ return X3DGeometry2DContext;
755
+ });
756
+
757
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
758
+ *******************************************************************************
759
+ *
760
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
761
+ *
762
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
763
+ *
764
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
765
+ *
766
+ * The copyright notice above does not evidence any actual of intended
767
+ * publication of such source code, and is an unpublished work by create3000.
768
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
769
+ * create3000.
770
+ *
771
+ * No permission is granted to copy, distribute, or create derivative works from
772
+ * the contents of this software, in whole or in part, without the prior written
773
+ * permission of create3000.
774
+ *
775
+ * NON-MILITARY USE ONLY
776
+ *
777
+ * All create3000 software are effectively free software with a non-military use
778
+ * restriction. It is free. Well commented source is provided. You may reuse the
779
+ * source in any way you please with the exception anything that uses it must be
780
+ * marked to indicate is contains 'non-military use only' components.
781
+ *
782
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
783
+ *
784
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
785
+ *
786
+ * This file is part of the X_ITE Project.
787
+ *
788
+ * X_ITE is free software: you can redistribute it and/or modify it under the
789
+ * terms of the GNU General Public License version 3 only, as published by the
790
+ * Free Software Foundation.
791
+ *
792
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
793
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
794
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
795
+ * details (a copy is included in the LICENSE file that accompanied this code).
796
+ *
797
+ * You should have received a copy of the GNU General Public License version 3
798
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
799
+ * copy of the GPLv3 License.
800
+ *
801
+ * For Silvio, Joy and Adi.
802
+ *
803
+ ******************************************************************************/
804
+
805
+
806
+ define ('x_ite/Components/Geometry2D/Arc2D',[
807
+ "x_ite/Fields",
808
+ "x_ite/Basic/X3DFieldDefinition",
809
+ "x_ite/Basic/FieldDefinitionArray",
810
+ "x_ite/Components/Rendering/X3DLineGeometryNode",
811
+ "x_ite/Bits/X3DConstants",
812
+ "standard/Math/Numbers/Complex",
813
+ "standard/Math/Algorithm",
814
+ ],
815
+ function (Fields,
816
+ X3DFieldDefinition,
817
+ FieldDefinitionArray,
818
+ X3DLineGeometryNode,
819
+ X3DConstants,
820
+ Complex,
821
+ Algorithm)
822
+ {
823
+ "use strict";
824
+
825
+ function Arc2D (executionContext)
826
+ {
827
+ X3DLineGeometryNode .call (this, executionContext);
828
+
829
+ this .addType (X3DConstants .Arc2D);
830
+
831
+ this .setGeometryType (1);
832
+
833
+ this .startAngle_ .setUnit ("angle");
834
+ this .endAngle_ .setUnit ("angle");
835
+ this .radius_ .setUnit ("length");
836
+ }
837
+
838
+ Arc2D .prototype = Object .assign (Object .create (X3DLineGeometryNode .prototype),
839
+ {
840
+ constructor: Arc2D,
841
+ fieldDefinitions: new FieldDefinitionArray ([
842
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
843
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "startAngle", new Fields .SFFloat ()),
844
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "endAngle", new Fields .SFFloat (1.5708)),
845
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "radius", new Fields .SFFloat (1)),
846
+ ]),
847
+ getTypeName: function ()
848
+ {
849
+ return "Arc2D";
850
+ },
851
+ getComponentName: function ()
852
+ {
853
+ return "Geometry2D";
854
+ },
855
+ getContainerField: function ()
856
+ {
857
+ return "geometry";
858
+ },
859
+ set_live__: function ()
860
+ {
861
+ X3DLineGeometryNode .prototype .set_live__ .call (this);
862
+
863
+ if (this .isLive () .getValue ())
864
+ this .getBrowser () .getArc2DOptions () .addInterest ("requestRebuild", this);
865
+ else
866
+ this .getBrowser () .getArc2DOptions () .removeInterest ("requestRebuild", this);
867
+ },
868
+ getSweepAngle: function ()
869
+ {
870
+ var
871
+ start = Algorithm .interval (this .startAngle_ .getValue (), 0, Math .PI * 2),
872
+ end = Algorithm .interval (this .endAngle_ .getValue (), 0, Math .PI * 2);
873
+
874
+ if (start === end)
875
+ return Math .PI * 2;
876
+
877
+ var sweepAngle = Math .abs (end - start);
878
+
879
+ if (start > end)
880
+ return (Math .PI * 2) - sweepAngle;
881
+
882
+ if (! isNaN (sweepAngle))
883
+ return sweepAngle;
884
+
885
+ // We must test for NAN, as NAN to int is undefined.
886
+ return 0;
887
+ },
888
+ build: function ()
889
+ {
890
+ var
891
+ gl = this .getBrowser () .getContext (),
892
+ options = this .getBrowser () .getArc2DOptions (),
893
+ dimension = options .dimension_ .getValue (),
894
+ startAngle = this .startAngle_ .getValue (),
895
+ radius = Math .abs (this .radius_ .getValue ()),
896
+ sweepAngle = this .getSweepAngle (),
897
+ circle = sweepAngle == (Math .PI * 2),
898
+ steps = Math .floor (sweepAngle * dimension / (Math .PI * 2)),
899
+ vertexArray = this .getVertices ();
900
+
901
+ steps = Math .max (3, steps);
902
+
903
+ if (! circle)
904
+ {
905
+ ++ steps;
906
+ this .setPrimitiveMode (gl .LINE_STRIP);
907
+ }
908
+ else
909
+ this .setPrimitiveMode (gl .LINE_LOOP);
910
+
911
+ var steps_1 = circle ? steps : steps - 1;
912
+
913
+ for (var n = 0; n < steps; ++ n)
914
+ {
915
+ var
916
+ t = n / steps_1,
917
+ theta = startAngle + (sweepAngle * t),
918
+ point = Complex .Polar (radius, theta);
919
+
920
+ vertexArray .push (point .real, point .imag, 0, 1);
921
+ }
922
+
923
+ this .getMin () .set (-radius, -radius, 0);
924
+ this .getMax () .set ( radius, radius, 0);
925
+
926
+ this .setSolid (false);
927
+ },
928
+ });
929
+
930
+ return Arc2D;
931
+ });
932
+
933
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
934
+ *******************************************************************************
935
+ *
936
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
937
+ *
938
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
939
+ *
940
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
941
+ *
942
+ * The copyright notice above does not evidence any actual of intended
943
+ * publication of such source code, and is an unpublished work by create3000.
944
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
945
+ * create3000.
946
+ *
947
+ * No permission is granted to copy, distribute, or create derivative works from
948
+ * the contents of this software, in whole or in part, without the prior written
949
+ * permission of create3000.
950
+ *
951
+ * NON-MILITARY USE ONLY
952
+ *
953
+ * All create3000 software are effectively free software with a non-military use
954
+ * restriction. It is free. Well commented source is provided. You may reuse the
955
+ * source in any way you please with the exception anything that uses it must be
956
+ * marked to indicate is contains 'non-military use only' components.
957
+ *
958
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
959
+ *
960
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
961
+ *
962
+ * This file is part of the X_ITE Project.
963
+ *
964
+ * X_ITE is free software: you can redistribute it and/or modify it under the
965
+ * terms of the GNU General Public License version 3 only, as published by the
966
+ * Free Software Foundation.
967
+ *
968
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
969
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
970
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
971
+ * details (a copy is included in the LICENSE file that accompanied this code).
972
+ *
973
+ * You should have received a copy of the GNU General Public License version 3
974
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
975
+ * copy of the GPLv3 License.
976
+ *
977
+ * For Silvio, Joy and Adi.
978
+ *
979
+ ******************************************************************************/
980
+
981
+
982
+ define ('x_ite/Components/Geometry2D/ArcClose2D',[
983
+ "x_ite/Fields",
984
+ "x_ite/Basic/X3DFieldDefinition",
985
+ "x_ite/Basic/FieldDefinitionArray",
986
+ "x_ite/Components/Rendering/X3DGeometryNode",
987
+ "x_ite/Bits/X3DConstants",
988
+ "standard/Math/Numbers/Complex",
989
+ "standard/Math/Numbers/Vector3",
990
+ "standard/Math/Algorithm",
991
+ ],
992
+ function (Fields,
993
+ X3DFieldDefinition,
994
+ FieldDefinitionArray,
995
+ X3DGeometryNode,
996
+ X3DConstants,
997
+ Complex,
998
+ Vector3,
999
+ Algorithm)
1000
+ {
1001
+ "use strict";
1002
+
1003
+ function ArcClose2D (executionContext)
1004
+ {
1005
+ X3DGeometryNode .call (this, executionContext);
1006
+
1007
+ this .addType (X3DConstants .ArcClose2D);
1008
+
1009
+ this .setGeometryType (2);
1010
+
1011
+ this .startAngle_ .setUnit ("angle");
1012
+ this .endAngle_ .setUnit ("angle");
1013
+ this .radius_ .setUnit ("length");
1014
+ }
1015
+
1016
+ ArcClose2D .prototype = Object .assign (Object .create (X3DGeometryNode .prototype),
1017
+ {
1018
+ constructor: ArcClose2D,
1019
+ fieldDefinitions: new FieldDefinitionArray ([
1020
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1021
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "closureType", new Fields .SFString ("PIE")),
1022
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "startAngle", new Fields .SFFloat ()),
1023
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "endAngle", new Fields .SFFloat (1.5708)),
1024
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "radius", new Fields .SFFloat (1)),
1025
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "solid", new Fields .SFBool ()),
1026
+ ]),
1027
+ getTypeName: function ()
1028
+ {
1029
+ return "ArcClose2D";
1030
+ },
1031
+ getComponentName: function ()
1032
+ {
1033
+ return "Geometry2D";
1034
+ },
1035
+ getContainerField: function ()
1036
+ {
1037
+ return "geometry";
1038
+ },
1039
+ set_live__: function ()
1040
+ {
1041
+ X3DGeometryNode .prototype .set_live__ .call (this);
1042
+
1043
+ if (this .isLive () .getValue ())
1044
+ this .getBrowser () .getArcClose2DOptions () .addInterest ("requestRebuild", this);
1045
+ else
1046
+ this .getBrowser () .getArcClose2DOptions () .removeInterest ("requestRebuild", this);
1047
+ },
1048
+ getSweepAngle: function ()
1049
+ {
1050
+ var
1051
+ start = Algorithm .interval (this .startAngle_ .getValue (), 0, Math .PI * 2),
1052
+ end = Algorithm .interval (this .endAngle_ .getValue (), 0, Math .PI * 2);
1053
+
1054
+ if (start === end)
1055
+ return Math .PI * 2;
1056
+
1057
+ var sweepAngle = Math .abs (end - start);
1058
+
1059
+ if (start > end)
1060
+ return (Math .PI * 2) - sweepAngle;
1061
+
1062
+ if (! isNaN (sweepAngle))
1063
+ return sweepAngle;
1064
+
1065
+ // We must test for NAN, as NAN to int is undefined.
1066
+ return 0;
1067
+ },
1068
+ build: (function ()
1069
+ {
1070
+ var half = new Complex (0.5, 0.5);
1071
+
1072
+ return function ()
1073
+ {
1074
+ var
1075
+ options = this .getBrowser () .getArcClose2DOptions (),
1076
+ chord = this .closureType_ .getValue () === "CHORD",
1077
+ dimension = options .dimension_ .getValue (),
1078
+ startAngle = this .startAngle_ .getValue (),
1079
+ radius = Math .abs (this .radius_ .getValue ()),
1080
+ sweepAngle = this .getSweepAngle (),
1081
+ steps = Math .max (4, Math .floor (sweepAngle * dimension / (Math .PI * 2))),
1082
+ texCoordArray = this .getTexCoords (),
1083
+ normalArray = this .getNormals (),
1084
+ vertexArray = this .getVertices (),
1085
+ texCoords = [ ],
1086
+ points = [ ];
1087
+
1088
+ this .getMultiTexCoords () .push (texCoordArray);
1089
+
1090
+ var steps_1 = steps - 1;
1091
+
1092
+ for (var n = 0; n < steps; ++ n)
1093
+ {
1094
+ var
1095
+ t = n / steps_1,
1096
+ theta = startAngle + (sweepAngle * t);
1097
+
1098
+ texCoords .push (Complex .Polar (0.5, theta) .add (half));
1099
+ points .push (Complex .Polar (radius, theta));
1100
+ }
1101
+
1102
+ if (chord)
1103
+ {
1104
+ var
1105
+ t0 = texCoords [0],
1106
+ p0 = points [0];
1107
+
1108
+ for (var i = 1; i < steps_1; ++ i)
1109
+ {
1110
+ var
1111
+ t1 = texCoords [i],
1112
+ t2 = texCoords [i + 1],
1113
+ p1 = points [i],
1114
+ p2 = points [i + 1];
1115
+
1116
+ texCoordArray .push (t0 .real, t0 .imag, 0, 1,
1117
+ t1 .real, t1 .imag, 0, 1,
1118
+ t2 .real, t2 .imag, 0, 1);
1119
+
1120
+ normalArray .push (0, 0, 1,
1121
+ 0, 0, 1,
1122
+ 0, 0, 1);
1123
+
1124
+ vertexArray .push (p0 .real, p0 .imag, 0, 1,
1125
+ p1 .real, p1 .imag, 0, 1,
1126
+ p2 .real, p2 .imag, 0, 1);
1127
+ }
1128
+ }
1129
+ else
1130
+ {
1131
+ for (var i = 0; i < steps_1; ++ i)
1132
+ {
1133
+ var
1134
+ t1 = texCoords [i],
1135
+ t2 = texCoords [i + 1],
1136
+ p1 = points [i],
1137
+ p2 = points [i + 1];
1138
+
1139
+ texCoordArray .push (0.5, 0.5, 0, 1,
1140
+ t1 .real, t1 .imag, 0, 1,
1141
+ t2 .real, t2 .imag, 0, 1);
1142
+
1143
+ normalArray .push (0, 0, 1, 0, 0, 1, 0, 0, 1);
1144
+
1145
+ vertexArray .push (0, 0, 0, 1,
1146
+ p1 .real, p1 .imag, 0, 1,
1147
+ p2 .real, p2 .imag, 0, 1);
1148
+ }
1149
+ }
1150
+
1151
+ this .getMin () .set (-radius, -radius, 0);
1152
+ this .getMax () .set ( radius, radius, 0);
1153
+
1154
+ this .setSolid (this .solid_ .getValue ());
1155
+ };
1156
+ })(),
1157
+ });
1158
+
1159
+ return ArcClose2D;
1160
+ });
1161
+
1162
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1163
+ *******************************************************************************
1164
+ *
1165
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1166
+ *
1167
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1168
+ *
1169
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1170
+ *
1171
+ * The copyright notice above does not evidence any actual of intended
1172
+ * publication of such source code, and is an unpublished work by create3000.
1173
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1174
+ * create3000.
1175
+ *
1176
+ * No permission is granted to copy, distribute, or create derivative works from
1177
+ * the contents of this software, in whole or in part, without the prior written
1178
+ * permission of create3000.
1179
+ *
1180
+ * NON-MILITARY USE ONLY
1181
+ *
1182
+ * All create3000 software are effectively free software with a non-military use
1183
+ * restriction. It is free. Well commented source is provided. You may reuse the
1184
+ * source in any way you please with the exception anything that uses it must be
1185
+ * marked to indicate is contains 'non-military use only' components.
1186
+ *
1187
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1188
+ *
1189
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1190
+ *
1191
+ * This file is part of the X_ITE Project.
1192
+ *
1193
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1194
+ * terms of the GNU General Public License version 3 only, as published by the
1195
+ * Free Software Foundation.
1196
+ *
1197
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1198
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1199
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1200
+ * details (a copy is included in the LICENSE file that accompanied this code).
1201
+ *
1202
+ * You should have received a copy of the GNU General Public License version 3
1203
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1204
+ * copy of the GPLv3 License.
1205
+ *
1206
+ * For Silvio, Joy and Adi.
1207
+ *
1208
+ ******************************************************************************/
1209
+
1210
+
1211
+ define ('x_ite/Components/Geometry2D/Circle2D',[
1212
+ "x_ite/Fields",
1213
+ "x_ite/Basic/X3DFieldDefinition",
1214
+ "x_ite/Basic/FieldDefinitionArray",
1215
+ "x_ite/Components/Rendering/X3DLineGeometryNode",
1216
+ "x_ite/Bits/X3DConstants",
1217
+ ],
1218
+ function (Fields,
1219
+ X3DFieldDefinition,
1220
+ FieldDefinitionArray,
1221
+ X3DLineGeometryNode,
1222
+ X3DConstants)
1223
+ {
1224
+ "use strict";
1225
+
1226
+ function Circle2D (executionContext)
1227
+ {
1228
+ X3DLineGeometryNode .call (this, executionContext);
1229
+
1230
+ this .addType (X3DConstants .Circle2D);
1231
+
1232
+ this .setGeometryType (1);
1233
+
1234
+ this .radius_ .setUnit ("length");
1235
+ }
1236
+
1237
+ Circle2D .prototype = Object .assign (Object .create (X3DLineGeometryNode .prototype),
1238
+ {
1239
+ constructor: Circle2D,
1240
+ fieldDefinitions: new FieldDefinitionArray ([
1241
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1242
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "radius", new Fields .SFFloat (1)),
1243
+ ]),
1244
+ getTypeName: function ()
1245
+ {
1246
+ return "Circle2D";
1247
+ },
1248
+ getComponentName: function ()
1249
+ {
1250
+ return "Geometry2D";
1251
+ },
1252
+ getContainerField: function ()
1253
+ {
1254
+ return "geometry";
1255
+ },
1256
+ initialize: function ()
1257
+ {
1258
+ X3DLineGeometryNode .prototype .initialize .call (this);
1259
+
1260
+ this .setPrimitiveMode (this .getBrowser () .getContext () .LINE_LOOP);
1261
+ },
1262
+ set_live__: function ()
1263
+ {
1264
+ X3DLineGeometryNode .prototype .set_live__ .call (this);
1265
+
1266
+ if (this .isLive () .getValue ())
1267
+ this .getBrowser () .getCircle2DOptions () .addInterest ("requestRebuild", this);
1268
+ else
1269
+ this .getBrowser () .getCircle2DOptions () .removeInterest ("requestRebuild", this);
1270
+ },
1271
+ build: function ()
1272
+ {
1273
+ var
1274
+ options = this .getBrowser () .getCircle2DOptions (),
1275
+ vertexArray = this .getVertices (),
1276
+ radius = this .radius_ .getValue ();
1277
+
1278
+ if (radius === 1)
1279
+ {
1280
+ this .setVertices (options .getVertices ());
1281
+ }
1282
+ else
1283
+ {
1284
+ var defaultVertices = options .getVertices () .getValue ();
1285
+
1286
+ for (var i = 0, length = defaultVertices .length; i < length; i += 4)
1287
+ vertexArray .push (defaultVertices [i] * radius, defaultVertices [i + 1] * radius, 0, 1);
1288
+ }
1289
+
1290
+ this .getMin () .set (-radius, -radius, 0);
1291
+ this .getMax () .set ( radius, radius, 0);
1292
+ },
1293
+ });
1294
+
1295
+ return Circle2D;
1296
+ });
1297
+
1298
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1299
+ *******************************************************************************
1300
+ *
1301
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1302
+ *
1303
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1304
+ *
1305
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1306
+ *
1307
+ * The copyright notice above does not evidence any actual of intended
1308
+ * publication of such source code, and is an unpublished work by create3000.
1309
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1310
+ * create3000.
1311
+ *
1312
+ * No permission is granted to copy, distribute, or create derivative works from
1313
+ * the contents of this software, in whole or in part, without the prior written
1314
+ * permission of create3000.
1315
+ *
1316
+ * NON-MILITARY USE ONLY
1317
+ *
1318
+ * All create3000 software are effectively free software with a non-military use
1319
+ * restriction. It is free. Well commented source is provided. You may reuse the
1320
+ * source in any way you please with the exception anything that uses it must be
1321
+ * marked to indicate is contains 'non-military use only' components.
1322
+ *
1323
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1324
+ *
1325
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1326
+ *
1327
+ * This file is part of the X_ITE Project.
1328
+ *
1329
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1330
+ * terms of the GNU General Public License version 3 only, as published by the
1331
+ * Free Software Foundation.
1332
+ *
1333
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1334
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1335
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1336
+ * details (a copy is included in the LICENSE file that accompanied this code).
1337
+ *
1338
+ * You should have received a copy of the GNU General Public License version 3
1339
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1340
+ * copy of the GPLv3 License.
1341
+ *
1342
+ * For Silvio, Joy and Adi.
1343
+ *
1344
+ ******************************************************************************/
1345
+
1346
+
1347
+ define ('x_ite/Components/Geometry2D/Disk2D',[
1348
+ "x_ite/Fields",
1349
+ "x_ite/Basic/X3DFieldDefinition",
1350
+ "x_ite/Basic/FieldDefinitionArray",
1351
+ "x_ite/Components/Rendering/X3DGeometryNode",
1352
+ "x_ite/Components/Rendering/X3DLineGeometryNode",
1353
+ "x_ite/Bits/X3DConstants",
1354
+ ],
1355
+ function (Fields,
1356
+ X3DFieldDefinition,
1357
+ FieldDefinitionArray,
1358
+ X3DGeometryNode,
1359
+ X3DLineGeometryNode,
1360
+ X3DConstants)
1361
+ {
1362
+ "use strict";
1363
+
1364
+ function Disk2D (executionContext)
1365
+ {
1366
+ X3DLineGeometryNode .call (this, executionContext);
1367
+
1368
+ this .addType (X3DConstants .Disk2D);
1369
+
1370
+ this .innerRadius_ .setUnit ("length");
1371
+ this .outerRadius_ .setUnit ("length");
1372
+ }
1373
+
1374
+ Disk2D .prototype = Object .assign (Object .create (X3DGeometryNode .prototype),
1375
+ //X3DLineGeometryNode .prototype, // Considered X3DLineGeometryNode.
1376
+ {
1377
+ constructor: Disk2D,
1378
+ fieldDefinitions: new FieldDefinitionArray ([
1379
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1380
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "innerRadius", new Fields .SFFloat ()),
1381
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "outerRadius", new Fields .SFFloat (1)),
1382
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "solid", new Fields .SFBool ()),
1383
+ ]),
1384
+ getTypeName: function ()
1385
+ {
1386
+ return "Disk2D";
1387
+ },
1388
+ getComponentName: function ()
1389
+ {
1390
+ return "Geometry2D";
1391
+ },
1392
+ getContainerField: function ()
1393
+ {
1394
+ return "geometry";
1395
+ },
1396
+ initialize: function ()
1397
+ {
1398
+ X3DGeometryNode .prototype .initialize .call (this);
1399
+
1400
+ this .setPrimitiveMode (this .getBrowser () .getContext () .LINE_LOOP);
1401
+ },
1402
+ set_live__: function ()
1403
+ {
1404
+ X3DGeometryNode .prototype .set_live__ .call (this);
1405
+
1406
+ if (this .isLive () .getValue ())
1407
+ this .getBrowser () .getDisk2DOptions () .addInterest ("requestRebuild", this);
1408
+ else
1409
+ this .getBrowser () .getDisk2DOptions () .removeInterest ("requestRebuild", this);
1410
+ },
1411
+ getShader: X3DLineGeometryNode .prototype .getShader,
1412
+ build: function ()
1413
+ {
1414
+ const
1415
+ options = this .getBrowser () .getDisk2DOptions (),
1416
+ innerRadius = Math .min (Math .abs (this .innerRadius_ .getValue ()), Math .abs (this .outerRadius_ .getValue ())),
1417
+ outerRadius = Math .max (Math .abs (this .innerRadius_ .getValue ()), Math .abs (this .outerRadius_ .getValue ()));
1418
+
1419
+ if (innerRadius === outerRadius)
1420
+ {
1421
+ const vertexArray = this .getVertices ();
1422
+
1423
+ // Point
1424
+
1425
+ if (outerRadius === 0)
1426
+ {
1427
+ // vertexArray .push (0, 0, 0, 1);
1428
+ // this .setGeometryType (0);
1429
+ return;
1430
+ }
1431
+
1432
+ // Circle
1433
+
1434
+ if (outerRadius === 1)
1435
+ {
1436
+ this .setVertices (options .getCircleVertices ());
1437
+ }
1438
+ else
1439
+ {
1440
+ const defaultVertices = options .getCircleVertices () .getValue ();
1441
+
1442
+ for (let i = 0, length = defaultVertices .length; i < length; i += 4)
1443
+ vertexArray .push (defaultVertices [i] * outerRadius, defaultVertices [i + 1] * outerRadius, 0, 1);
1444
+ }
1445
+
1446
+ this .getMin () .set (-outerRadius, -outerRadius, 0);
1447
+ this .getMax () .set ( outerRadius, outerRadius, 0);
1448
+
1449
+ this .setGeometryType (1);
1450
+ return;
1451
+ }
1452
+
1453
+ if (innerRadius === 0)
1454
+ {
1455
+ // Disk
1456
+
1457
+ this .getMultiTexCoords () .push (options .getDiskTexCoords ());
1458
+ this .setNormals (options .getDiskNormals ());
1459
+
1460
+ if (outerRadius === 1)
1461
+ {
1462
+ this .setVertices (options .getDiskVertices ());
1463
+ }
1464
+ else
1465
+ {
1466
+ const
1467
+ defaultVertices = options .getDiskVertices () .getValue (),
1468
+ vertexArray = this .getVertices ();
1469
+
1470
+ for (let i = 0, length = defaultVertices .length; i < length; i += 4)
1471
+ vertexArray .push (defaultVertices [i] * outerRadius, defaultVertices [i + 1] * outerRadius, 0, 1);
1472
+ }
1473
+
1474
+ this .getMin () .set (-outerRadius, -outerRadius, 0);
1475
+ this .getMax () .set ( outerRadius, outerRadius, 0);
1476
+
1477
+ this .setGeometryType (2);
1478
+ this .setSolid (this .solid_ .getValue ());
1479
+
1480
+ return;
1481
+ }
1482
+
1483
+ // Disk with hole
1484
+
1485
+ const
1486
+ scale = innerRadius / outerRadius,
1487
+ offset = (1 - scale) / 2,
1488
+ defaultTexCoords = options .getDiskTexCoords () .getValue (),
1489
+ defaultVertices = options .getDiskVertices () .getValue (),
1490
+ texCoordArray = this .getTexCoords (),
1491
+ normalArray = this .getNormals (),
1492
+ vertexArray = this .getVertices ();
1493
+
1494
+ this .getMultiTexCoords () .push (texCoordArray);
1495
+
1496
+ for (let i = 0, length = defaultVertices .length; i < length; i += 12)
1497
+ {
1498
+ texCoordArray .push (defaultTexCoords [i + 4] * scale + offset, defaultTexCoords [i + 5] * scale + offset, 0, 1,
1499
+ defaultTexCoords [i + 4], defaultTexCoords [i + 5], 0, 1,
1500
+ defaultTexCoords [i + 8], defaultTexCoords [i + 9], 0, 1,
1501
+
1502
+ defaultTexCoords [i + 4] * scale + offset, defaultTexCoords [i + 5] * scale + offset, 0, 1,
1503
+ defaultTexCoords [i + 8], defaultTexCoords [i + 9], 0, 1,
1504
+ defaultTexCoords [i + 8] * scale + offset, defaultTexCoords [i + 9] * scale + offset, 0, 1);
1505
+
1506
+ normalArray .push (0, 0, 1, 0, 0, 1, 0, 0, 1,
1507
+ 0, 0, 1, 0, 0, 1, 0, 0, 1);
1508
+
1509
+ vertexArray .push (defaultVertices [i + 4] * innerRadius, defaultVertices [i + 5] * innerRadius, 0, 1,
1510
+ defaultVertices [i + 4] * outerRadius, defaultVertices [i + 5] * outerRadius, 0, 1,
1511
+ defaultVertices [i + 8] * outerRadius, defaultVertices [i + 9] * outerRadius, 0, 1,
1512
+
1513
+ defaultVertices [i + 4] * innerRadius, defaultVertices [i + 5] * innerRadius, 0, 1,
1514
+ defaultVertices [i + 8] * outerRadius, defaultVertices [i + 9] * outerRadius, 0, 1,
1515
+ defaultVertices [i + 8] * innerRadius, defaultVertices [i + 9] * innerRadius, 0, 1);
1516
+ }
1517
+
1518
+ this .getMin () .set (-outerRadius, -outerRadius, 0);
1519
+ this .getMax () .set ( outerRadius, outerRadius, 0);
1520
+
1521
+ this .setGeometryType (2);
1522
+ this .setSolid (this .solid_ .getValue ());
1523
+ },
1524
+ intersectsLine: function (line, clipPlanes, modelViewMatrix, intersections)
1525
+ {
1526
+ if (this .getGeometryType () < 2)
1527
+ {
1528
+ return X3DLineGeometryNode .prototype .intersectsLine .call (this, line, clipPlanes, modelViewMatrix, intersections);
1529
+ }
1530
+ else
1531
+ {
1532
+ return X3DGeometryNode .prototype .intersectsLine .call (this, line, clipPlanes, modelViewMatrix, intersections);
1533
+ }
1534
+ },
1535
+ intersectsBox: function (box, clipPlanes, modelViewMatrix)
1536
+ {
1537
+ if (this .getGeometryType () < 2)
1538
+ {
1539
+ return X3DLineGeometryNode .prototype .intersectsBox .call (this, box, clipPlanes, modelViewMatrix);
1540
+ }
1541
+ else
1542
+ {
1543
+ return X3DGeometryNode .prototype .intersectsBox .call (this, box, clipPlanes, modelViewMatrix);
1544
+ }
1545
+ },
1546
+ display: function (gl, context)
1547
+ {
1548
+ if (this .getGeometryType () < 2)
1549
+ {
1550
+ return X3DLineGeometryNode .prototype .display .call (this, gl, context);
1551
+ }
1552
+ else
1553
+ {
1554
+ return X3DGeometryNode .prototype .display .call (this, gl, context);
1555
+ }
1556
+ },
1557
+ displayParticles: function (gl, context, particles, numParticles)
1558
+ {
1559
+ if (this .getGeometryType () < 2)
1560
+ {
1561
+ return X3DLineGeometryNode .prototype .displayParticles .call (this, gl, context, particles, numParticles);
1562
+ }
1563
+ else
1564
+ {
1565
+ return X3DGeometryNode .prototype .displayParticles .call (this, gl, context, particles, numParticles);
1566
+ }
1567
+ }
1568
+ });
1569
+
1570
+ return Disk2D;
1571
+ });
1572
+
1573
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1574
+ *******************************************************************************
1575
+ *
1576
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1577
+ *
1578
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1579
+ *
1580
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1581
+ *
1582
+ * The copyright notice above does not evidence any actual of intended
1583
+ * publication of such source code, and is an unpublished work by create3000.
1584
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1585
+ * create3000.
1586
+ *
1587
+ * No permission is granted to copy, distribute, or create derivative works from
1588
+ * the contents of this software, in whole or in part, without the prior written
1589
+ * permission of create3000.
1590
+ *
1591
+ * NON-MILITARY USE ONLY
1592
+ *
1593
+ * All create3000 software are effectively free software with a non-military use
1594
+ * restriction. It is free. Well commented source is provided. You may reuse the
1595
+ * source in any way you please with the exception anything that uses it must be
1596
+ * marked to indicate is contains 'non-military use only' components.
1597
+ *
1598
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1599
+ *
1600
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1601
+ *
1602
+ * This file is part of the X_ITE Project.
1603
+ *
1604
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1605
+ * terms of the GNU General Public License version 3 only, as published by the
1606
+ * Free Software Foundation.
1607
+ *
1608
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1609
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1610
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1611
+ * details (a copy is included in the LICENSE file that accompanied this code).
1612
+ *
1613
+ * You should have received a copy of the GNU General Public License version 3
1614
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1615
+ * copy of the GPLv3 License.
1616
+ *
1617
+ * For Silvio, Joy and Adi.
1618
+ *
1619
+ ******************************************************************************/
1620
+
1621
+
1622
+ define ('x_ite/Components/Geometry2D/Polyline2D',[
1623
+ "x_ite/Fields",
1624
+ "x_ite/Basic/X3DFieldDefinition",
1625
+ "x_ite/Basic/FieldDefinitionArray",
1626
+ "x_ite/Components/Rendering/X3DLineGeometryNode",
1627
+ "x_ite/Bits/X3DConstants",
1628
+ ],
1629
+ function (Fields,
1630
+ X3DFieldDefinition,
1631
+ FieldDefinitionArray,
1632
+ X3DLineGeometryNode,
1633
+ X3DConstants)
1634
+ {
1635
+ "use strict";
1636
+
1637
+ function Polyline2D (executionContext)
1638
+ {
1639
+ X3DLineGeometryNode .call (this, executionContext);
1640
+
1641
+ this .addType (X3DConstants .Polyline2D);
1642
+
1643
+ this .setGeometryType (1);
1644
+
1645
+ this .lineSegments_ .setUnit ("length");
1646
+ }
1647
+
1648
+ Polyline2D .prototype = Object .assign (Object .create (X3DLineGeometryNode .prototype),
1649
+ {
1650
+ constructor: Polyline2D,
1651
+ fieldDefinitions: new FieldDefinitionArray ([
1652
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1653
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "lineSegments", new Fields .MFVec2f ()),
1654
+ ]),
1655
+ getTypeName: function ()
1656
+ {
1657
+ return "Polyline2D";
1658
+ },
1659
+ getComponentName: function ()
1660
+ {
1661
+ return "Geometry2D";
1662
+ },
1663
+ getContainerField: function ()
1664
+ {
1665
+ return "geometry";
1666
+ },
1667
+ initialize: function ()
1668
+ {
1669
+ X3DLineGeometryNode .prototype .initialize .call (this);
1670
+
1671
+ this .setPrimitiveMode (this .getBrowser () .getContext () .LINE_STRIP);
1672
+ },
1673
+ build: function ()
1674
+ {
1675
+ var
1676
+ lineSegments = this .lineSegments_ .getValue (),
1677
+ vertexArray = this .getVertices ();
1678
+
1679
+ for (var i = 0, length = this .lineSegments_ .length * 2; i < length; i += 2)
1680
+ {
1681
+ vertexArray .push (lineSegments [i], lineSegments [i + 1], 0, 1);
1682
+ }
1683
+
1684
+ this .setSolid (false);
1685
+ },
1686
+ });
1687
+
1688
+ return Polyline2D;
1689
+ });
1690
+
1691
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1692
+ *******************************************************************************
1693
+ *
1694
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1695
+ *
1696
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1697
+ *
1698
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1699
+ *
1700
+ * The copyright notice above does not evidence any actual of intended
1701
+ * publication of such source code, and is an unpublished work by create3000.
1702
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1703
+ * create3000.
1704
+ *
1705
+ * No permission is granted to copy, distribute, or create derivative works from
1706
+ * the contents of this software, in whole or in part, without the prior written
1707
+ * permission of create3000.
1708
+ *
1709
+ * NON-MILITARY USE ONLY
1710
+ *
1711
+ * All create3000 software are effectively free software with a non-military use
1712
+ * restriction. It is free. Well commented source is provided. You may reuse the
1713
+ * source in any way you please with the exception anything that uses it must be
1714
+ * marked to indicate is contains 'non-military use only' components.
1715
+ *
1716
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1717
+ *
1718
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1719
+ *
1720
+ * This file is part of the X_ITE Project.
1721
+ *
1722
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1723
+ * terms of the GNU General Public License version 3 only, as published by the
1724
+ * Free Software Foundation.
1725
+ *
1726
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1727
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1728
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1729
+ * details (a copy is included in the LICENSE file that accompanied this code).
1730
+ *
1731
+ * You should have received a copy of the GNU General Public License version 3
1732
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1733
+ * copy of the GPLv3 License.
1734
+ *
1735
+ * For Silvio, Joy and Adi.
1736
+ *
1737
+ ******************************************************************************/
1738
+
1739
+
1740
+ define ('x_ite/Components/Geometry2D/Polypoint2D',[
1741
+ "x_ite/Fields",
1742
+ "x_ite/Basic/X3DFieldDefinition",
1743
+ "x_ite/Basic/FieldDefinitionArray",
1744
+ "x_ite/Components/Rendering/X3DLineGeometryNode",
1745
+ "x_ite/Bits/X3DConstants",
1746
+ ],
1747
+ function (Fields,
1748
+ X3DFieldDefinition,
1749
+ FieldDefinitionArray,
1750
+ X3DLineGeometryNode,
1751
+ X3DConstants)
1752
+ {
1753
+ "use strict";
1754
+
1755
+ function Polypoint2D (executionContext)
1756
+ {
1757
+ X3DLineGeometryNode .call (this, executionContext);
1758
+
1759
+ this .addType (X3DConstants .Polypoint2D);
1760
+
1761
+ this .setGeometryType (0);
1762
+
1763
+ this .point_ .setUnit ("length");
1764
+
1765
+ this .setTransparent (true);
1766
+ }
1767
+
1768
+ Polypoint2D .prototype = Object .assign (Object .create (X3DLineGeometryNode .prototype),
1769
+ {
1770
+ constructor: Polypoint2D,
1771
+ fieldDefinitions: new FieldDefinitionArray ([
1772
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1773
+ new X3DFieldDefinition (X3DConstants .inputOutput, "point", new Fields .MFVec2f ()),
1774
+ ]),
1775
+ getTypeName: function ()
1776
+ {
1777
+ return "Polypoint2D";
1778
+ },
1779
+ getComponentName: function ()
1780
+ {
1781
+ return "Geometry2D";
1782
+ },
1783
+ getContainerField: function ()
1784
+ {
1785
+ return "geometry";
1786
+ },
1787
+ initialize: function ()
1788
+ {
1789
+ X3DLineGeometryNode .prototype .initialize .call (this);
1790
+
1791
+ var browser = this .getBrowser ();
1792
+
1793
+ this .setPrimitiveMode (browser .getContext () .POINTS);
1794
+ this .setSolid (false);
1795
+ },
1796
+ getShader: function (browser)
1797
+ {
1798
+ return browser .getPointShader ();
1799
+ },
1800
+ build: function ()
1801
+ {
1802
+ var
1803
+ point = this .point_ .getValue (),
1804
+ vertexArray = this .getVertices ();
1805
+
1806
+ for (var i = 0, length = this .point_ .length * 2; i < length; i += 2)
1807
+ {
1808
+ vertexArray .push (point [i], point [i + 1], 0, 1);
1809
+ }
1810
+ },
1811
+ });
1812
+
1813
+ return Polypoint2D;
1814
+ });
1815
+
1816
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1817
+ *******************************************************************************
1818
+ *
1819
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1820
+ *
1821
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1822
+ *
1823
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1824
+ *
1825
+ * The copyright notice above does not evidence any actual of intended
1826
+ * publication of such source code, and is an unpublished work by create3000.
1827
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1828
+ * create3000.
1829
+ *
1830
+ * No permission is granted to copy, distribute, or create derivative works from
1831
+ * the contents of this software, in whole or in part, without the prior written
1832
+ * permission of create3000.
1833
+ *
1834
+ * NON-MILITARY USE ONLY
1835
+ *
1836
+ * All create3000 software are effectively free software with a non-military use
1837
+ * restriction. It is free. Well commented source is provided. You may reuse the
1838
+ * source in any way you please with the exception anything that uses it must be
1839
+ * marked to indicate is contains 'non-military use only' components.
1840
+ *
1841
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1842
+ *
1843
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1844
+ *
1845
+ * This file is part of the X_ITE Project.
1846
+ *
1847
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1848
+ * terms of the GNU General Public License version 3 only, as published by the
1849
+ * Free Software Foundation.
1850
+ *
1851
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1852
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1853
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
1854
+ * details (a copy is included in the LICENSE file that accompanied this code).
1855
+ *
1856
+ * You should have received a copy of the GNU General Public License version 3
1857
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
1858
+ * copy of the GPLv3 License.
1859
+ *
1860
+ * For Silvio, Joy and Adi.
1861
+ *
1862
+ ******************************************************************************/
1863
+
1864
+
1865
+ define ('x_ite/Components/Geometry2D/Rectangle2D',[
1866
+ "x_ite/Fields",
1867
+ "x_ite/Basic/X3DFieldDefinition",
1868
+ "x_ite/Basic/FieldDefinitionArray",
1869
+ "x_ite/Components/Rendering/X3DGeometryNode",
1870
+ "x_ite/Bits/X3DConstants",
1871
+ "standard/Math/Numbers/Vector2",
1872
+ "standard/Math/Numbers/Vector3",
1873
+ ],
1874
+ function (Fields,
1875
+ X3DFieldDefinition,
1876
+ FieldDefinitionArray,
1877
+ X3DGeometryNode,
1878
+ X3DConstants,
1879
+ Vector2,
1880
+ Vector3)
1881
+ {
1882
+ "use strict";
1883
+
1884
+ var defaultSize = new Vector2 (2, 2);
1885
+
1886
+ function Rectangle2D (executionContext)
1887
+ {
1888
+ X3DGeometryNode .call (this, executionContext);
1889
+
1890
+ this .addType (X3DConstants .Rectangle2D);
1891
+
1892
+ this .setGeometryType (2);
1893
+
1894
+ this .size_ .setUnit ("length");
1895
+ }
1896
+
1897
+ Rectangle2D .prototype = Object .assign (Object .create (X3DGeometryNode .prototype),
1898
+ {
1899
+ constructor: Rectangle2D,
1900
+ fieldDefinitions: new FieldDefinitionArray ([
1901
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
1902
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "size", new Fields .SFVec2f (2, 2)),
1903
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "solid", new Fields .SFBool ()),
1904
+ ]),
1905
+ getTypeName: function ()
1906
+ {
1907
+ return "Rectangle2D";
1908
+ },
1909
+ getComponentName: function ()
1910
+ {
1911
+ return "Geometry2D";
1912
+ },
1913
+ getContainerField: function ()
1914
+ {
1915
+ return "geometry";
1916
+ },
1917
+ build: function ()
1918
+ {
1919
+ var
1920
+ options = this .getBrowser () .getRectangle2DOptions (),
1921
+ geometry = options .getGeometry (),
1922
+ size = this .size_ .getValue ();
1923
+
1924
+ this .setMultiTexCoords (geometry .getMultiTexCoords ());
1925
+ this .setNormals (geometry .getNormals ());
1926
+
1927
+ if (size .equals (defaultSize))
1928
+ {
1929
+ this .setVertices (geometry .getVertices ());
1930
+
1931
+ this .getMin () .assign (geometry .getMin ());
1932
+ this .getMax () .assign (geometry .getMax ());
1933
+ }
1934
+ else
1935
+ {
1936
+ var
1937
+ scale = Vector3 .divide (size, 2),
1938
+ x = scale .x,
1939
+ y = scale .y,
1940
+ defaultVertices = geometry .getVertices () .getValue (),
1941
+ vertexArray = this .getVertices ();
1942
+
1943
+ for (var i = 0; i < defaultVertices .length; i += 4)
1944
+ {
1945
+ vertexArray .push (x * defaultVertices [i],
1946
+ y * defaultVertices [i + 1],
1947
+ defaultVertices [i + 2],
1948
+ 1);
1949
+ }
1950
+
1951
+ this .getMin () .set (-x, -y, 0);
1952
+ this .getMax () .set ( x, y, 0);
1953
+ }
1954
+
1955
+ this .setSolid (this .solid_ .getValue ());
1956
+ },
1957
+ });
1958
+
1959
+ return Rectangle2D;
1960
+ });
1961
+
1962
+ /* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
1963
+ *******************************************************************************
1964
+ *
1965
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1966
+ *
1967
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
1968
+ *
1969
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
1970
+ *
1971
+ * The copyright notice above does not evidence any actual of intended
1972
+ * publication of such source code, and is an unpublished work by create3000.
1973
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
1974
+ * create3000.
1975
+ *
1976
+ * No permission is granted to copy, distribute, or create derivative works from
1977
+ * the contents of this software, in whole or in part, without the prior written
1978
+ * permission of create3000.
1979
+ *
1980
+ * NON-MILITARY USE ONLY
1981
+ *
1982
+ * All create3000 software are effectively free software with a non-military use
1983
+ * restriction. It is free. Well commented source is provided. You may reuse the
1984
+ * source in any way you please with the exception anything that uses it must be
1985
+ * marked to indicate is contains 'non-military use only' components.
1986
+ *
1987
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1988
+ *
1989
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
1990
+ *
1991
+ * This file is part of the X_ITE Project.
1992
+ *
1993
+ * X_ITE is free software: you can redistribute it and/or modify it under the
1994
+ * terms of the GNU General Public License version 3 only, as published by the
1995
+ * Free Software Foundation.
1996
+ *
1997
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
1998
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1999
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
2000
+ * details (a copy is included in the LICENSE file that accompanied this code).
2001
+ *
2002
+ * You should have received a copy of the GNU General Public License version 3
2003
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
2004
+ * copy of the GPLv3 License.
2005
+ *
2006
+ * For Silvio, Joy and Adi.
2007
+ *
2008
+ ******************************************************************************/
2009
+
2010
+
2011
+ define ('x_ite/Components/Geometry2D/TriangleSet2D',[
2012
+ "x_ite/Fields",
2013
+ "x_ite/Basic/X3DFieldDefinition",
2014
+ "x_ite/Basic/FieldDefinitionArray",
2015
+ "x_ite/Components/Rendering/X3DGeometryNode",
2016
+ "x_ite/Bits/X3DConstants",
2017
+ "standard/Math/Numbers/Vector3",
2018
+ ],
2019
+ function (Fields,
2020
+ X3DFieldDefinition,
2021
+ FieldDefinitionArray,
2022
+ X3DGeometryNode,
2023
+ X3DConstants,
2024
+ Vector3)
2025
+ {
2026
+ "use strict";
2027
+
2028
+ function TriangleSet2D (executionContext)
2029
+ {
2030
+ X3DGeometryNode .call (this, executionContext);
2031
+
2032
+ this .addType (X3DConstants .TriangleSet2D);
2033
+
2034
+ this .setGeometryType (2);
2035
+
2036
+ this .vertices_ .setUnit ("length");
2037
+ }
2038
+
2039
+ TriangleSet2D .prototype = Object .assign (Object .create (X3DGeometryNode .prototype),
2040
+ {
2041
+ constructor: TriangleSet2D,
2042
+ fieldDefinitions: new FieldDefinitionArray ([
2043
+ new X3DFieldDefinition (X3DConstants .inputOutput, "metadata", new Fields .SFNode ()),
2044
+ new X3DFieldDefinition (X3DConstants .inputOutput, "vertices", new Fields .MFVec2f ()),
2045
+ new X3DFieldDefinition (X3DConstants .initializeOnly, "solid", new Fields .SFBool ()),
2046
+ ]),
2047
+ getTypeName: function ()
2048
+ {
2049
+ return "TriangleSet2D";
2050
+ },
2051
+ getComponentName: function ()
2052
+ {
2053
+ return "Geometry2D";
2054
+ },
2055
+ getContainerField: function ()
2056
+ {
2057
+ return "geometry";
2058
+ },
2059
+ build: function ()
2060
+ {
2061
+ var
2062
+ vertices = this .vertices_ .getValue (),
2063
+ normalArray = this .getNormals (),
2064
+ vertexArray = this .getVertices ();
2065
+
2066
+ for (var i = 0, length = this .vertices_ .length * 2; i < length; i += 2)
2067
+ {
2068
+ normalArray .push (0, 0, 1);
2069
+ vertexArray .push (vertices [i], vertices [i + 1], 0, 1);
2070
+ }
2071
+
2072
+ this .setSolid (this .solid_ .getValue ());
2073
+ },
2074
+ buildTexCoords: function ()
2075
+ {
2076
+ var texCoordArray = this .getTexCoords ();
2077
+
2078
+ if (texCoordArray .length === 0)
2079
+ {
2080
+ var
2081
+ p = this .getTexCoordParams (),
2082
+ min = p .min,
2083
+ Ssize = p .Ssize,
2084
+ vertexArray = this .getVertices () .getValue ();
2085
+
2086
+ for (var i = 0, length = vertexArray .length; i < length; i += 4)
2087
+ {
2088
+ texCoordArray .push ((vertexArray [i] - min [0]) / Ssize,
2089
+ (vertexArray [i + 1] - min [1]) / Ssize,
2090
+ 0,
2091
+ 1);
2092
+ }
2093
+
2094
+ texCoordArray .shrinkToFit ();
2095
+ }
2096
+
2097
+ return texCoordArray;
2098
+ },
2099
+ });
2100
+
2101
+ return TriangleSet2D;
2102
+ });
2103
+
2104
+ /*******************************************************************************
2105
+ *
2106
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2107
+ *
2108
+ * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
2109
+ *
2110
+ * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
2111
+ *
2112
+ * The copyright notice above does not evidence any actual of intended
2113
+ * publication of such source code, and is an unpublished work by create3000.
2114
+ * This material contains CONFIDENTIAL INFORMATION that is the property of
2115
+ * create3000.
2116
+ *
2117
+ * No permission is granted to copy, distribute, or create derivative works from
2118
+ * the contents of this software, in whole or in part, without the prior written
2119
+ * permission of create3000.
2120
+ *
2121
+ * NON-MILITARY USE ONLY
2122
+ *
2123
+ * All create3000 software are effectively free software with a non-military use
2124
+ * restriction. It is free. Well commented source is provided. You may reuse the
2125
+ * source in any way you please with the exception anything that uses it must be
2126
+ * marked to indicate is contains 'non-military use only' components.
2127
+ *
2128
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2129
+ *
2130
+ * Copyright 2015, 2016 Holger Seelig <holger.seelig@yahoo.de>.
2131
+ *
2132
+ * This file is part of the X_ITE Project.
2133
+ *
2134
+ * X_ITE is free software: you can redistribute it and/or modify it under the
2135
+ * terms of the GNU General Public License version 3 only, as published by the
2136
+ * Free Software Foundation.
2137
+ *
2138
+ * X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
2139
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
2140
+ * A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
2141
+ * details (a copy is included in the LICENSE file that accompanied this code).
2142
+ *
2143
+ * You should have received a copy of the GNU General Public License version 3
2144
+ * along with X_ITE. If not, see <http://www.gnu.org/licenses/gpl.html> for a
2145
+ * copy of the GPLv3 License.
2146
+ *
2147
+ * For Silvio, Joy and Adi.
2148
+ *
2149
+ ******************************************************************************/
2150
+
2151
+
2152
+ define (require .getComponentUrl ("geometry2d"), [
2153
+ "x_ite/Components",
2154
+ "x_ite/Browser/Geometry2D/X3DGeometry2DContext",
2155
+ "x_ite/Components/Geometry2D/Arc2D",
2156
+ "x_ite/Components/Geometry2D/ArcClose2D",
2157
+ "x_ite/Components/Geometry2D/Circle2D",
2158
+ "x_ite/Components/Geometry2D/Disk2D",
2159
+ "x_ite/Components/Geometry2D/Polyline2D",
2160
+ "x_ite/Components/Geometry2D/Polypoint2D",
2161
+ "x_ite/Components/Geometry2D/Rectangle2D",
2162
+ "x_ite/Components/Geometry2D/TriangleSet2D",
2163
+ ],
2164
+ function (Components,
2165
+ X3DGeometry2DContext,
2166
+ Arc2D,
2167
+ ArcClose2D,
2168
+ Circle2D,
2169
+ Disk2D,
2170
+ Polyline2D,
2171
+ Polypoint2D,
2172
+ Rectangle2D,
2173
+ TriangleSet2D)
2174
+ {
2175
+ "use strict";
2176
+
2177
+ Components .addComponent ({
2178
+ name: "Geometry2D",
2179
+ types:
2180
+ {
2181
+ Arc2D: Arc2D,
2182
+ ArcClose2D: ArcClose2D,
2183
+ Circle2D: Circle2D,
2184
+ Disk2D: Disk2D,
2185
+ Polyline2D: Polyline2D,
2186
+ Polypoint2D: Polypoint2D,
2187
+ Rectangle2D: Rectangle2D,
2188
+ TriangleSet2D: TriangleSet2D,
2189
+ },
2190
+ abstractTypes:
2191
+ {
2192
+ },
2193
+ browser: X3DGeometry2DContext,
2194
+ });
2195
+ });
2196
+
2197
+
2198
+
2199
+ })
2200
+ (typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);