@needle-tools/engine 4.2.5 → 4.3.0-alpha.1

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 (121) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/components.needle.json +1 -1
  3. package/dist/needle-engine.bundle.js +4245 -2977
  4. package/dist/needle-engine.bundle.light.js +4236 -2968
  5. package/dist/needle-engine.bundle.light.min.js +73 -73
  6. package/dist/needle-engine.bundle.light.umd.cjs +61 -61
  7. package/dist/needle-engine.bundle.min.js +62 -62
  8. package/dist/needle-engine.bundle.umd.cjs +61 -61
  9. package/dist/needle-engine.light.d.ts +9 -9
  10. package/dist/three-examples.js +825 -794
  11. package/dist/three-examples.light.js +825 -794
  12. package/dist/three-examples.light.min.js +12 -12
  13. package/dist/three-examples.light.umd.cjs +10 -10
  14. package/dist/three-examples.min.js +12 -12
  15. package/dist/three-examples.umd.cjs +10 -10
  16. package/lib/engine/engine_addressables.d.ts +3 -0
  17. package/lib/engine/engine_addressables.js +18 -0
  18. package/lib/engine/engine_addressables.js.map +1 -1
  19. package/lib/engine/engine_input.d.ts +20 -1
  20. package/lib/engine/engine_input.js.map +1 -1
  21. package/lib/engine/engine_types.d.ts +162 -17
  22. package/lib/engine-components/Animator.d.ts +129 -21
  23. package/lib/engine-components/Animator.js +115 -21
  24. package/lib/engine-components/Animator.js.map +1 -1
  25. package/lib/engine-components/AnimatorController.d.ts +161 -32
  26. package/lib/engine-components/AnimatorController.js +176 -29
  27. package/lib/engine-components/AnimatorController.js.map +1 -1
  28. package/lib/engine-components/AudioListener.d.ts +16 -5
  29. package/lib/engine-components/AudioListener.js +16 -5
  30. package/lib/engine-components/AudioListener.js.map +1 -1
  31. package/lib/engine-components/AudioSource.d.ts +120 -28
  32. package/lib/engine-components/AudioSource.js +120 -37
  33. package/lib/engine-components/AudioSource.js.map +1 -1
  34. package/lib/engine-components/AvatarLoader.d.ts +61 -0
  35. package/lib/engine-components/AvatarLoader.js +61 -1
  36. package/lib/engine-components/AvatarLoader.js.map +1 -1
  37. package/lib/engine-components/AxesHelper.d.ts +19 -1
  38. package/lib/engine-components/AxesHelper.js +19 -1
  39. package/lib/engine-components/AxesHelper.js.map +1 -1
  40. package/lib/engine-components/BoxHelperComponent.d.ts +26 -0
  41. package/lib/engine-components/BoxHelperComponent.js +26 -0
  42. package/lib/engine-components/BoxHelperComponent.js.map +1 -1
  43. package/lib/engine-components/Camera.d.ts +126 -37
  44. package/lib/engine-components/Camera.js +139 -37
  45. package/lib/engine-components/Camera.js.map +1 -1
  46. package/lib/engine-components/CameraUtils.js +20 -0
  47. package/lib/engine-components/CameraUtils.js.map +1 -1
  48. package/lib/engine-components/Collider.d.ts +95 -21
  49. package/lib/engine-components/Collider.js +100 -23
  50. package/lib/engine-components/Collider.js.map +1 -1
  51. package/lib/engine-components/Component.d.ts +554 -106
  52. package/lib/engine-components/Component.js +352 -81
  53. package/lib/engine-components/Component.js.map +1 -1
  54. package/lib/engine-components/DragControls.d.ts +95 -21
  55. package/lib/engine-components/DragControls.js +126 -32
  56. package/lib/engine-components/DragControls.js.map +1 -1
  57. package/lib/engine-components/DropListener.d.ts +99 -16
  58. package/lib/engine-components/DropListener.js +119 -14
  59. package/lib/engine-components/DropListener.js.map +1 -1
  60. package/lib/engine-components/Light.d.ts +102 -5
  61. package/lib/engine-components/Light.js +102 -44
  62. package/lib/engine-components/Light.js.map +1 -1
  63. package/lib/engine-components/NeedleMenu.d.ts +28 -11
  64. package/lib/engine-components/NeedleMenu.js +28 -11
  65. package/lib/engine-components/NeedleMenu.js.map +1 -1
  66. package/lib/engine-components/Networking.d.ts +37 -5
  67. package/lib/engine-components/Networking.js +37 -5
  68. package/lib/engine-components/Networking.js.map +1 -1
  69. package/lib/engine-components/SceneSwitcher.d.ts +8 -0
  70. package/lib/engine-components/SceneSwitcher.js +72 -8
  71. package/lib/engine-components/SceneSwitcher.js.map +1 -1
  72. package/lib/engine-components/SpatialTrigger.d.ts +66 -1
  73. package/lib/engine-components/SpatialTrigger.js +74 -2
  74. package/lib/engine-components/SpatialTrigger.js.map +1 -1
  75. package/lib/engine-components/SpectatorCamera.d.ts +66 -4
  76. package/lib/engine-components/SpectatorCamera.js +132 -6
  77. package/lib/engine-components/SpectatorCamera.js.map +1 -1
  78. package/lib/engine-components/SyncedTransform.d.ts +45 -6
  79. package/lib/engine-components/SyncedTransform.js +45 -6
  80. package/lib/engine-components/SyncedTransform.js.map +1 -1
  81. package/lib/engine-components/TransformGizmo.d.ts +49 -3
  82. package/lib/engine-components/TransformGizmo.js +49 -3
  83. package/lib/engine-components/TransformGizmo.js.map +1 -1
  84. package/lib/engine-components/ui/EventSystem.d.ts +1 -0
  85. package/lib/engine-components/ui/EventSystem.js +8 -5
  86. package/lib/engine-components/ui/EventSystem.js.map +1 -1
  87. package/lib/engine-components/webxr/WebXR.d.ts +131 -22
  88. package/lib/engine-components/webxr/WebXR.js +132 -23
  89. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  90. package/lib/engine-components-experimental/networking/PlayerSync.d.ts +82 -9
  91. package/lib/engine-components-experimental/networking/PlayerSync.js +76 -11
  92. package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
  93. package/package.json +1 -1
  94. package/plugins/vite/alias.js +6 -3
  95. package/src/engine/engine_addressables.ts +21 -0
  96. package/src/engine/engine_input.ts +20 -1
  97. package/src/engine/engine_types.ts +179 -18
  98. package/src/engine-components/Animator.ts +142 -22
  99. package/src/engine-components/AnimatorController.ts +184 -34
  100. package/src/engine-components/AudioListener.ts +16 -5
  101. package/src/engine-components/AudioSource.ts +126 -37
  102. package/src/engine-components/AvatarLoader.ts +61 -2
  103. package/src/engine-components/AxesHelper.ts +21 -1
  104. package/src/engine-components/BoxHelperComponent.ts +26 -0
  105. package/src/engine-components/Camera.ts +147 -41
  106. package/src/engine-components/CameraUtils.ts +20 -0
  107. package/src/engine-components/Collider.ts +102 -27
  108. package/src/engine-components/Component.ts +605 -129
  109. package/src/engine-components/DragControls.ts +134 -38
  110. package/src/engine-components/DropListener.ts +143 -23
  111. package/src/engine-components/Light.ts +105 -44
  112. package/src/engine-components/NeedleMenu.ts +29 -11
  113. package/src/engine-components/Networking.ts +37 -6
  114. package/src/engine-components/SceneSwitcher.ts +78 -9
  115. package/src/engine-components/SpatialTrigger.ts +80 -3
  116. package/src/engine-components/SpectatorCamera.ts +136 -18
  117. package/src/engine-components/SyncedTransform.ts +50 -7
  118. package/src/engine-components/TransformGizmo.ts +49 -4
  119. package/src/engine-components/ui/EventSystem.ts +9 -7
  120. package/src/engine-components/webxr/WebXR.ts +144 -27
  121. package/src/engine-components-experimental/networking/PlayerSync.ts +85 -13
@@ -12,57 +12,116 @@ import { XRControllerMovement } from "./controllers/XRControllerMovement.js";
12
12
  * @group Components
13
13
  */
14
14
  export declare class WebXR extends Behaviour {
15
- /** When enabled a button will be added to the UI to enter VR */
15
+ /**
16
+ * When enabled, a button will be automatically added to {@link NeedleMenu} that allows users to enter VR mode.
17
+ */
16
18
  createVRButton: boolean;
17
- /** When enabled a button will be added to the UI to enter AR */
19
+ /**
20
+ * When enabled, a button will be automatically added to {@link NeedleMenu} that allows users to enter AR mode.
21
+ */
18
22
  createARButton: boolean;
19
- /** When enabled a send to quest button will be shown if the device does not support VR */
23
+ /**
24
+ * When enabled, a button to send the experience to an Oculus Quest will be shown if the current device does not support VR.
25
+ * This helps direct users to compatible devices for optimal VR experiences.
26
+ */
20
27
  createSendToQuestButton: boolean;
21
- /** When enabled a QRCode will be created to open the website on a mobile device */
28
+ /**
29
+ * When enabled, a QR code will be generated and displayed on desktop devices to allow easy opening of the experience on mobile devices.
30
+ */
22
31
  createQRCode: boolean;
23
- /** When enabled default movement behaviour will be added */
32
+ /**
33
+ * When enabled, default movement controls will be automatically added to the scene when entering VR.
34
+ * This includes teleportation and smooth locomotion options for VR controllers.
35
+ */
24
36
  useDefaultControls: boolean;
25
- /** When enabled controller models will automatically be created and updated when you are using controllers in WebXR */
37
+ /**
38
+ * When enabled, 3D models representing the user's VR controllers will be automatically created and rendered in the scene.
39
+ */
26
40
  showControllerModels: boolean;
27
- /** When enabled hand models will automatically be created and updated when you are using hands in WebXR */
41
+ /**
42
+ * When enabled, 3D models representing the user's hands will be automatically created and rendered when hand tracking is available.
43
+ */
28
44
  showHandModels: boolean;
29
- /** When enabled the scene must be placed in AR */
45
+ /**
46
+ * When enabled, a reticle will be displayed to help place the scene in AR. The user must tap on a detected surface to position the scene.
47
+ */
30
48
  usePlacementReticle: boolean;
31
- /** When assigned this object will be used as the AR placement reticle */
49
+ /**
50
+ * Optional custom 3D object to use as the AR placement reticle instead of the default one.
51
+ */
32
52
  customARPlacementReticle?: AssetReference;
33
- /** When enabled you can position, rotate or scale your AR scene with one or two fingers */
53
+ /**
54
+ * When enabled, users can adjust the position, rotation, and scale of the AR scene with one or two fingers after initial placement.
55
+ */
34
56
  usePlacementAdjustment: boolean;
35
- /** Used when `usePlacementReticle` is enabled. This is the scale of the user in the scene in AR. Larger values make the 3D content appear smaller */
57
+ /**
58
+ * Determines the scale of the user relative to the scene in AR. Larger values make the 3D content appear smaller.
59
+ * Only applies when `usePlacementReticle` is enabled.
60
+ */
36
61
  arScale: number;
37
- /** Experimental: When enabled an XRAnchor will be created for the AR scene and the position will be updated to the anchor position every few frames */
62
+ /**
63
+ * When enabled, an XRAnchor will be created for the AR scene and its position will be regularly updated to match the anchor.
64
+ * This can help with spatial persistence in AR experiences.
65
+ * @experimental
66
+ */
38
67
  useXRAnchor: boolean;
39
68
  /**
40
- * When enabled the scene will be placed automatically when a point in the real world is found
69
+ * When enabled, the scene will be automatically placed as soon as a suitable surface is detected in AR,
70
+ * without requiring the user to tap to confirm placement.
41
71
  */
42
72
  autoPlace: boolean;
43
- /** When enabled the AR session root center will be automatically adjusted to place the center of the scene */
73
+ /**
74
+ * When enabled, the AR session root center will be automatically adjusted to place the center of the scene.
75
+ * This helps ensure the scene is properly aligned with detected surfaces.
76
+ */
44
77
  autoCenter: boolean;
45
- /** When enabled a USDZExporter component will be added to the scene (if none is found) */
78
+ /**
79
+ * When enabled, a USDZExporter component will be automatically added to the scene if none is found.
80
+ * This allows iOS and visionOS devices to view 3D content using Apple's AR QuickLook.
81
+ */
46
82
  useQuicklookExport: boolean;
47
- /** Preview feature enabling occlusion (when available: https://github.com/cabanier/three.js/commit/b6ee92bcd8f20718c186120b7f19a3b68a1d4e47)
48
- * Enables the 'depth-sensing' WebXR feature to provide realtime depth occlusion. Only supported on Oculus Quest right now.
83
+ /**
84
+ * When enabled, the 'depth-sensing' WebXR feature will be requested to provide real-time depth occlusion.
85
+ * Currently only supported on Oculus Quest devices.
86
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/XRDepthInformation
87
+ * @experimental
49
88
  */
50
89
  useDepthSensing: boolean;
51
90
  /**
52
- * When enabled the spatial grab raycaster will be added or enabled in the scene
91
+ * When enabled, a {@link SpatialGrabRaycaster} will be added or enabled in the scene,
92
+ * allowing users to interact with objects at a distance in VR/AR.
53
93
  * @default true
54
94
  */
55
95
  useSpatialGrab: boolean;
56
- /** This avatar representation will be spawned when you enter a webxr session */
96
+ /**
97
+ * Specifies the avatar representation that will be created when entering a WebXR session.
98
+ * Can be a reference to a 3D model or a boolean to use the default avatar.
99
+ */
57
100
  defaultAvatar?: AssetReference | boolean;
58
101
  private _playerSync?;
59
102
  /** these components were created by the WebXR component on session start and will be cleaned up again in session end */
60
103
  private readonly _createdComponentsInSession;
61
104
  private _usdzExporter?;
62
105
  static activeWebXRComponent: WebXR | null;
106
+ /**
107
+ * Initializes the WebXR component by obtaining the XR sync object for this context.
108
+ */
63
109
  awake(): void;
110
+ /**
111
+ * Sets up the WebXR component when it's enabled. Checks for HTTPS connection,
112
+ * sets up USDZ export if enabled, creates UI buttons, and configures avatar settings.
113
+ */
64
114
  onEnable(): void;
115
+ /**
116
+ * Cleans up resources when the component is disabled.
117
+ * Destroys the USDZ exporter if one was created and removes UI buttons.
118
+ */
65
119
  onDisable(): void;
120
+ /**
121
+ * Checks if WebXR is supported and offers an appropriate session.
122
+ * This is used to show the WebXR session joining prompt in browsers that support it.
123
+ * @returns A Promise that resolves to true if a session was offered, false otherwise
124
+ */
66
125
  private handleOfferSession;
67
126
  /** the currently active webxr input session */
68
127
  get session(): NeedleXRSession | null;
@@ -78,24 +137,74 @@ export declare class WebXR extends Behaviour {
78
137
  private _previousXRState;
79
138
  private _spatialGrabRaycaster?;
80
139
  private get isActiveWebXR();
140
+ /**
141
+ * Called before entering a WebXR session. Sets up optional features like depth sensing, if needed.
142
+ * @param _mode The XR session mode being requested (immersive-ar or immersive-vr)
143
+ * @param args The XRSessionInit object that will be passed to the WebXR API
144
+ */
81
145
  onBeforeXR(_mode: XRSessionMode, args: XRSessionInit): void;
146
+ /**
147
+ * Called when a WebXR session begins. Sets up the scene for XR by configuring controllers,
148
+ * AR placement, and other features based on component settings.
149
+ * @param args Event arguments containing information about the started XR session
150
+ */
82
151
  onEnterXR(args: NeedleXREventArgs): Promise<void>;
152
+ /**
153
+ * Called every frame during an active WebXR session.
154
+ * Updates components that depend on the current XR state.
155
+ * @param _args Event arguments containing information about the current XR session frame
156
+ */
83
157
  onUpdateXR(_args: NeedleXREventArgs): void;
158
+ /**
159
+ * Called when a WebXR session ends. Restores pre-session state,
160
+ * removes temporary components, and cleans up resources.
161
+ * @param _ Event arguments containing information about the ended XR session
162
+ */
84
163
  onLeaveXR(_: NeedleXREventArgs): void;
85
164
  /** Call to enable or disable default controller behaviour */
86
165
  setDefaultMovementEnabled(enabled: boolean): XRControllerMovement | null;
87
166
  /** Call to enable or disable default controller rendering */
88
167
  setDefaultControllerRenderingEnabled(enabled: boolean): XRControllerModel | null;
168
+ /**
169
+ * Creates and instantiates the user's avatar representation in the WebXR session.
170
+ * @param xr The active session
171
+ */
89
172
  protected createLocalAvatar(xr: NeedleXRSession): Promise<void>;
173
+ /**
174
+ * Event handler called when a player avatar is spawned.
175
+ * Ensures the avatar has the necessary Avatar component.
176
+ * @param instance The spawned avatar 3D object
177
+ */
90
178
  private onAvatarSpawned;
91
- /** @deprecated use `getButtonsFactory()` or access `WebXRButtonFactory.getOrCreate()` directory */
179
+ /** @deprecated use {@link getButtonsFactory} or directly access {@link WebXRButtonFactory.getOrCreate} */
92
180
  getButtonsContainer(): WebXRButtonFactory;
93
- /** Calling this function will get the Needle WebXR button factory (it will be created if it doesnt exist yet)
94
- * @returns the Needle WebXR button factory */
181
+ /**
182
+ * Returns the WebXR button factory, creating one if it doesn't exist.
183
+ * Use this to access and modify WebXR UI buttons.
184
+ * @returns The WebXRButtonFactory instance
185
+ */
95
186
  getButtonsFactory(): WebXRButtonFactory;
187
+ /**
188
+ * Reference to the WebXR button factory used by this component.
189
+ */
96
190
  private _buttonFactory?;
191
+ /**
192
+ * Creates and sets up UI elements for WebXR interaction based on component settings
193
+ * and device capabilities. Handles creating AR, VR, QuickLook buttons and utility buttons like QR codes.
194
+ */
97
195
  private handleCreatingHTML;
196
+ /**
197
+ * Storage for UI buttons created by this component.
198
+ */
98
199
  private readonly _buttons;
200
+ /**
201
+ * Adds a button to the UI with the specified priority.
202
+ * @param button The HTML element to add
203
+ * @param priority The button's priority value (lower numbers appear first)
204
+ */
99
205
  private addButton;
206
+ /**
207
+ * Removes all buttons created by this component from the UI.
208
+ */
100
209
  private removeButtons;
101
210
  }
@@ -33,59 +33,109 @@ const debugQuicklook = getParam("debugusdz");
33
33
  */
34
34
  export class WebXR extends Behaviour {
35
35
  // UI
36
- /** When enabled a button will be added to the UI to enter VR */
36
+ /**
37
+ * When enabled, a button will be automatically added to {@link NeedleMenu} that allows users to enter VR mode.
38
+ */
37
39
  createVRButton = true;
38
- /** When enabled a button will be added to the UI to enter AR */
40
+ /**
41
+ * When enabled, a button will be automatically added to {@link NeedleMenu} that allows users to enter AR mode.
42
+ */
39
43
  createARButton = true;
40
- /** When enabled a send to quest button will be shown if the device does not support VR */
44
+ /**
45
+ * When enabled, a button to send the experience to an Oculus Quest will be shown if the current device does not support VR.
46
+ * This helps direct users to compatible devices for optimal VR experiences.
47
+ */
41
48
  createSendToQuestButton = true;
42
- /** When enabled a QRCode will be created to open the website on a mobile device */
49
+ /**
50
+ * When enabled, a QR code will be generated and displayed on desktop devices to allow easy opening of the experience on mobile devices.
51
+ */
43
52
  createQRCode = true;
44
53
  // VR Settings
45
- /** When enabled default movement behaviour will be added */
54
+ /**
55
+ * When enabled, default movement controls will be automatically added to the scene when entering VR.
56
+ * This includes teleportation and smooth locomotion options for VR controllers.
57
+ */
46
58
  useDefaultControls = true;
47
- /** When enabled controller models will automatically be created and updated when you are using controllers in WebXR */
59
+ /**
60
+ * When enabled, 3D models representing the user's VR controllers will be automatically created and rendered in the scene.
61
+ */
48
62
  showControllerModels = true;
49
- /** When enabled hand models will automatically be created and updated when you are using hands in WebXR */
63
+ /**
64
+ * When enabled, 3D models representing the user's hands will be automatically created and rendered when hand tracking is available.
65
+ */
50
66
  showHandModels = true;
51
67
  // AR Settings
52
- /** When enabled the scene must be placed in AR */
68
+ /**
69
+ * When enabled, a reticle will be displayed to help place the scene in AR. The user must tap on a detected surface to position the scene.
70
+ */
53
71
  usePlacementReticle = true;
54
- /** When assigned this object will be used as the AR placement reticle */
72
+ /**
73
+ * Optional custom 3D object to use as the AR placement reticle instead of the default one.
74
+ */
55
75
  customARPlacementReticle;
56
- /** When enabled you can position, rotate or scale your AR scene with one or two fingers */
76
+ /**
77
+ * When enabled, users can adjust the position, rotation, and scale of the AR scene with one or two fingers after initial placement.
78
+ */
57
79
  usePlacementAdjustment = true;
58
- /** Used when `usePlacementReticle` is enabled. This is the scale of the user in the scene in AR. Larger values make the 3D content appear smaller */
80
+ /**
81
+ * Determines the scale of the user relative to the scene in AR. Larger values make the 3D content appear smaller.
82
+ * Only applies when `usePlacementReticle` is enabled.
83
+ */
59
84
  arScale = 1;
60
- /** Experimental: When enabled an XRAnchor will be created for the AR scene and the position will be updated to the anchor position every few frames */
85
+ /**
86
+ * When enabled, an XRAnchor will be created for the AR scene and its position will be regularly updated to match the anchor.
87
+ * This can help with spatial persistence in AR experiences.
88
+ * @experimental
89
+ */
61
90
  useXRAnchor = false;
62
91
  /**
63
- * When enabled the scene will be placed automatically when a point in the real world is found
92
+ * When enabled, the scene will be automatically placed as soon as a suitable surface is detected in AR,
93
+ * without requiring the user to tap to confirm placement.
94
+ */
95
+ autoPlace = false;
96
+ /**
97
+ * When enabled, the AR session root center will be automatically adjusted to place the center of the scene.
98
+ * This helps ensure the scene is properly aligned with detected surfaces.
64
99
  */
65
- autoPlace = true;
66
- /** When enabled the AR session root center will be automatically adjusted to place the center of the scene */
67
100
  autoCenter = false;
68
- /** When enabled a USDZExporter component will be added to the scene (if none is found) */
101
+ /**
102
+ * When enabled, a USDZExporter component will be automatically added to the scene if none is found.
103
+ * This allows iOS and visionOS devices to view 3D content using Apple's AR QuickLook.
104
+ */
69
105
  useQuicklookExport = false;
70
- /** Preview feature enabling occlusion (when available: https://github.com/cabanier/three.js/commit/b6ee92bcd8f20718c186120b7f19a3b68a1d4e47)
71
- * Enables the 'depth-sensing' WebXR feature to provide realtime depth occlusion. Only supported on Oculus Quest right now.
106
+ /**
107
+ * When enabled, the 'depth-sensing' WebXR feature will be requested to provide real-time depth occlusion.
108
+ * Currently only supported on Oculus Quest devices.
109
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/XRDepthInformation
110
+ * @experimental
72
111
  */
73
112
  useDepthSensing = false;
74
113
  /**
75
- * When enabled the spatial grab raycaster will be added or enabled in the scene
114
+ * When enabled, a {@link SpatialGrabRaycaster} will be added or enabled in the scene,
115
+ * allowing users to interact with objects at a distance in VR/AR.
76
116
  * @default true
77
117
  */
78
118
  useSpatialGrab = true;
79
- /** This avatar representation will be spawned when you enter a webxr session */
119
+ /**
120
+ * Specifies the avatar representation that will be created when entering a WebXR session.
121
+ * Can be a reference to a 3D model or a boolean to use the default avatar.
122
+ */
80
123
  defaultAvatar;
81
124
  _playerSync;
82
125
  /** these components were created by the WebXR component on session start and will be cleaned up again in session end */
83
126
  _createdComponentsInSession = [];
84
127
  _usdzExporter;
85
128
  static activeWebXRComponent = null;
129
+ /**
130
+ * Initializes the WebXR component by obtaining the XR sync object for this context.
131
+ */
86
132
  awake() {
87
133
  NeedleXRSession.getXRSync(this.context);
88
134
  }
135
+ /**
136
+ * Sets up the WebXR component when it's enabled. Checks for HTTPS connection,
137
+ * sets up USDZ export if enabled, creates UI buttons, and configures avatar settings.
138
+ */
89
139
  onEnable() {
90
140
  // check if we're on a secure connection:
91
141
  if (window.location.protocol !== "https:") {
@@ -121,10 +171,19 @@ export class WebXR extends Behaviour {
121
171
  this._playerSync.onPlayerSpawned?.addEventListener(this.onAvatarSpawned);
122
172
  }
123
173
  }
174
+ /**
175
+ * Cleans up resources when the component is disabled.
176
+ * Destroys the USDZ exporter if one was created and removes UI buttons.
177
+ */
124
178
  onDisable() {
125
179
  this._usdzExporter?.destroy();
126
180
  this.removeButtons();
127
181
  }
182
+ /**
183
+ * Checks if WebXR is supported and offers an appropriate session.
184
+ * This is used to show the WebXR session joining prompt in browsers that support it.
185
+ * @returns A Promise that resolves to true if a session was offered, false otherwise
186
+ */
128
187
  async handleOfferSession() {
129
188
  if (this.createVRButton) {
130
189
  const hasVRSupport = await NeedleXRSession.isVRSupported();
@@ -167,6 +226,11 @@ export class WebXR extends Behaviour {
167
226
  get isActiveWebXR() {
168
227
  return !WebXR.activeWebXRComponent || WebXR.activeWebXRComponent === this;
169
228
  }
229
+ /**
230
+ * Called before entering a WebXR session. Sets up optional features like depth sensing, if needed.
231
+ * @param _mode The XR session mode being requested (immersive-ar or immersive-vr)
232
+ * @param args The XRSessionInit object that will be passed to the WebXR API
233
+ */
170
234
  onBeforeXR(_mode, args) {
171
235
  if (!this.isActiveWebXR) {
172
236
  console.warn(`WebXR: another WebXR component is already active (${WebXR.activeWebXRComponent?.name}). This is ignored: ${this.name}`);
@@ -178,6 +242,11 @@ export class WebXR extends Behaviour {
178
242
  args.optionalFeatures.push("depth-sensing");
179
243
  }
180
244
  }
245
+ /**
246
+ * Called when a WebXR session begins. Sets up the scene for XR by configuring controllers,
247
+ * AR placement, and other features based on component settings.
248
+ * @param args Event arguments containing information about the started XR session
249
+ */
181
250
  async onEnterXR(args) {
182
251
  if (!this.isActiveWebXR)
183
252
  return;
@@ -242,6 +311,11 @@ export class WebXR extends Behaviour {
242
311
  });
243
312
  }
244
313
  }
314
+ /**
315
+ * Called every frame during an active WebXR session.
316
+ * Updates components that depend on the current XR state.
317
+ * @param _args Event arguments containing information about the current XR session frame
318
+ */
245
319
  onUpdateXR(_args) {
246
320
  if (!this.isActiveWebXR)
247
321
  return;
@@ -249,6 +323,11 @@ export class WebXR extends Behaviour {
249
323
  this._spatialGrabRaycaster.enabled = this.useSpatialGrab;
250
324
  }
251
325
  }
326
+ /**
327
+ * Called when a WebXR session ends. Restores pre-session state,
328
+ * removes temporary components, and cleans up resources.
329
+ * @param _ Event arguments containing information about the ended XR session
330
+ */
252
331
  onLeaveXR(_) {
253
332
  this._exitXRMenuButton?.remove();
254
333
  if (!this.isActiveWebXR)
@@ -287,12 +366,21 @@ export class WebXR extends Behaviour {
287
366
  models.enabled = enabled;
288
367
  return models;
289
368
  }
369
+ /**
370
+ * Creates and instantiates the user's avatar representation in the WebXR session.
371
+ * @param xr The active session
372
+ */
290
373
  async createLocalAvatar(xr) {
291
374
  if (this._playerSync && xr.running && typeof this.defaultAvatar != "boolean") {
292
375
  this._playerSync.asset = this.defaultAvatar;
293
376
  await this._playerSync.getInstance();
294
377
  }
295
378
  }
379
+ /**
380
+ * Event handler called when a player avatar is spawned.
381
+ * Ensures the avatar has the necessary Avatar component.
382
+ * @param instance The spawned avatar 3D object
383
+ */
296
384
  onAvatarSpawned = (instance) => {
297
385
  // spawned webxr avatars must have a avatar component
298
386
  if (debug)
@@ -301,19 +389,29 @@ export class WebXR extends Behaviour {
301
389
  avatar ??= GameObject.addComponent(instance, Avatar);
302
390
  };
303
391
  // HTML UI
304
- /** @deprecated use `getButtonsFactory()` or access `WebXRButtonFactory.getOrCreate()` directory */
392
+ /** @deprecated use {@link getButtonsFactory} or directly access {@link WebXRButtonFactory.getOrCreate} */
305
393
  getButtonsContainer() {
306
394
  return this.getButtonsFactory();
307
395
  }
308
- /** Calling this function will get the Needle WebXR button factory (it will be created if it doesnt exist yet)
309
- * @returns the Needle WebXR button factory */
396
+ /**
397
+ * Returns the WebXR button factory, creating one if it doesn't exist.
398
+ * Use this to access and modify WebXR UI buttons.
399
+ * @returns The WebXRButtonFactory instance
400
+ */
310
401
  getButtonsFactory() {
311
402
  if (!this._buttonFactory) {
312
403
  this._buttonFactory = WebXRButtonFactory.getOrCreate();
313
404
  }
314
405
  return this._buttonFactory;
315
406
  }
407
+ /**
408
+ * Reference to the WebXR button factory used by this component.
409
+ */
316
410
  _buttonFactory;
411
+ /**
412
+ * Creates and sets up UI elements for WebXR interaction based on component settings
413
+ * and device capabilities. Handles creating AR, VR, QuickLook buttons and utility buttons like QR codes.
414
+ */
317
415
  handleCreatingHTML() {
318
416
  const xrButtonsPriority = 50;
319
417
  if (this.createARButton || this.createVRButton || this.useQuicklookExport) {
@@ -358,12 +456,23 @@ export class WebXR extends Behaviour {
358
456
  }
359
457
  }
360
458
  }
459
+ /**
460
+ * Storage for UI buttons created by this component.
461
+ */
361
462
  _buttons = [];
463
+ /**
464
+ * Adds a button to the UI with the specified priority.
465
+ * @param button The HTML element to add
466
+ * @param priority The button's priority value (lower numbers appear first)
467
+ */
362
468
  addButton(button, priority) {
363
469
  this._buttons.push(button);
364
470
  button.setAttribute("priority", priority.toString());
365
471
  this.context.menu.appendChild(button);
366
472
  }
473
+ /**
474
+ * Removes all buttons created by this component from the UI.
475
+ */
367
476
  removeButtons() {
368
477
  for (const button of this._buttons) {
369
478
  button.remove();
@@ -1 +1 @@
1
- {"version":3,"file":"WebXR.js","sourceRoot":"","sources":["../../../src/engine-components/webxr/WebXR.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,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