@needle-tools/engine 4.12.0-next.dd87659 → 4.12.0-next.f0b1535

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 (256) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/components.needle.json +1 -1
  3. package/dist/generateMeshBVH.worker-iyfPIK6R.js +21 -0
  4. package/dist/{gltf-progressive-DZrY8VT6.min.js → gltf-progressive-BmSygnAC.min.js} +2 -2
  5. package/dist/{gltf-progressive-DgYz5BYa.js → gltf-progressive-DnLBuGK5.js} +24 -24
  6. package/dist/{gltf-progressive-DWcmTMCh.umd.cjs → gltf-progressive-Rs-ojtXy.umd.cjs} +1 -1
  7. package/dist/{loader.worker-Dip-PthR.js → loader.worker-DWzfDpAl.js} +4 -4
  8. package/dist/{needle-engine.bundle-CiqX7AtA.js → needle-engine.bundle-CrbGpIHn.js} +8564 -8382
  9. package/dist/{needle-engine.bundle-CiL59iU3.min.js → needle-engine.bundle-DAiK_I7w.min.js} +150 -151
  10. package/dist/needle-engine.bundle-DdJ-HkwM.umd.cjs +1646 -0
  11. package/dist/needle-engine.d.ts +142 -43
  12. package/dist/needle-engine.js +4 -4
  13. package/dist/needle-engine.min.js +1 -1
  14. package/dist/needle-engine.umd.cjs +1 -1
  15. package/dist/{postprocessing-DYDtB188.min.js → postprocessing-B5ksn9-G.min.js} +54 -54
  16. package/dist/{postprocessing-CMgoN5t5.umd.cjs → postprocessing-DZtb9Nnn.umd.cjs} +81 -81
  17. package/dist/{postprocessing-BTW9pD_s.js → postprocessing-__7s9wON.js} +450 -441
  18. package/dist/{three-DfMvBzXi.js → three-BCCkyCA5.js} +1 -7
  19. package/dist/{three-qj71I7J3.umd.cjs → three-Bf2NBxAw.umd.cjs} +2 -2
  20. package/dist/{three-B7CT31Bt.min.js → three-W7zWTcfP.min.js} +1 -1
  21. package/dist/{three-examples-CsW4_6LI.umd.cjs → three-examples-Dho7cuu4.umd.cjs} +4 -4
  22. package/dist/{three-examples-D1P7eEhn.min.js → three-examples-MsJjauyk.min.js} +10 -10
  23. package/dist/{three-examples-D1SK93ek.js → three-examples-y2GeYlze.js} +2 -20
  24. package/dist/{three-mesh-ui-C_uSB5dD.js → three-mesh-ui-3nSSizT4.js} +1 -1
  25. package/dist/{three-mesh-ui-LQ44s0AL.min.js → three-mesh-ui-CIez6qJQ.min.js} +1 -1
  26. package/dist/{three-mesh-ui-DpATDXwU.umd.cjs → three-mesh-ui-zsOOA5Pq.umd.cjs} +1 -1
  27. package/dist/{vendor-D0zoswDa.js → vendor-DMZcbVO1.js} +3707 -3527
  28. package/dist/vendor-sURMCFSI.min.js +1116 -0
  29. package/dist/{vendor-UCpFAwt1.umd.cjs → vendor-tyBvnMF-.umd.cjs} +39 -39
  30. package/lib/engine/codegen/register_types.js +0 -2
  31. package/lib/engine/codegen/register_types.js.map +1 -1
  32. package/lib/engine/debug/debug_console.js +403 -1
  33. package/lib/engine/debug/debug_console.js.map +1 -1
  34. package/lib/engine/engine_components.js +3 -3
  35. package/lib/engine/engine_components.js.map +1 -1
  36. package/lib/engine/engine_input.d.ts +5 -0
  37. package/lib/engine/engine_input.js +6 -0
  38. package/lib/engine/engine_input.js.map +1 -1
  39. package/lib/engine/engine_license.js +3 -9
  40. package/lib/engine/engine_license.js.map +1 -1
  41. package/lib/engine/engine_networking.js +5 -5
  42. package/lib/engine/engine_networking.js.map +1 -1
  43. package/lib/engine/engine_physics.js.map +1 -1
  44. package/lib/engine/engine_physics_rapier.js +1 -1
  45. package/lib/engine/engine_physics_rapier.js.map +1 -1
  46. package/lib/engine/engine_utils.d.ts +4 -1
  47. package/lib/engine/engine_utils.js +28 -4
  48. package/lib/engine/engine_utils.js.map +1 -1
  49. package/lib/engine/extensions/extensions.d.ts +29 -7
  50. package/lib/engine/extensions/extensions.js.map +1 -1
  51. package/lib/engine/webcomponents/WebXRButtons.js +13 -5
  52. package/lib/engine/webcomponents/WebXRButtons.js.map +1 -1
  53. package/lib/engine/webcomponents/needle menu/needle-menu.js +4 -5
  54. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  55. package/lib/engine/webcomponents/needle-engine.ar-overlay.js +4 -0
  56. package/lib/engine/webcomponents/needle-engine.ar-overlay.js.map +1 -1
  57. package/lib/engine/webcomponents/needle-engine.js +1 -1
  58. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  59. package/lib/engine/xr/NeedleXRSession.d.ts +1 -1
  60. package/lib/engine/xr/NeedleXRSession.js +67 -24
  61. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  62. package/lib/engine/xr/TempXRContext.js +12 -2
  63. package/lib/engine/xr/TempXRContext.js.map +1 -1
  64. package/lib/engine/xr/usdz.js +6 -2
  65. package/lib/engine/xr/usdz.js.map +1 -1
  66. package/lib/engine-components/AlignmentConstraint.d.ts +1 -2
  67. package/lib/engine-components/AlignmentConstraint.js +1 -2
  68. package/lib/engine-components/AlignmentConstraint.js.map +1 -1
  69. package/lib/engine-components/Animation.d.ts +2 -0
  70. package/lib/engine-components/Animation.js +2 -0
  71. package/lib/engine-components/Animation.js.map +1 -1
  72. package/lib/engine-components/Animator.d.ts +1 -0
  73. package/lib/engine-components/Animator.js +1 -0
  74. package/lib/engine-components/Animator.js.map +1 -1
  75. package/lib/engine-components/AudioListener.d.ts +1 -1
  76. package/lib/engine-components/AudioListener.js +1 -1
  77. package/lib/engine-components/AudioSource.d.ts +1 -1
  78. package/lib/engine-components/AudioSource.js +1 -1
  79. package/lib/engine-components/BasicIKConstraint.d.ts +8 -0
  80. package/lib/engine-components/BasicIKConstraint.js +8 -0
  81. package/lib/engine-components/BasicIKConstraint.js.map +1 -1
  82. package/lib/engine-components/BoxHelperComponent.d.ts +1 -0
  83. package/lib/engine-components/BoxHelperComponent.js +1 -0
  84. package/lib/engine-components/BoxHelperComponent.js.map +1 -1
  85. package/lib/engine-components/Camera.d.ts +2 -2
  86. package/lib/engine-components/Camera.js +2 -2
  87. package/lib/engine-components/CharacterController.d.ts +6 -2
  88. package/lib/engine-components/CharacterController.js +6 -2
  89. package/lib/engine-components/CharacterController.js.map +1 -1
  90. package/lib/engine-components/Collider.d.ts +2 -2
  91. package/lib/engine-components/Collider.js +1 -1
  92. package/lib/engine-components/Collider.js.map +1 -1
  93. package/lib/engine-components/Component.d.ts +2 -1
  94. package/lib/engine-components/Component.js +3 -2
  95. package/lib/engine-components/Component.js.map +1 -1
  96. package/lib/engine-components/ContactShadows.d.ts +1 -1
  97. package/lib/engine-components/ContactShadows.js +1 -1
  98. package/lib/engine-components/DragControls.js +3 -0
  99. package/lib/engine-components/DragControls.js.map +1 -1
  100. package/lib/engine-components/Gizmos.d.ts +2 -0
  101. package/lib/engine-components/Gizmos.js +2 -0
  102. package/lib/engine-components/Gizmos.js.map +1 -1
  103. package/lib/engine-components/Joints.d.ts +20 -0
  104. package/lib/engine-components/Joints.js +20 -0
  105. package/lib/engine-components/Joints.js.map +1 -1
  106. package/lib/engine-components/LODGroup.d.ts +1 -1
  107. package/lib/engine-components/LODGroup.js +1 -1
  108. package/lib/engine-components/LookAtConstraint.d.ts +1 -1
  109. package/lib/engine-components/LookAtConstraint.js +1 -1
  110. package/lib/engine-components/Networking.d.ts +1 -1
  111. package/lib/engine-components/Networking.js +1 -1
  112. package/lib/engine-components/OrbitControls.d.ts +1 -1
  113. package/lib/engine-components/OrbitControls.js +1 -1
  114. package/lib/engine-components/Renderer.d.ts +6 -0
  115. package/lib/engine-components/Renderer.js +6 -0
  116. package/lib/engine-components/Renderer.js.map +1 -1
  117. package/lib/engine-components/RendererInstancing.js +5 -3
  118. package/lib/engine-components/RendererInstancing.js.map +1 -1
  119. package/lib/engine-components/SceneSwitcher.js +18 -14
  120. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  121. package/lib/engine-components/ShadowCatcher.d.ts +1 -1
  122. package/lib/engine-components/ShadowCatcher.js +1 -1
  123. package/lib/engine-components/SpectatorCamera.d.ts +1 -1
  124. package/lib/engine-components/SpectatorCamera.js +16 -8
  125. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  126. package/lib/engine-components/SpriteRenderer.d.ts +2 -1
  127. package/lib/engine-components/SpriteRenderer.js +2 -1
  128. package/lib/engine-components/SpriteRenderer.js.map +1 -1
  129. package/lib/engine-components/Voip.d.ts +1 -1
  130. package/lib/engine-components/Voip.js +1 -1
  131. package/lib/engine-components/api.d.ts +1 -0
  132. package/lib/engine-components/api.js +1 -0
  133. package/lib/engine-components/api.js.map +1 -1
  134. package/lib/engine-components/codegen/components.d.ts +0 -1
  135. package/lib/engine-components/codegen/components.js +0 -1
  136. package/lib/engine-components/codegen/components.js.map +1 -1
  137. package/lib/engine-components/export/gltf/GltfExport.d.ts +5 -0
  138. package/lib/engine-components/export/gltf/GltfExport.js +5 -0
  139. package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
  140. package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -0
  141. package/lib/engine-components/export/usdz/USDZExporter.js +1 -0
  142. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  143. package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -1
  144. package/lib/engine-components/particlesystem/ParticleSystem.js +1 -1
  145. package/lib/engine-components/timeline/SignalAsset.d.ts +1 -1
  146. package/lib/engine-components/timeline/SignalAsset.js +1 -1
  147. package/lib/engine-components/ui/Button.d.ts +1 -1
  148. package/lib/engine-components/ui/Button.js +1 -1
  149. package/lib/engine-components/ui/Canvas.d.ts +1 -1
  150. package/lib/engine-components/ui/Canvas.js +1 -1
  151. package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
  152. package/lib/engine-components/ui/CanvasGroup.js +1 -1
  153. package/lib/engine-components/ui/EventSystem.d.ts +1 -1
  154. package/lib/engine-components/ui/EventSystem.js +1 -1
  155. package/lib/engine-components/ui/Image.d.ts +1 -1
  156. package/lib/engine-components/ui/Image.js +1 -1
  157. package/lib/engine-components/ui/InputField.d.ts +1 -1
  158. package/lib/engine-components/ui/InputField.js +1 -1
  159. package/lib/engine-components/ui/Outline.d.ts +1 -1
  160. package/lib/engine-components/ui/Outline.js +1 -1
  161. package/lib/engine-components/ui/Raycaster.d.ts +3 -2
  162. package/lib/engine-components/ui/Raycaster.js +3 -2
  163. package/lib/engine-components/ui/Raycaster.js.map +1 -1
  164. package/lib/engine-components/ui/RectTransform.d.ts +6 -0
  165. package/lib/engine-components/ui/RectTransform.js +6 -0
  166. package/lib/engine-components/ui/RectTransform.js.map +1 -1
  167. package/lib/engine-components/ui/SpatialHtml.d.ts +7 -0
  168. package/lib/engine-components/ui/SpatialHtml.js +7 -0
  169. package/lib/engine-components/ui/SpatialHtml.js.map +1 -1
  170. package/lib/engine-components/ui/Text.d.ts +2 -0
  171. package/lib/engine-components/ui/Text.js +2 -0
  172. package/lib/engine-components/ui/Text.js.map +1 -1
  173. package/lib/engine-components/utils/LookAt.d.ts +2 -1
  174. package/lib/engine-components/utils/LookAt.js +2 -1
  175. package/lib/engine-components/utils/LookAt.js.map +1 -1
  176. package/lib/engine-components/web/CursorFollow.d.ts +1 -1
  177. package/lib/engine-components/web/CursorFollow.js +1 -1
  178. package/lib/engine-components/web/HoverAnimation.d.ts +1 -1
  179. package/lib/engine-components/web/HoverAnimation.js +1 -1
  180. package/lib/engine-components/web/ViewBox.d.ts +1 -1
  181. package/lib/engine-components/web/ViewBox.js +1 -1
  182. package/lib/engine-components/webxr/Avatar.js +2 -0
  183. package/lib/engine-components/webxr/Avatar.js.map +1 -1
  184. package/lib/engine-components/webxr/WebXR.js +18 -12
  185. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  186. package/package.json +5 -5
  187. package/plugins/vite/poster-client.js +8 -1
  188. package/src/engine/codegen/register_types.ts +0 -2
  189. package/src/engine/debug/debug_console.ts +449 -1
  190. package/src/engine/engine_components.ts +4 -4
  191. package/src/engine/engine_input.ts +7 -0
  192. package/src/engine/engine_license.ts +3 -8
  193. package/src/engine/engine_networking.ts +5 -5
  194. package/src/engine/engine_physics.ts +3 -3
  195. package/src/engine/engine_physics_rapier.ts +1 -1
  196. package/src/engine/engine_utils.ts +23 -4
  197. package/src/engine/extensions/extensions.ts +30 -6
  198. package/src/engine/webcomponents/WebXRButtons.ts +15 -5
  199. package/src/engine/webcomponents/needle menu/needle-menu.ts +4 -5
  200. package/src/engine/webcomponents/needle-engine.ar-overlay.ts +6 -0
  201. package/src/engine/webcomponents/needle-engine.ts +2 -2
  202. package/src/engine/xr/NeedleXRSession.ts +78 -27
  203. package/src/engine/xr/TempXRContext.ts +12 -2
  204. package/src/engine/xr/usdz.ts +6 -1
  205. package/src/engine-components/AlignmentConstraint.ts +1 -2
  206. package/src/engine-components/Animation.ts +2 -0
  207. package/src/engine-components/Animator.ts +1 -0
  208. package/src/engine-components/AudioListener.ts +1 -1
  209. package/src/engine-components/AudioSource.ts +1 -1
  210. package/src/engine-components/BasicIKConstraint.ts +8 -0
  211. package/src/engine-components/BoxHelperComponent.ts +1 -0
  212. package/src/engine-components/Camera.ts +2 -2
  213. package/src/engine-components/CharacterController.ts +6 -2
  214. package/src/engine-components/Collider.ts +2 -2
  215. package/src/engine-components/Component.ts +5 -4
  216. package/src/engine-components/ContactShadows.ts +1 -1
  217. package/src/engine-components/DragControls.ts +4 -0
  218. package/src/engine-components/Gizmos.ts +2 -0
  219. package/src/engine-components/Joints.ts +20 -0
  220. package/src/engine-components/LODGroup.ts +1 -1
  221. package/src/engine-components/LookAtConstraint.ts +1 -1
  222. package/src/engine-components/Networking.ts +1 -1
  223. package/src/engine-components/OrbitControls.ts +1 -1
  224. package/src/engine-components/Renderer.ts +6 -0
  225. package/src/engine-components/RendererInstancing.ts +6 -3
  226. package/src/engine-components/SceneSwitcher.ts +17 -17
  227. package/src/engine-components/ShadowCatcher.ts +1 -1
  228. package/src/engine-components/SpectatorCamera.ts +22 -11
  229. package/src/engine-components/SpriteRenderer.ts +2 -1
  230. package/src/engine-components/Voip.ts +1 -1
  231. package/src/engine-components/api.ts +2 -1
  232. package/src/engine-components/codegen/components.ts +0 -1
  233. package/src/engine-components/export/gltf/GltfExport.ts +5 -0
  234. package/src/engine-components/export/usdz/USDZExporter.ts +1 -0
  235. package/src/engine-components/particlesystem/ParticleSystem.ts +1 -1
  236. package/src/engine-components/timeline/SignalAsset.ts +1 -1
  237. package/src/engine-components/ui/Button.ts +1 -1
  238. package/src/engine-components/ui/Canvas.ts +1 -1
  239. package/src/engine-components/ui/CanvasGroup.ts +1 -1
  240. package/src/engine-components/ui/EventSystem.ts +1 -1
  241. package/src/engine-components/ui/Image.ts +1 -1
  242. package/src/engine-components/ui/InputField.ts +1 -1
  243. package/src/engine-components/ui/Outline.ts +1 -1
  244. package/src/engine-components/ui/Raycaster.ts +3 -2
  245. package/src/engine-components/ui/RectTransform.ts +6 -0
  246. package/src/engine-components/ui/SpatialHtml.ts +7 -0
  247. package/src/engine-components/ui/Text.ts +2 -0
  248. package/src/engine-components/utils/LookAt.ts +2 -1
  249. package/src/engine-components/web/CursorFollow.ts +1 -1
  250. package/src/engine-components/web/HoverAnimation.ts +1 -1
  251. package/src/engine-components/web/ViewBox.ts +1 -1
  252. package/src/engine-components/webxr/Avatar.ts +4 -0
  253. package/src/engine-components/webxr/WebXR.ts +19 -11
  254. package/dist/generateMeshBVH.worker-mO20N_b8.js +0 -21
  255. package/dist/needle-engine.bundle-DzYZGJbS.umd.cjs +0 -1647
  256. package/dist/vendor-BKGa4GE0.min.js +0 -1116
@@ -1,4 +1,4 @@
1
- import { getParam } from "../engine_utils.js";
1
+ import { getParam, DeviceUtilities } from "../engine_utils.js";
2
2
  import { getErrorCount } from "./debug_overlay.js";
3
3
 
4
4
  let consoleInstance: VConsole | null | undefined = undefined;
@@ -117,6 +117,12 @@ function createConsole(startHidden: boolean = false) {
117
117
  consoleInstance.addPlugin(createInspectPlugin());
118
118
  }
119
119
 
120
+ // Add plugin for device utilities
121
+ consoleInstance.addPlugin(createDeviceUtilitiesPlugin());
122
+
123
+ // Add plugin for graphics info
124
+ consoleInstance.addPlugin(createGraphicsInfoPlugin());
125
+
120
126
  consoleHtmlElement = getConsoleElement();
121
127
  if (consoleHtmlElement) {
122
128
  consoleHtmlElement[$defaultConsoleParent] = consoleHtmlElement.parentElement;
@@ -291,6 +297,448 @@ function createInspectPlugin() {
291
297
  return plugin;
292
298
  }
293
299
 
300
+ const CONTAINER_STYLE = "padding: 10px; font-family: monospace;";
301
+ const HEADING_STYLE = "margin-bottom: 10px;";
302
+ const SUBHEADING_STYLE = "margin-bottom: 10px; margin-top: 15px;";
303
+ const TABLE_STYLE = "width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;";
304
+ const CELL_STYLE = "border: 1px solid rgba(0,0,0,0.1); padding: 5px;";
305
+ const HEADER_CELL_STYLE = CELL_STYLE;
306
+ const VALUE_CELL_STYLE = CELL_STYLE + " word-break: break-all;";
307
+
308
+ function createTable(rows: Array<{label: string, value: any}>, sortByValue: boolean = false): string {
309
+ if (sortByValue) {
310
+ rows.sort((a, b) => (b.value ? 1 : 0) - (a.value ? 1 : 0));
311
+ }
312
+
313
+ let html = `<table style='${TABLE_STYLE}'>`;
314
+ html += "<tbody>";
315
+
316
+ for (const row of rows) {
317
+ const value = typeof row.value === 'boolean' ? (row.value ? "✅" : "❌") : row.value;
318
+ html += `<tr><td style='${HEADER_CELL_STYLE}'>${row.label}</td><td style='${VALUE_CELL_STYLE}'>${value}</td></tr>`;
319
+ }
320
+
321
+ html += "</tbody></table>";
322
+ return html;
323
+ }
324
+
325
+ function getWebGL2Support(): string {
326
+ try {
327
+ const canvas = document.createElement('canvas');
328
+ const gl = canvas.getContext('webgl2');
329
+ if (gl) {
330
+ return "✅";
331
+ }
332
+ } catch (e) {
333
+ // WebGL2 not supported
334
+ }
335
+ return "❌";
336
+ }
337
+
338
+ function createDeviceUtilitiesPlugin() {
339
+ if (!globalThis.VConsole) return;
340
+ const plugin = new VConsole.VConsolePlugin("device-utilities", "📱 Device Info");
341
+ plugin.on('renderTab', function(callback) {
342
+ let html = `<div style='${CONTAINER_STYLE}'>`;
343
+
344
+ // Device type
345
+ const deviceType = getDeviceType();
346
+ html += `<h3 style='${HEADING_STYLE}'>Device: ${deviceType}</h3>`;
347
+
348
+ // Device capabilities table
349
+ html += createTable([
350
+ { label: "💻 Desktop", value: DeviceUtilities.isDesktop() },
351
+ { label: "📱 Mobile Device", value: DeviceUtilities.isMobileDevice() },
352
+ { label: "🍎 iOS", value: DeviceUtilities.isiOS() },
353
+ { label: "📱 iPad", value: DeviceUtilities.isiPad() },
354
+ { label: "🤖 Android", value: DeviceUtilities.isAndroidDevice() },
355
+ { label: "🦊 Mozilla XR", value: DeviceUtilities.isMozillaXR() },
356
+ { label: "🌵 Needle App Clip", value: DeviceUtilities.isNeedleAppClip() },
357
+ { label: "🍏 macOS", value: DeviceUtilities.isMacOS() },
358
+ { label: "👓 VisionOS", value: DeviceUtilities.isVisionOS() },
359
+ { label: "🧭 Safari", value: DeviceUtilities.isSafari() },
360
+ { label: "🕶️ Meta Quest", value: DeviceUtilities.isQuest() },
361
+ { label: "🔗 QuickLook AR Support", value: DeviceUtilities.supportsQuickLookAR() },
362
+ ], true);
363
+
364
+ // Versions
365
+ const versionRows: Array<{label: string, value: any}> = [];
366
+ const iosVersion = DeviceUtilities.getiOSVersion();
367
+ if (iosVersion) versionRows.push({ label: "🍎 iOS Version", value: iosVersion });
368
+ const chromeVersion = DeviceUtilities.getChromeVersion();
369
+ if (chromeVersion) versionRows.push({ label: "🌐 Chrome Version", value: chromeVersion });
370
+ const safariVersion = DeviceUtilities.getSafariVersion();
371
+ if (safariVersion) versionRows.push({ label: "🧭 Safari Version", value: safariVersion });
372
+
373
+ if (versionRows.length > 0) {
374
+ html += createTable(versionRows, false);
375
+ }
376
+
377
+ html += "</div>";
378
+
379
+ // User Agent table
380
+ html += `<div style='${CONTAINER_STYLE} margin-top: 20px;'>`;
381
+ html += `<h3 style='${HEADING_STYLE}'>User Agent Info</h3>`;
382
+
383
+ const userAgentRows = [
384
+ { label: "User Agent", value: navigator.userAgent },
385
+ { label: "Platform", value: navigator.platform },
386
+ { label: "App Version", value: navigator.appVersion },
387
+ // @ts-ignore
388
+ { label: "User Agent Data", value: navigator.userAgentData ? `Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}` : "Not supported" },
389
+ { label: "WebXR", value: 'xr' in navigator ? "✅" : "❌" },
390
+ { label: "WebGPU", value: 'gpu' in navigator ? "✅" : "❌" },
391
+ { label: "WebGL 2", value: getWebGL2Support() },
392
+ ];
393
+
394
+ html += createTable(userAgentRows, false);
395
+ html += "</div>";
396
+
397
+ callback(html);
398
+ });
399
+ return plugin;
400
+ }
401
+
402
+ function createGraphicsInfoPlugin() {
403
+ if (!globalThis.VConsole) return;
404
+ const plugin = new VConsole.VConsolePlugin("graphics-info", "🎨 Graphics Info");
405
+ plugin.on('renderTab', async function(callback) {
406
+ let html = `<div style='${CONTAINER_STYLE}'>`;
407
+
408
+ // General GPU Info Table
409
+ const generalInfo = getGeneralGPUInfo();
410
+ if (generalInfo.length > 0) {
411
+ html += `<h3 style='${SUBHEADING_STYLE}'>General GPU Info</h3>`;
412
+ html += createTable(generalInfo, false);
413
+ }
414
+
415
+ // WebGL Info Table
416
+ const webglInfo = getWebGLDetailedInfo();
417
+ if (webglInfo.length > 0) {
418
+ html += `<h3 style='${SUBHEADING_STYLE}'>WebGL</h3>`;
419
+ html += createTable(webglInfo, false);
420
+ }
421
+
422
+ // WebGL 2 Features Table
423
+ const webgl2Features = getWebGL2FeaturesTable();
424
+ if (webgl2Features.length > 0) {
425
+ html += `<h3 style='${SUBHEADING_STYLE}'>WebGL 2 Features</h3>`;
426
+ html += createTable(webgl2Features, false);
427
+ }
428
+
429
+ // WebGL Limits Table
430
+ const webglLimits = getWebGLLimitsTable();
431
+ if (webglLimits.length > 0) {
432
+ html += `<h3 style='${SUBHEADING_STYLE}'>WebGL Limits</h3>`;
433
+ html += createTable(webglLimits, false);
434
+ }
435
+
436
+ // Texture Formats Table
437
+ const textureFormats = getTextureFormatsTable();
438
+ if (textureFormats.length > 0) {
439
+ html += `<h3 style='${SUBHEADING_STYLE}'>Texture Formats</h3>`;
440
+ html += createTable(textureFormats, false);
441
+ }
442
+
443
+ // WebGPU Info Table
444
+ const webgpuInfo = await getWebGPUInfoTable();
445
+ if (webgpuInfo.length > 0) {
446
+ html += `<h3 style='${SUBHEADING_STYLE}'>WebGPU</h3>`;
447
+ html += createTable(webgpuInfo, false);
448
+ }
449
+
450
+ // Safari specific GPU info
451
+ if (DeviceUtilities.isSafari()) {
452
+ const safariGPUInfo = getSafariGPUInfo();
453
+ if (safariGPUInfo.length > 0) {
454
+ html += `<h3 style='${SUBHEADING_STYLE}'>Safari GPU Info</h3>`;
455
+ html += createTable(safariGPUInfo, false);
456
+ }
457
+ }
458
+
459
+ html += "</div>";
460
+
461
+ callback(html);
462
+ });
463
+ return plugin;
464
+ }
465
+
466
+ function getGeneralGPUInfo(): Array<{label: string, value: string}> {
467
+ const info: Array<{label: string, value: string}> = [];
468
+
469
+ // Display and window info
470
+ const dpr = window.devicePixelRatio;
471
+ info.push({ label: "Device Pixel Ratio", value: dpr.toString() });
472
+ info.push({ label: "Width (px)", value: (window.innerWidth * dpr).toString() });
473
+ info.push({ label: "Height (px)", value: (window.innerHeight * dpr).toString() });
474
+
475
+ // Estimated physical screen size in cm (96 DPI desktop, 150 DPI mobile)
476
+ const isMobile = DeviceUtilities.isMobileDevice();
477
+ const estimatedDPI = isMobile ? 150 : 96;
478
+ const widthInches = screen.width / estimatedDPI;
479
+ const heightInches = screen.height / estimatedDPI;
480
+ const widthCm = widthInches * 2.54;
481
+ const heightCm = heightInches * 2.54;
482
+ info.push({ label: "Estimated Width (cm)", value: widthCm.toFixed(1) });
483
+ info.push({ label: "Estimated Height (cm)", value: heightCm.toFixed(1) });
484
+
485
+ const webglInfo = getWebGLInfo();
486
+ if (webglInfo) {
487
+ info.push({ label: "GPU", value: webglInfo.renderer });
488
+ info.push({ label: "Driver", value: webglInfo.vendor });
489
+ info.push({ label: "ANGLE", value: webglInfo.angle || "Not detected" });
490
+
491
+ // Enhanced GPU parsing
492
+ const gpuDetails = parseGPUDetails(webglInfo.renderer);
493
+ if (gpuDetails) {
494
+ if (gpuDetails.manufacturer) info.push({ label: "Manufacturer", value: gpuDetails.manufacturer });
495
+ if (gpuDetails.cardVersion) info.push({ label: "Card Version", value: gpuDetails.cardVersion });
496
+ if (gpuDetails.brand) info.push({ label: "Brand", value: gpuDetails.brand });
497
+ info.push({ label: "Integrated", value: gpuDetails.integrated ? "Yes" : "No" });
498
+ if (gpuDetails.layer) info.push({ label: "WebGL Layer", value: gpuDetails.layer });
499
+ }
500
+ }
501
+
502
+ return info;
503
+ }
504
+
505
+ function parseGPUDetails(renderer: string): {manufacturer?: string, cardVersion?: string, brand?: string, integrated?: boolean, layer?: string, card?: string} | null {
506
+ if (!renderer) return null;
507
+
508
+ const extractValue = (reg: RegExp, str: string) => {
509
+ const matches = str.match(reg);
510
+ return matches && matches[0];
511
+ };
512
+
513
+ const layer = extractValue(/(ANGLE)/g, renderer) || undefined;
514
+ const card = extractValue(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/, renderer) || renderer;
515
+
516
+ const tokens = card.split(' ');
517
+ tokens.shift();
518
+
519
+ const manufacturer = extractValue(/(NVIDIA|AMD|Intel)/g, card) || undefined;
520
+ const cardVersion = tokens.length > 0 ? tokens.pop() : undefined;
521
+ const brand = tokens.length > 0 ? tokens.join(' ') : undefined;
522
+ const integrated = manufacturer === 'Intel';
523
+
524
+ return {
525
+ manufacturer,
526
+ cardVersion,
527
+ brand,
528
+ integrated,
529
+ layer,
530
+ card
531
+ };
532
+ }
533
+
534
+ function getWebGLDetailedInfo(): Array<{label: string, value: string}> {
535
+ const info: Array<{label: string, value: string}> = [];
536
+
537
+ const webglInfo = getWebGLInfo();
538
+ if (webglInfo) {
539
+ info.push({ label: "📊 WebGL Version", value: webglInfo.version });
540
+ info.push({ label: "🎮 WebGL 2 Available", value: getWebGL2Support() });
541
+ }
542
+
543
+ return info;
544
+ }
545
+
546
+ function getWebGL2FeaturesTable(): Array<{label: string, value: string}> {
547
+ const features: Array<{label: string, value: string}> = [];
548
+
549
+ try {
550
+ const canvas = document.createElement('canvas');
551
+ const gl = canvas.getContext('webgl2');
552
+ if (!gl) return features;
553
+
554
+ // Check for important WebGL 2 features
555
+ features.push({ label: "Float Color Buffer", value: gl.getExtension('EXT_color_buffer_float') ? "✅" : "❌" });
556
+ features.push({ label: "Anisotropic Filtering", value: gl.getExtension('EXT_texture_filter_anisotropic') ? "✅" : "❌" });
557
+ features.push({ label: "Float Texture Linear", value: gl.getExtension('OES_texture_float_linear') ? "✅" : "❌" });
558
+ features.push({ label: "S3TC Compression", value: gl.getExtension('WEBGL_compressed_texture_s3tc') ? "✅" : "❌" });
559
+ features.push({ label: "ETC Compression", value: gl.getExtension('WEBGL_compressed_texture_etc') ? "✅" : "❌" });
560
+ features.push({ label: "PVRTC Compression", value: gl.getExtension('WEBGL_compressed_texture_pvrtc') ? "✅" : "❌" });
561
+ features.push({ label: "ASTC Compression", value: gl.getExtension('WEBGL_compressed_texture_astc') ? "✅" : "❌" });
562
+
563
+ } catch (e) {
564
+ // WebGL2 not supported
565
+ }
566
+ return features;
567
+ }
568
+
569
+ function getWebGLLimitsTable(): Array<{label: string, value: string}> {
570
+ const limits: Array<{label: string, value: string}> = [];
571
+
572
+ try {
573
+ // Try WebGL 2 first, fall back to WebGL 1
574
+ const canvas = document.createElement('canvas');
575
+ const gl = canvas.getContext('webgl2') || canvas.getContext('webgl');
576
+ if (!gl) return limits;
577
+
578
+ const isWebGL2 = gl instanceof WebGL2RenderingContext;
579
+
580
+ limits.push({ label: "📏 Max Texture Size", value: gl.getParameter(gl.MAX_TEXTURE_SIZE).toString() });
581
+ limits.push({ label: "🎨 Max Renderbuffer Size", value: gl.getParameter(gl.MAX_RENDERBUFFER_SIZE).toString() });
582
+ limits.push({ label: "🔗 Max Vertex Attribs", value: gl.getParameter(gl.MAX_VERTEX_ATTRIBS).toString() });
583
+ limits.push({ label: "🎯 Max Texture Units", value: gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS).toString() });
584
+
585
+ if (isWebGL2) {
586
+ limits.push({ label: "⚡ Max Samples", value: gl.getParameter(gl.MAX_SAMPLES).toString() });
587
+ limits.push({ label: "🔄 Max Uniform Buffer Bindings", value: gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS).toString() });
588
+ limits.push({ label: "📐 Max 3D Texture Size", value: gl.getParameter(gl.MAX_3D_TEXTURE_SIZE).toString() });
589
+ }
590
+
591
+ } catch (e) {
592
+ // WebGL not available
593
+ }
594
+ return limits;
595
+ }
596
+
597
+ function getTextureFormatsTable(): Array<{label: string, value: string}> {
598
+ const formats: Array<{label: string, value: string}> = [];
599
+
600
+ try {
601
+ // WebGL 1 texture formats
602
+ const canvas1 = document.createElement('canvas');
603
+ const gl1 = canvas1.getContext('webgl');
604
+ if (gl1) {
605
+ formats.push({ label: "WebGL 1 RGBA", value: "✅" });
606
+ formats.push({ label: "WebGL 1 RGB", value: "✅" });
607
+ }
608
+
609
+ // WebGL 2 texture formats
610
+ const canvas2 = document.createElement('canvas');
611
+ const gl2 = canvas2.getContext('webgl2');
612
+ if (gl2) {
613
+ formats.push({ label: "WebGL 2 RGBA32F", value: gl2.getExtension('EXT_color_buffer_float') ? "✅" : "❌" });
614
+ formats.push({ label: "WebGL 2 RGB32F", value: gl2.getExtension('EXT_color_buffer_float') ? "✅" : "❌" });
615
+ formats.push({ label: "WebGL 2 R11F_G11F_B10F", value: "✅" });
616
+ formats.push({ label: "WebGL 2 RGB565", value: "✅" });
617
+ formats.push({ label: "WebGL 2 RGB5_A1", value: "✅" });
618
+ formats.push({ label: "WebGL 2 RGBA4444", value: "✅" });
619
+ }
620
+
621
+ } catch (e) {
622
+ // WebGL not available
623
+ }
624
+ return formats;
625
+ }
626
+
627
+ async function getWebGPUInfoTable(): Promise<Array<{label: string, value: string}>> {
628
+ const info: Array<{label: string, value: string}> = [];
629
+
630
+ if (!('gpu' in navigator)) {
631
+ info.push({ label: "🚀 WebGPU Support", value: "❌ Not supported" });
632
+ return info;
633
+ }
634
+
635
+ info.push({ label: "🚀 WebGPU Support", value: "✅ Supported" });
636
+
637
+ try {
638
+ const adapter = await (navigator as any).gpu.requestAdapter();
639
+ if (!adapter) {
640
+ info.push({ label: "🎯 Adapter", value: "No adapter available" });
641
+ return info;
642
+ }
643
+
644
+ info.push({ label: "🎯 Adapter", value: adapter.name || "Unknown Adapter" });
645
+
646
+ const device = await adapter.requestDevice();
647
+ info.push({ label: "🔧 Device", value: device.label || "WebGPU Device" });
648
+
649
+ // WebGPU Limits
650
+ info.push({ label: "📏 Max Texture 2D", value: device.limits.maxTextureDimension2D.toString() });
651
+ info.push({ label: "📐 Max Texture 3D", value: device.limits.maxTextureDimension3D.toString() });
652
+ info.push({ label: "📊 Max Texture Array Layers", value: device.limits.maxTextureArrayLayers.toString() });
653
+ info.push({ label: "💾 Max Buffer Size", value: `${(device.limits.maxBufferSize / 1024 / 1024).toFixed(1)}MB` });
654
+ info.push({ label: "🔗 Max Bind Groups", value: device.limits.maxBindGroups.toString() });
655
+
656
+ } catch (e) {
657
+ info.push({ label: "❌ Error", value: (e as Error).message });
658
+ }
659
+
660
+ return info;
661
+ }
662
+
663
+ function getWebGLInfo(): {renderer: string, vendor: string, version: string, angle?: string} | null {
664
+ try {
665
+ const canvas = document.createElement('canvas');
666
+ // Try WebGL 2 first, fall back to WebGL 1
667
+ const gl = canvas.getContext('webgl2') || canvas.getContext('webgl');
668
+ if (!gl) return null;
669
+
670
+ const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
671
+ const renderer = debugInfo ? gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER);
672
+ const vendor = debugInfo ? gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) : gl.getParameter(gl.VENDOR);
673
+ const version = gl.getParameter(gl.VERSION);
674
+
675
+ // Try to detect ANGLE
676
+ let angle = undefined;
677
+ if (renderer && renderer.includes('ANGLE')) {
678
+ const angleMatch = renderer.match(/ANGLE \(([^)]+)\)/);
679
+ if (angleMatch) {
680
+ angle = angleMatch[1];
681
+ }
682
+ }
683
+
684
+ return { renderer, vendor, version, angle };
685
+ } catch (e) {
686
+ return null;
687
+ }
688
+ }
689
+
690
+ function getSafariGPUInfo(): Array<{label: string, value: string}> {
691
+ const info: Array<{label: string, value: string}> = [];
692
+
693
+ // Try to get Safari-specific GPU info
694
+ try {
695
+ const canvas = document.createElement('canvas');
696
+ const gl = canvas.getContext('webgl');
697
+ if (gl) {
698
+ const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
699
+ if (debugInfo) {
700
+ const renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
701
+ if (renderer && renderer.includes('Apple')) {
702
+ info.push({ label: "🍎 Apple GPU", value: renderer });
703
+ }
704
+ }
705
+ }
706
+ } catch (e) {
707
+ // Ignore errors
708
+ }
709
+
710
+ // Check for WebGL extensions specific to Safari
711
+ try {
712
+ const canvas = document.createElement('canvas');
713
+ const gl = canvas.getContext('webgl');
714
+ if (gl) {
715
+ const extensions = gl.getSupportedExtensions() || [];
716
+ if (extensions.includes('WEBGL_compressed_texture_pvrtc')) {
717
+ info.push({ label: "🗜️ PVRTC Support", value: "✅" });
718
+ }
719
+ }
720
+ } catch (e) {
721
+ // Ignore errors
722
+ }
723
+
724
+ return info;
725
+ }
726
+
727
+ function getDeviceType(): string {
728
+ if (DeviceUtilities.isQuest()) return "Meta Quest";
729
+ if (DeviceUtilities.isVisionOS()) return "Vision Pro";
730
+ if (DeviceUtilities.isiOS()) {
731
+ if (DeviceUtilities.isiPad()) return "iPad";
732
+ return "iPhone/iPod";
733
+ }
734
+ if (DeviceUtilities.isAndroidDevice()) return "Android Device";
735
+ if (DeviceUtilities.isMozillaXR()) return "Mozilla XR Browser";
736
+ if (DeviceUtilities.isNeedleAppClip()) return "Needle App Clip";
737
+ if (DeviceUtilities.isMacOS()) return "Mac";
738
+ if (DeviceUtilities.isDesktop()) return "Desktop PC";
739
+ return "Unknown Device";
740
+ }
741
+
294
742
  function getConsoleSwitchButton(): HTMLElement | null {
295
743
  const el = document.querySelector("#__vconsole .vc-switch");
296
744
  if (el) return el as HTMLElement;
@@ -218,13 +218,13 @@ export function getComponents<T extends IComponent>(obj: Object3D, componentType
218
218
  * const myComponent = getComponentInChildren(myObject, MyComponent);
219
219
  * ```
220
220
  */
221
- export function getComponentInChildren<T extends IComponent>(obj: Object3D, componentType: Constructor<T>, includeInactive?: boolean): T | null {
222
- if(includeInactive === false && obj[activeInHierarchyFieldName] === false) return null;
221
+ export function getComponentInChildren<T extends IComponent>(obj: Object3D, componentType: Constructor<T>, includeInactive: boolean = false): T | null {
222
+ if(includeInactive === false && obj[activeInHierarchyFieldName] === false) return null;
223
223
  const res = getComponent(obj, componentType) as IComponent | null;
224
- if (includeInactive === false && res?.enabled === false) return null;
224
+ if (includeInactive === false && (res?.enabled === false || res?.activeAndEnabled === false)) return null;
225
225
  if (res) return res as T;
226
226
  for (let i = 0; i < obj?.children?.length; i++) {
227
- const res = getComponentInChildren(obj.children[i], componentType);
227
+ const res = getComponentInChildren(obj.children[i], componentType, includeInactive);
228
228
  if (res) return res;
229
229
  }
230
230
  return null;
@@ -150,6 +150,12 @@ export class NEPointerEvent extends PointerEvent {
150
150
  override get pointerType(): PointerTypeNames { return this._pointerType; }
151
151
  private readonly _pointerType: PointerTypeNames;
152
152
 
153
+ /**
154
+ * The button name that raised this event (e.g. for mouse events "left", "right", "middle" or for XRTrigger "xr-standard-trigger" or "xr-standard-thumbstick")
155
+ * Use {@link button} to get the numeric button index (e.g. 0, 1, 2...) on the controller or mouse.
156
+ */
157
+ readonly buttonName?: ButtonName | "none" = undefined;
158
+
153
159
  // this is set via the init arguments (we override it here for intellisense to show the string options)
154
160
  /** The input that raised this event like `pointerdown` */
155
161
  override get type(): InputEventNames { return this._type; }
@@ -176,6 +182,7 @@ export class NEPointerEvent extends PointerEvent {
176
182
  this.mode = init.mode;
177
183
  this._ray = init.ray;
178
184
  this.space = init.device;
185
+ this.buttonName = init.buttonName;
179
186
  }
180
187
 
181
188
  private _immediatePropagationStopped = false;
@@ -81,7 +81,7 @@ async function checkLicense() {
81
81
  if (runtimeLicenseCheckPromise) return runtimeLicenseCheckPromise;
82
82
  if (NEEDLE_ENGINE_LICENSE_TYPE === "basic") {
83
83
  try {
84
- const licenseUrl = "https://engine.needle.tools/licensing/check?location=" + encodeURIComponent(window.location.href) + "&version=" + VERSION + "&generator=" + encodeURIComponent(GENERATOR);
84
+ const licenseUrl = "https://needle.tools/api/v1/needle-engine/check?location=" + encodeURIComponent(window.location.href) + "&version=" + VERSION + "&generator=" + encodeURIComponent(GENERATOR);
85
85
  const res = await fetch(licenseUrl, {
86
86
  method: "GET",
87
87
  }).catch(_err => {
@@ -352,17 +352,12 @@ async function sendUsageMessageToAnalyticsBackend(context: IContext) {
352
352
  }
353
353
 
354
354
  try {
355
- const analyticsUrl = "htt" + "ps://nee" + "dle.tools/api/v1/ana" + "lytics";
355
+ const analyticsUrl = "htt" + "ps://" + "needle" + ".tools/" + "api/v1/needle-engine/ping";
356
356
  if (analyticsUrl) {
357
357
 
358
358
  // current url without query parameters
359
359
  const currentUrl = window.location.href.split("?")[0];
360
-
361
- let endpoint = "api/v2/new/request";
362
- if (!analyticsUrl.endsWith("/")) endpoint = "/" + endpoint;
363
360
  const license = NEEDLE_ENGINE_LICENSE_TYPE;
364
- const finalUrl = `${analyticsUrl}${endpoint}`;
365
- if (debug) console.debug("Sending beacon");
366
361
 
367
362
  const beaconData = {
368
363
  license,
@@ -376,7 +371,7 @@ async function sendUsageMessageToAnalyticsBackend(context: IContext) {
376
371
  build_time: BUILD_TIME,
377
372
  public_key: PUBLIC_KEY,
378
373
  };
379
- const res = navigator.sendBeacon?.(finalUrl, JSON.stringify(beaconData));
374
+ const res = navigator.sendBeacon?.(analyticsUrl, JSON.stringify(beaconData));
380
375
  if (debug) console.debug("Sent beacon: " + res);
381
376
  }
382
377
  }
@@ -629,7 +629,7 @@ export class NetworkConnection implements INetworkConnection {
629
629
  return;
630
630
  }
631
631
 
632
- console.debug("Connecting to networking backend on\n" + networkingServerUrl)
632
+ console.debug("Connecting to networking backend on\n" + networkingServerUrl)
633
633
  const pkg = await import('websocket-ts');
634
634
  // @ts-ignore
635
635
  const WebsocketBuilder = pkg.default?.WebsocketBuilder ?? pkg.WebsocketBuilder;
@@ -641,8 +641,8 @@ export class NetworkConnection implements INetworkConnection {
641
641
  this._connectingToWebsocketPromise = null;
642
642
  this._ws = ws;
643
643
  this.connected = true;
644
- if (isDevEnvironment() || debugNet) console.log("Connected to networking backend\n" + networkingServerUrl);
645
- else console.debug("Connected to networking backend", networkingServerUrl);
644
+ if (isDevEnvironment() || debugNet) console.log("Connected to networking backend\n" + networkingServerUrl);
645
+ else console.debug("Connected to networking backend", networkingServerUrl);
646
646
  resolve(true);
647
647
  this.onSendQueued(SendQueue.OnConnection);
648
648
  })
@@ -656,10 +656,10 @@ export class NetworkConnection implements INetworkConnection {
656
656
  console.error(msg);
657
657
  })
658
658
  .onError((_e) => {
659
- console.error("Websocket connection failed...");
659
+ console.error("Websocket connection failed...");
660
660
  resolve(false);
661
661
  })
662
- .onRetry(() => { console.log("Retry connecting to networking websocket") })
662
+ .onRetry(() => { console.log("Retry connecting to networking websocket") })
663
663
  .build();
664
664
  ws.addEventListener(pkg.WebsocketEvent.message, (socket, msg) => {
665
665
  this.onMessage(socket, msg);
@@ -1,7 +1,7 @@
1
1
  import { getRaycastMesh } from '@needle-tools/gltf-progressive';
2
2
  import { ArrayCamera, Box3, BufferGeometry, Camera, type Intersection, Layers, Line, Matrix3, Matrix4, Mesh, Object3D, PerspectiveCamera, Plane, Ray, Raycaster, SkinnedMesh, Sphere, SphereGeometry, Vector2, Vector3 } from 'three'
3
3
  import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
4
- import type { MeshBVH, MeshBVHOptions, StaticGeometryGenerator } from 'three-mesh-bvh';
4
+ import type { ComputeBVHOptions, GeometryBVH, MeshBVH, StaticGeometryGenerator } from 'three-mesh-bvh';
5
5
  import type { GenerateMeshBVHWorker } from 'three-mesh-bvh/src/workers/GenerateMeshBVHWorker.js';
6
6
 
7
7
  import { isDevEnvironment } from './debug/index.js';
@@ -762,7 +762,7 @@ namespace NEMeshBVH {
762
762
  return true;
763
763
  }
764
764
  else if (method instanceof Sphere) {
765
- const bvh = geom.boundsTree;
765
+ const bvh = geom.boundsTree as MeshBVH | undefined;
766
766
  if (bvh) {
767
767
  const sphere = method;
768
768
  // Gizmos.DrawWireSphere(sphere.center, sphere.radius, 0xdddd00, 1, false);
@@ -789,7 +789,7 @@ namespace NEMeshBVH {
789
789
  let _acceleratedRaycast: Function | null = null;
790
790
  let _MeshBVH: ConstructorConcrete<MeshBVH> | null = null;
791
791
  let _StaticGeometryGenerator: ConstructorConcrete<StaticGeometryGenerator> | null = null;
792
- let _computeBoundsTree: ((_opt?: MeshBVHOptions) => MeshBVH) | null = null;
792
+ let _computeBoundsTree: (( options?: ComputeBVHOptions ) => GeometryBVH) | null = null;
793
793
 
794
794
  function loadMeshBVHLibrary() {
795
795
  if (didLoadMeshBVHLibrary) return;
@@ -273,7 +273,7 @@ export class RapierPhysics implements IPhysicsEngine {
273
273
  if (MODULES.RAPIER_PHYSICS.MAYBEMODULE == undefined) {
274
274
  if (debugPhysics) console.trace("Loading rapier physics engine");
275
275
  const module = await MODULES.RAPIER_PHYSICS.load();
276
- // https://github.com/dimforge/rapier/issues/811
276
+ // https://github.com/dimforge/rapier/issues/811 < but single object parameter still warns
277
277
  await module.init();
278
278
  }
279
279
  if (debugPhysics) console.log("Physics engine initialized, creating world...");