@needle-tools/engine 4.13.1-beta → 4.13.1-next.9fc3e64

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 (111) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/components.needle.json +1 -1
  3. package/dist/gltf-progressive-CaUGGjVL.umd.cjs +10 -0
  4. package/dist/gltf-progressive-Dbi_Tfhb.js +1528 -0
  5. package/dist/gltf-progressive-DuAR0MQR.min.js +10 -0
  6. package/dist/{needle-engine.bundle-CGtsEhyJ.js → needle-engine.bundle-BZRE5G6O.js} +335 -312
  7. package/dist/{needle-engine.bundle-fbFZTOKP.umd.cjs → needle-engine.bundle-Dqrh7aWw.umd.cjs} +29 -29
  8. package/dist/{needle-engine.bundle-6774fXoY.min.js → needle-engine.bundle-DwybonUg.min.js} +47 -47
  9. package/dist/needle-engine.d.ts +446 -39
  10. package/dist/needle-engine.js +3 -3
  11. package/dist/needle-engine.min.js +1 -1
  12. package/dist/needle-engine.umd.cjs +1 -1
  13. package/lib/engine/engine_context.js +12 -2
  14. package/lib/engine/engine_context.js.map +1 -1
  15. package/lib/engine/engine_physics.d.ts +2 -0
  16. package/lib/engine/engine_physics.js +2 -0
  17. package/lib/engine/engine_physics.js.map +1 -1
  18. package/lib/engine/engine_physics_rapier.d.ts +2 -0
  19. package/lib/engine/engine_physics_rapier.js +2 -0
  20. package/lib/engine/engine_physics_rapier.js.map +1 -1
  21. package/lib/engine/engine_utils.d.ts +1 -0
  22. package/lib/engine/engine_utils.js +1 -0
  23. package/lib/engine/engine_utils.js.map +1 -1
  24. package/lib/engine/engine_utils_screenshot.d.ts +171 -14
  25. package/lib/engine/engine_utils_screenshot.js +65 -0
  26. package/lib/engine/engine_utils_screenshot.js.map +1 -1
  27. package/lib/engine/engine_utils_screenshot.xr.d.ts +1 -1
  28. package/lib/engine/engine_utils_screenshot.xr.js +1 -1
  29. package/lib/engine/extensions/NEEDLE_techniques_webgl.js +3 -0
  30. package/lib/engine/extensions/NEEDLE_techniques_webgl.js.map +1 -1
  31. package/lib/engine/xr/NeedleXRSession.d.ts +5 -0
  32. package/lib/engine/xr/NeedleXRSession.js +5 -0
  33. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  34. package/lib/engine-components/ContactShadows.d.ts +2 -0
  35. package/lib/engine-components/ContactShadows.js +2 -0
  36. package/lib/engine-components/ContactShadows.js.map +1 -1
  37. package/lib/engine-components/EventList.js +2 -2
  38. package/lib/engine-components/EventList.js.map +1 -1
  39. package/lib/engine-components/Renderer.d.ts +4 -3
  40. package/lib/engine-components/Renderer.js +4 -3
  41. package/lib/engine-components/Renderer.js.map +1 -1
  42. package/lib/engine-components/RigidBody.d.ts +57 -5
  43. package/lib/engine-components/RigidBody.js +57 -5
  44. package/lib/engine-components/RigidBody.js.map +1 -1
  45. package/lib/engine-components/ScreenCapture.d.ts +1 -0
  46. package/lib/engine-components/ScreenCapture.js +1 -0
  47. package/lib/engine-components/ScreenCapture.js.map +1 -1
  48. package/lib/engine-components/SeeThrough.d.ts +70 -5
  49. package/lib/engine-components/SeeThrough.js +70 -5
  50. package/lib/engine-components/SeeThrough.js.map +1 -1
  51. package/lib/engine-components/ShadowCatcher.d.ts +56 -4
  52. package/lib/engine-components/ShadowCatcher.js +56 -4
  53. package/lib/engine-components/ShadowCatcher.js.map +1 -1
  54. package/lib/engine-components/Skybox.d.ts +43 -7
  55. package/lib/engine-components/Skybox.js +43 -7
  56. package/lib/engine-components/Skybox.js.map +1 -1
  57. package/lib/engine-components/VideoPlayer.d.ts +1 -1
  58. package/lib/engine-components/VideoPlayer.js +7 -1
  59. package/lib/engine-components/VideoPlayer.js.map +1 -1
  60. package/lib/engine-components/timeline/PlayableDirector.d.ts +4 -0
  61. package/lib/engine-components/timeline/PlayableDirector.js +4 -0
  62. package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
  63. package/lib/engine-components/timeline/TimelineModels.d.ts +14 -0
  64. package/lib/engine-components/timeline/TimelineModels.js +4 -0
  65. package/lib/engine-components/timeline/TimelineModels.js.map +1 -1
  66. package/lib/engine-components/utils/OpenURL.d.ts +1 -0
  67. package/lib/engine-components/utils/OpenURL.js +1 -0
  68. package/lib/engine-components/utils/OpenURL.js.map +1 -1
  69. package/lib/engine-components/web/CursorFollow.d.ts +1 -0
  70. package/lib/engine-components/web/CursorFollow.js +1 -0
  71. package/lib/engine-components/web/CursorFollow.js.map +1 -1
  72. package/lib/engine-components/web/ScrollFollow.d.ts +1 -0
  73. package/lib/engine-components/web/ScrollFollow.js +1 -0
  74. package/lib/engine-components/web/ScrollFollow.js.map +1 -1
  75. package/lib/engine-components/webxr/WebARCameraBackground.d.ts +9 -0
  76. package/lib/engine-components/webxr/WebARCameraBackground.js +9 -0
  77. package/lib/engine-components/webxr/WebARCameraBackground.js.map +1 -1
  78. package/lib/engine-components/webxr/WebXR.d.ts +1 -0
  79. package/lib/engine-components/webxr/WebXR.js +1 -0
  80. package/lib/engine-components/webxr/WebXR.js.map +1 -1
  81. package/package.json +3 -3
  82. package/plugins/vite/build-pipeline.js +16 -2
  83. package/src/engine/engine_context.ts +17 -3
  84. package/src/engine/engine_physics.ts +4 -0
  85. package/src/engine/engine_physics_rapier.ts +8 -4
  86. package/src/engine/engine_utils.ts +1 -0
  87. package/src/engine/engine_utils_screenshot.ts +241 -17
  88. package/src/engine/engine_utils_screenshot.xr.ts +1 -1
  89. package/src/engine/extensions/NEEDLE_techniques_webgl.ts +3 -0
  90. package/src/engine/xr/NeedleXRSession.ts +5 -0
  91. package/src/engine-components/ContactShadows.ts +6 -1
  92. package/src/engine-components/EventList.ts +2 -2
  93. package/src/engine-components/Renderer.ts +14 -13
  94. package/src/engine-components/RigidBody.ts +64 -8
  95. package/src/engine-components/ScreenCapture.ts +1 -0
  96. package/src/engine-components/SeeThrough.ts +76 -9
  97. package/src/engine-components/ShadowCatcher.ts +61 -6
  98. package/src/engine-components/Skybox.ts +48 -12
  99. package/src/engine-components/VideoPlayer.ts +7 -1
  100. package/src/engine-components/timeline/PlayableDirector.ts +5 -1
  101. package/src/engine-components/timeline/SignalAsset.ts +1 -1
  102. package/src/engine-components/timeline/TimelineModels.ts +18 -2
  103. package/src/engine-components/utils/OpenURL.ts +1 -0
  104. package/src/engine-components/web/CursorFollow.ts +1 -0
  105. package/src/engine-components/web/ScrollFollow.ts +1 -0
  106. package/src/engine-components/webxr/WebARCameraBackground.ts +12 -3
  107. package/src/engine-components/webxr/WebXR.ts +1 -0
  108. package/dist/gltf-progressive-BURrJW0U.umd.cjs +0 -8
  109. package/dist/gltf-progressive-DHLDFNvQ.min.js +0 -8
  110. package/dist/gltf-progressive-eiJCrjLb.js +0 -1400
  111. package/src/include/three/DragControls.js +0 -232
@@ -413,6 +413,7 @@ export { Animation_2 as Animation }
413
413
 
414
414
  /**
415
415
  * @category Animation and Sequencing
416
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
416
417
  */
417
418
  export declare type AnimationClipModel = {
418
419
  clip: string | number | AnimationClip;
@@ -1287,6 +1288,7 @@ declare type AttributeChangeCallback = (value: string | null) => void;
1287
1288
 
1288
1289
  /**
1289
1290
  * @category Animation and Sequencing
1291
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
1290
1292
  */
1291
1293
  export declare type AudioClipModel = {
1292
1294
  clip: string;
@@ -3197,6 +3199,8 @@ export declare class ClickThrough extends Component {
3197
3199
 
3198
3200
  /**
3199
3201
  * @category Animation and Sequencing
3202
+ * @see {@link TimelineAssetModel} for the data structure of a timeline asset, which can be played using the PlayableDirector component.
3203
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
3200
3204
  */
3201
3205
  export declare enum ClipExtrapolation {
3202
3206
  None = 0,
@@ -3215,6 +3219,7 @@ export declare type ClipMapping = {
3215
3219
 
3216
3220
  /**
3217
3221
  * @category Animation and Sequencing
3222
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
3218
3223
  */
3219
3224
  export declare type ClipModel = {
3220
3225
  start: number;
@@ -3925,6 +3930,7 @@ export declare class ContactPoint {
3925
3930
  /**
3926
3931
  * [ContactShadows](https://engine.needle.tools/docs/api/ContactShadows) renders proximity-based soft shadows on flat surfaces.
3927
3932
  * Ideal for products or objects that need visual grounding without real-time shadows.
3933
+ * Produces soft, blurred shadows that hug the ground, giving a sense of contact and depth.
3928
3934
  *
3929
3935
  * ![](https://cloud.needle.tools/-/media/87bPTNXHcsbV-An-oSEvHQ.gif)
3930
3936
  *
@@ -3951,6 +3957,7 @@ export declare class ContactPoint {
3951
3957
  * @summary Display contact shadows on the ground
3952
3958
  * @category Rendering
3953
3959
  * @group Components
3960
+ * @see {@link ShadowCatcher} for real-time shadows from lights (more accurate, higher performance cost)
3954
3961
  * @see {@link Light} for real-time shadow casting
3955
3962
  * @see {@link Renderer} for material/rendering control
3956
3963
  * @link https://engine.needle.tools/samples/contact-shadows for a demo of contact shadows
@@ -4548,6 +4555,7 @@ export { ContextRegistry as NeedleEngine }
4548
4555
 
4549
4556
  /**
4550
4557
  * @category Animation and Sequencing
4558
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
4551
4559
  */
4552
4560
  export declare type ControlClipModel = {
4553
4561
  sourceObject: string | Object3D;
@@ -4676,6 +4684,7 @@ export declare function createMotion(name: string, id?: InstantiateIdProvider):
4676
4684
  *
4677
4685
  * @summary Makes objects follow the cursor/touch position in 3D space
4678
4686
  * @category Interactivity
4687
+ * @category Web
4679
4688
  * @group Components
4680
4689
  * @component
4681
4690
  */
@@ -5073,6 +5082,7 @@ declare enum DeviceType {
5073
5082
 
5074
5083
  /**
5075
5084
  * Utility functions to detect certain device types (mobile, desktop), browsers, or capabilities.
5085
+ * @category Utilities
5076
5086
  */
5077
5087
  export declare namespace DeviceUtilities {
5078
5088
  /** @returns `true` for MacOS or Windows devices. `false` for Hololens and other headsets. */
@@ -10018,6 +10028,7 @@ export declare function markAsInstancedRendered(go: Object3D, instanced: boolean
10018
10028
 
10019
10029
  /**
10020
10030
  * @category Animation and Sequencing
10031
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
10021
10032
  */ export declare class MarkerModel {
10022
10033
  type: MarkerType;
10023
10034
  time: number;
@@ -11310,7 +11321,12 @@ export declare type NeedleXRHitTestResult = {
11310
11321
  * The XRRig can be accessed via the `rig` property
11311
11322
  * Set a custom XRRig via `NeedleXRSession.addRig(...)` or `NeedleXRSession.removeRig(...)`
11312
11323
  * By default the active XRRig with the highest priority in the scene is used
11324
+ *
11325
+ * ### Screenshots in XR
11326
+ * Screenshots work automatically during XR sessions, including AR camera feed compositing. See {@link screenshot2} for more information.
11327
+ *
11313
11328
  * @category XR
11329
+ * @see {@link screenshot2} for taking screenshots in XR sessions
11314
11330
  */
11315
11331
  export declare class NeedleXRSession implements INeedleXRSession {
11316
11332
  private static _sync;
@@ -12583,6 +12599,7 @@ export declare function onXRSessionStart(fn: (evt: XRSessionEventArgs) => void):
12583
12599
  * OpenURL behaviour opens a URL in a new tab or window when the object (or any if it's children) is clicked.
12584
12600
  *
12585
12601
  * @category Interactivity
12602
+ * @category Web
12586
12603
  * @group Components
12587
12604
  */
12588
12605
  export declare class OpenURL extends Component implements IPointerClickHandler {
@@ -13579,6 +13596,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
13579
13596
  * ```ts
13580
13597
  * const hit = this.context.physics.engine?.raycast(origin, direction);
13581
13598
  * ```
13599
+ * @see {@link Rigidbody} for physics simulation component
13600
+ * @see {@link Collider} for collision detection component
13582
13601
  * @see {@link RapierPhysics} for physics engine implementation details
13583
13602
  */
13584
13603
  export declare class Physics {
@@ -13691,6 +13710,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
13691
13710
  * It orchestrates playback of TimelineAssets containing animation, audio, signal,
13692
13711
  * control, and activation tracks.
13693
13712
  *
13713
+ * ![](https://cloud.needle.tools/-/media/CkJal5dIBwFe6erA-MmiGw.webp)
13714
+ * *Screenshot: Timeline in Unity*
13715
+ *
13694
13716
  * **Supported track types:**
13695
13717
  * - Animation tracks - animate objects using AnimationClips
13696
13718
  * - Audio tracks - play synchronized audio
@@ -13733,6 +13755,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
13733
13755
  * @see {@link SignalReceiver} for handling timeline signals
13734
13756
  * @link https://engine.needle.tools/samples/?overlay=samples&tag=animation
13735
13757
  * @link https://app.songsofcultures.com/
13758
+ * @link https://engine.needle.tools/docs/blender/animation.html Blender timeline and animation export
13736
13759
  */
13737
13760
  export declare class PlayableDirector extends Component {
13738
13761
  private static createTrackFunctions;
@@ -14723,6 +14746,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
14723
14746
  * const colliderDesc = MODULES.RAPIER_PHYSICS.MODULE.ColliderDesc.ball(1.0);
14724
14747
  * }
14725
14748
  * ```
14749
+ * @see {@link Rigidbody} for physics simulation component
14750
+ * @see {@link Collider} for collision detection component
14726
14751
  * @see {@link Physics} for general raycasting and physics utilities
14727
14752
  * @see {@link MODULES.RAPIER_PHYSICS} for direct access to the Rapier module
14728
14753
  * @link https://rapier.rs/docs/ for Rapier documentation
@@ -15120,20 +15145,52 @@ export declare class OrbitControls extends Component implements ICameraControlle
15120
15145
  export declare const relativePathPrefix = "rel:";
15121
15146
 
15122
15147
  /**
15123
- * [RemoteSkybox](https://engine.needle.tools/docs/api/RemoteSkybox) Is a component that allows you to set the skybox or environment texture of a scene from a URL, a local file or a static skybox name.
15124
- * It supports .hdr, .exr, .jpg, .png files.
15148
+ * The [RemoteSkybox](https://engine.needle.tools/docs/api/RemoteSkybox) component allows you to set the skybox or environment texture of a scene from a URL, a local file or a static skybox name.
15149
+ * It supports .hdr, .exr, .jpg, .png, and .ktx2 files.
15150
+ *
15151
+ * **HTML Attributes:**
15152
+ * You can control skybox and environment from HTML using `<needle-engine>` attributes:
15153
+ * - `background-image`: Sets the scene background/skybox image
15154
+ * - `environment-image`: Sets the scene environment map (for reflections and lighting)
15155
+ *
15156
+ * These attributes accept URLs or magic skybox names (see examples below).
15157
+ *
15158
+ * **Magic Skybox Names:**
15159
+ * Built-in optimized skyboxes hosted on Needle CDN:
15160
+ * - `"studio"` - Neutral studio lighting (default)
15161
+ * - `"blurred-skybox"` - Blurred environment
15162
+ * - `"quicklook"` - Apple QuickLook object mode style
15163
+ * - `"quicklook-ar"` - Apple QuickLook AR mode style
15125
15164
  *
15126
15165
  * ### Events
15127
15166
  * - `dropped-unknown-url`: Emitted when a file is dropped on the scene. The event detail contains the sender, the url and a function to apply the url.
15128
15167
  *
15129
- * @example adding a skybox
15168
+ * @example Using HTML attributes
15169
+ * ```html
15170
+ * <needle-engine
15171
+ * background-image="https://example.com/skybox.hdr"
15172
+ * environment-image="studio">
15173
+ * </needle-engine>
15174
+ * ```
15175
+ *
15176
+ * @example Using magic skybox names
15177
+ * ```html
15178
+ * <needle-engine background-image="studio"></needle-engine>
15179
+ * <needle-engine environment-image="quicklook"></needle-engine>
15180
+ * ```
15181
+ *
15182
+ * @example Adding via code
15130
15183
  * ```ts
15131
- * GameObject.addComponent(gameObject, Skybox, { url: "https://example.com/skybox.hdr", background: true, environment: true });
15184
+ * GameObject.addComponent(gameObject, RemoteSkybox, {
15185
+ * url: "https://example.com/skybox.hdr",
15186
+ * background: true,
15187
+ * environment: true
15188
+ * });
15132
15189
  * ```
15133
15190
  *
15134
- * @example handle custom url
15191
+ * @example Handle custom dropped URL
15135
15192
  * ```ts
15136
- * const skybox = GameObject.addComponent(gameObject, Skybox);
15193
+ * const skybox = GameObject.addComponent(gameObject, RemoteSkybox);
15137
15194
  * skybox.addEventListener("dropped-unknown-url", (evt) => {
15138
15195
  * let url = evt.detail.url;
15139
15196
  * console.log("User dropped file", url);
@@ -15144,14 +15201,18 @@ export declare class OrbitControls extends Component implements ICameraControlle
15144
15201
  * });
15145
15202
  * ```
15146
15203
  *
15147
- * @example update skybox url
15204
+ * @example Update skybox at runtime
15148
15205
  * ```ts
15149
15206
  * skybox.setSkybox("https://example.com/skybox.hdr");
15207
+ * // Or use a magic name:
15208
+ * skybox.setSkybox("studio");
15150
15209
  * ```
15151
15210
  *
15152
15211
  * @summary Sets the skybox or environment texture of a scene
15153
15212
  * @category Rendering
15154
15213
  * @group Components
15214
+ * @see {@link Camera} for clearFlags and background control
15215
+ * @link https://engine.needle.tools/docs/html.html#needle-engine-element
15155
15216
  */
15156
15217
  export declare class RemoteSkybox extends Component {
15157
15218
  /**
@@ -15227,7 +15288,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
15227
15288
  export declare function removePatch(prototype: object, fieldName: string, prefixOrPostfix: Prefix | Postfix): void;
15228
15289
 
15229
15290
  /**
15230
- * [Renderer](https://engine.needle.tools/docs/api/Renderer) controls rendering properties of meshes including materials,
15291
+ * The [Renderer](https://engine.needle.tools/docs/api/Renderer) component controls rendering properties of meshes including materials,
15231
15292
  * lightmaps, reflection probes, and GPU instancing.
15232
15293
  *
15233
15294
  * **Materials:**
@@ -15239,9 +15300,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
15239
15300
  * Use `Renderer.setInstanced(obj, true)` or `enableInstancing` property.
15240
15301
  *
15241
15302
  * **Lightmaps:**
15242
- * Baked lighting is automatically applied when exported from Unity.
15303
+ * Baked lighting is automatically applied when exported from Unity or Blender.
15243
15304
  * Access via the associated {@link RendererLightmap} component.
15244
15305
  *
15306
+ * [![](https://cloud.needle.tools/-/media/Vk944XVswtPEuxlNPLMxPQ.gif)](https://engine.needle.tools/samples/multiple-lightmaps/)
15307
+ *
15245
15308
  * **Debug options:**
15246
15309
  * - `?debugrenderer` - Log renderer info
15247
15310
  * - `?wireframe` - Show wireframe rendering
@@ -15262,7 +15325,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
15262
15325
  * @group Components
15263
15326
  * @see {@link ReflectionProbe} for environment reflections
15264
15327
  * @see {@link Light} for scene lighting
15265
- * @see {@link LODGroup} for level of detail
15266
15328
  */
15267
15329
  export declare class Renderer extends Component implements IRenderer {
15268
15330
  /** Enable or disable instancing for an object. This will create a Renderer component if it does not exist yet.
@@ -15514,15 +15576,67 @@ export declare class OrbitControls extends Component implements ICameraControlle
15514
15576
  }
15515
15577
 
15516
15578
  /**
15517
- * A Rigidbody is used together with a Collider to create physical interactions between objects in the scene.
15579
+ * Rigidbody component for realistic physics simulation and dynamic interactions.
15580
+ * Used together with a {@link Collider} to enable physical behavior like gravity, collisions,
15581
+ * forces, and constraints. Powered by the Rapier physics engine.
15518
15582
  *
15519
- * - Example: https://samples.needle.tools/physics-basic
15520
- * - Example: https://samples.needle.tools/physics-playground
15521
- * - Example: https://samples.needle.tools/physics-&-animation
15583
+ * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
15522
15584
  *
15523
- * @summary Rigidbody for physical interactions
15585
+ * **Key features:**
15586
+ * - Dynamic, kinematic, or static body types
15587
+ * - Automatic or manual mass calculation
15588
+ * - Gravity, drag, and angular drag control
15589
+ * - Position and rotation constraints (locking axes)
15590
+ * - Force, impulse, and velocity manipulation
15591
+ * - Sleep/wake optimization for performance
15592
+ * - Continuous collision detection (CCD) support
15593
+ *
15594
+ * @example Basic dynamic rigidbody
15595
+ * ```ts
15596
+ * const rb = this.gameObject.getComponent(Rigidbody);
15597
+ * rb.useGravity = true;
15598
+ * rb.mass = 2.0;
15599
+ * rb.drag = 0.5;
15600
+ * ```
15601
+ *
15602
+ * @example Apply force to move object
15603
+ * ```ts
15604
+ * const rb = this.gameObject.getComponent(Rigidbody);
15605
+ * rb.applyForce(new Vector3(0, 10, 0)); // Upward force
15606
+ * rb.applyImpulse(new Vector3(5, 0, 0)); // Instant velocity change
15607
+ * ```
15608
+ *
15609
+ * @example Kinematic rigidbody (manually controlled)
15610
+ * ```ts
15611
+ * const rb = this.gameObject.getComponent(Rigidbody);
15612
+ * rb.isKinematic = true; // Not affected by forces
15613
+ * rb.teleport({ x: 0, y: 5, z: 0 }); // Move without physics
15614
+ * ```
15615
+ *
15616
+ * @example Lock rotation on Y axis (useful for characters)
15617
+ * ```ts
15618
+ * const rb = this.gameObject.getComponent(Rigidbody);
15619
+ * rb.lockRotationY = true;
15620
+ * // Or use constraints for multiple axes:
15621
+ * rb.constraints = RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezePositionZ;
15622
+ * ```
15623
+ *
15624
+ * @summary Enables physics simulation with forces, gravity, and collisions
15524
15625
  * @category Physics
15525
15626
  * @group Components
15627
+ * @see {@link BoxCollider} for box-shaped colliders
15628
+ * @see {@link SphereCollider} for sphere-shaped colliders
15629
+ * @see {@link CapsuleCollider} for capsule-shaped colliders
15630
+ * @see {@link MeshCollider} for mesh-based colliders
15631
+ * @see {@link Collider} for collider base class
15632
+ * @see {@link CharacterController} for character movement
15633
+ * @see {@link Joint} for connecting bodies
15634
+ * @see {@link RapierPhysics} for physics engine implementation
15635
+ * @see {@link Physics} for raycasting and physics utilities
15636
+ * @link https://engine.needle.tools/samples/physics-basic/
15637
+ * @link https://engine.needle.tools/samples/physics-playground/
15638
+ * @link https://engine.needle.tools/samples/physics-&-animation/
15639
+ * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies
15526
15640
  */
15527
15641
  export declare class Rigidbody extends Component implements IRigidbody {
15528
15642
  get isRigidbody(): boolean;
@@ -16072,6 +16186,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
16072
16186
  *
16073
16187
  * @summary Share screen, camera or microphone in a networked room
16074
16188
  * @category Networking
16189
+ * @category Multimedia
16075
16190
  * @group Components
16076
16191
  * @see {@link VideoPlayer} for displaying the received stream
16077
16192
  * @see {@link Voip} for voice-only communication
@@ -16220,40 +16335,179 @@ export declare class OrbitControls extends Component implements ICameraControlle
16220
16335
  * const dataUrl = screenshot();
16221
16336
  * saveImage(dataUrl, "screenshot.png");
16222
16337
  * ```
16338
+ *
16223
16339
  */
16224
16340
  export declare function screenshot(context?: Context, width?: number, height?: number, mimeType?: ScreenshotImageMimeType, camera?: Camera_2 | null): string | null;
16225
16341
 
16226
16342
  /**
16227
- * Take a screenshot from the current scene and return a {@link Texture}. This can applied to a surface in 3D space.
16343
+ * Take a screenshot from the current scene and return a {@link Texture}. This can be applied to a surface in 3D space.
16228
16344
  * @param opts Provide `{ type: "texture" }` to get a texture instead of a data url.
16229
16345
  * @returns The texture of the screenshot. Returns null if the screenshot could not be taken.
16346
+ * @category Utilities
16347
+ * @example
16348
+ * ```ts
16349
+ * // Create a texture from the current view
16350
+ * const screenshotTexture = screenshot2({ type: "texture", width: 512, height: 512 });
16351
+ * if (screenshotTexture) {
16352
+ * myMaterial.map = screenshotTexture;
16353
+ * myMaterial.needsUpdate = true;
16354
+ * }
16355
+ *
16356
+ * // Update an existing texture
16357
+ * const existingTexture = new Texture();
16358
+ * screenshot2({ type: "texture", target: existingTexture, transparent: true });
16359
+ * ```
16230
16360
  */
16231
16361
  export declare function screenshot2(opts: ScreenshotOptionsTexture): Texture | null;
16232
16362
 
16233
16363
  /**
16234
- * Take a screenshot from the current scene.
16235
- * @param opts
16236
- * @returns The data url of the screenshot. Returns null if the screenshot could not be taken.
16364
+ * Take a screenshot from the current scene and return a data URL string.
16365
+ *
16366
+ * @param opts Screenshot options. All properties are optional.
16367
+ * @returns The data URL of the screenshot (e.g., "data:image/png;base64,..."). Returns null if the screenshot could not be taken.
16368
+ * @category Utilities
16369
+ *
16370
+ * @example Basic screenshot
16237
16371
  * ```ts
16238
- * const res = screenshot2({
16239
- * width: 1024,
16372
+ * // Take a simple screenshot with default settings
16373
+ * const dataUrl = screenshot2({});
16374
+ * console.log(dataUrl); // "data:image/webp;base64,..."
16375
+ * ```
16376
+ *
16377
+ * @example High-resolution screenshot with transparent background
16378
+ * ```ts
16379
+ * const dataUrl = screenshot2({
16380
+ * width: 2048,
16381
+ * height: 2048,
16382
+ * mimeType: "image/png",
16383
+ * transparent: true,
16384
+ * trim: true, // Remove transparent edges
16385
+ * });
16386
+ * ```
16387
+ *
16388
+ * @example Screenshot with custom background color
16389
+ * ```ts
16390
+ * import { Color } from "three";
16391
+ *
16392
+ * const dataUrl = screenshot2({
16393
+ * width: 1024,
16240
16394
  * height: 1024,
16241
- * mimeType: "image/webp",
16242
- * transparent: true,
16243
- * })
16244
- * // use saveImage to download the image
16245
- * saveImage(res, "screenshot.webp");
16395
+ * background: new Color(0x00ff00), // Green background
16396
+ * });
16397
+ * ```
16398
+ *
16399
+ * @example Download screenshot automatically
16400
+ * ```ts
16401
+ * screenshot2({
16402
+ * width: 1920,
16403
+ * height: 1080,
16404
+ * mimeType: "image/jpeg",
16405
+ * download_filename: "my-scene.jpg",
16406
+ * });
16407
+ * ```
16408
+ *
16409
+ * @example Manual download using saveImage
16410
+ * ```ts
16411
+ * const dataUrl = screenshot2({
16412
+ * width: 1024,
16413
+ * height: 1024,
16414
+ * mimeType: "image/webp",
16415
+ * transparent: true,
16416
+ * });
16417
+ * if (dataUrl) {
16418
+ * saveImage(dataUrl, "screenshot.webp");
16419
+ * }
16420
+ * ```
16421
+ *
16422
+ * @example Screenshot from specific camera
16423
+ * ```ts
16424
+ * const myCamera = this.gameObject.getComponent(Camera);
16425
+ * const dataUrl = screenshot2({
16426
+ * camera: myCamera,
16427
+ * width: 1024,
16428
+ * height: 1024,
16429
+ * });
16246
16430
  * ```
16247
16431
  */
16248
16432
  export declare function screenshot2(opts: ScreenshotOptionsDataUrl): string | null;
16249
16433
 
16250
16434
  /**
16251
- * Take a screenshot asynchronously from the current scene.
16252
- * @returns A promise that resolves with the blob of the screenshot. Returns null if the screenshot could not be taken.
16253
- * @param {ScreenshotOptionsBlob} opts Set `{ type: "blob" }` to get a blob instead of a data url.
16435
+ * Take a screenshot asynchronously and return a Blob. This is useful when you need to process or upload the image data.
16436
+ *
16437
+ * @param opts Set `{ type: "blob" }` to get a blob instead of a data url. All other {@link ScreenshotOptions} are also available.
16438
+ * @returns A Promise that resolves with the Blob of the screenshot. Returns null if the screenshot could not be taken.
16439
+ * @category Utilities
16440
+ *
16441
+ * @example Upload screenshot to server
16442
+ * ```ts
16443
+ * const blob = await screenshot2({ type: "blob", mimeType: "image/png" });
16444
+ * if (blob) {
16445
+ * const formData = new FormData();
16446
+ * formData.append("screenshot", blob, "screenshot.png");
16447
+ * await fetch("/api/upload", { method: "POST", body: formData });
16448
+ * }
16449
+ * ```
16450
+ *
16451
+ * @example Save blob to file (browser download)
16452
+ * ```ts
16453
+ * const blob = await screenshot2({
16454
+ * type: "blob",
16455
+ * width: 1920,
16456
+ * height: 1080,
16457
+ * transparent: true
16458
+ * });
16459
+ * if (blob) {
16460
+ * const url = URL.createObjectURL(blob);
16461
+ * saveImage(url, "screenshot.png");
16462
+ * URL.revokeObjectURL(url); // Clean up
16463
+ * }
16464
+ * ```
16254
16465
  */
16255
16466
  export declare function screenshot2(opts: ScreenshotOptionsBlob): Promise<Blob | null>;
16256
16467
 
16468
+ /**
16469
+ * Take a screenshot and share it using the Web Share API (mobile-friendly).
16470
+ *
16471
+ * **Note**: The Web Share API is only available in secure contexts (HTTPS) and may not be supported on all platforms/browsers.
16472
+ *
16473
+ * @param opts Set `{ type: "share" }` to share the screenshot. Additional options like `filename`, `title`, `text`, and `url` can be provided.
16474
+ * @returns A Promise that resolves with an object containing the blob and whether it was successfully shared.
16475
+ * @category Utilities
16476
+ *
16477
+ * @example Share screenshot on mobile
16478
+ * ```ts
16479
+ * const result = await screenshot2({
16480
+ * type: "share",
16481
+ * filename: "my-creation.png",
16482
+ * title: "Check out my 3D scene!",
16483
+ * text: "I created this with Needle Engine",
16484
+ * url: "https://engine.needle.tools",
16485
+ * mimeType: "image/png",
16486
+ * });
16487
+ *
16488
+ * if (result.shared) {
16489
+ * console.log("Screenshot shared successfully!");
16490
+ * } else {
16491
+ * console.log("User cancelled or sharing not supported");
16492
+ * }
16493
+ * ```
16494
+ *
16495
+ * @example Share with fallback
16496
+ * ```ts
16497
+ * const result = await screenshot2({
16498
+ * type: "share",
16499
+ * filename: "screenshot.webp",
16500
+ * file_type: "image/webp",
16501
+ * });
16502
+ *
16503
+ * if (!result.shared && result.blob) {
16504
+ * // Fallback: download the image instead
16505
+ * const url = URL.createObjectURL(result.blob);
16506
+ * saveImage(url, "screenshot.webp");
16507
+ * URL.revokeObjectURL(url);
16508
+ * }
16509
+ * ```
16510
+ */
16257
16511
  export declare function screenshot2(opts: ScreenshotOptionsShare): Promise<ScreenshotOptionsShareReturnType>;
16258
16512
 
16259
16513
  declare type ScreenshotImageMimeType = "image/webp" | "image/png" | "image/jpeg";
@@ -16315,11 +16569,29 @@ export declare class OrbitControls extends Component implements ICameraControlle
16315
16569
  };
16316
16570
 
16317
16571
  export declare type ScreenshotOptionsShare = ScreenshotOptions & {
16572
+ /**
16573
+ * Set `{ type: "share" }` to share the screenshot using the Web Share API. The promise will resolve with the blob of the screenshot and whether it was shared successfully or not. Note that the Web Share API is only available in secure contexts (HTTPS) and on some platforms.
16574
+ */
16318
16575
  type: "share";
16576
+ /**
16577
+ * The filename to use when sharing the screenshot. If not provided, a default filename will be used.
16578
+ */
16319
16579
  filename?: string;
16580
+ /**
16581
+ * The mime type of the shared file. If not provided, the mime type will be inferred from the screenshot options or default to "image/png".
16582
+ */
16320
16583
  file_type?: ScreenshotImageMimeType;
16584
+ /**
16585
+ * The title to use when sharing the screenshot. This is optional and may not be supported by all platforms.
16586
+ */
16321
16587
  title?: string;
16588
+ /**
16589
+ * The text to use when sharing the screenshot. This is optional and may not be supported by all platforms.
16590
+ */
16322
16591
  text?: string;
16592
+ /**
16593
+ * The URL to use when sharing the screenshot. This is optional and may not be supported by all platforms.
16594
+ */
16323
16595
  url?: string;
16324
16596
  };
16325
16597
 
@@ -16461,6 +16733,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
16461
16733
  *
16462
16734
  * @summary Links scroll position to target objects
16463
16735
  * @category Web
16736
+ * @category Interaction
16464
16737
  * @group Components
16465
16738
  * @component
16466
16739
  */
@@ -16543,23 +16816,89 @@ export declare class OrbitControls extends Component implements ICameraControlle
16543
16816
  *
16544
16817
  * @link [Example Project using ScrollMarker](https://scrollytelling-bike-z23hmxb2gnu5a.needle.run/)
16545
16818
  * @category Animation and Sequencing
16819
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
16546
16820
  */
16547
16821
  export declare type ScrollMarkerModel = MarkerModel & {
16548
16822
  name?: string;
16549
16823
  };
16550
16824
 
16551
16825
  /**
16552
- * Makes the object fade out when it is obscuring the reference point from the camera. This component can be put on any object in the scene. It will affect all Renderer components on the same object and child objects.
16826
+ * Automatically fades objects to transparent when they obscure a reference point from the camera's view.
16827
+ * Perfect for architectural visualization, third-person games, or any scenario where objects should
16828
+ * become see-through when blocking the view of important content.
16829
+ *
16830
+ * [![](https://cloud.needle.tools/-/media/1gbMOJLgTlXOug_g6xeKfg.gif)](https://engine.needle.tools/samples/see-through)
16831
+ *
16832
+ * **How it works:**
16833
+ * - Monitors the angle between the camera, this object, and a reference point
16834
+ * - When the object blocks the view to the reference point, it fades out
16835
+ * - Automatically affects all {@link Renderer} components on this object and children
16836
+ * - Supports both transparent fading and alpha hash (dithered) fading
16553
16837
  *
16554
- * Useful for e.g. making walls transparent when the camera is outside or hiding object's that would otherwise block the view.
16838
+ * **Key Features:**
16839
+ * - Smooth fade transitions with configurable duration
16840
+ * - Optional alpha hash for maintaining opaque rendering (better performance)
16841
+ * - Automatic or manual update modes
16842
+ * - Disables raycasting when faded (objects become click-through)
16843
+ * - Preserves original material properties when re-enabled
16844
+ *
16845
+ * **Configuration:**
16846
+ * - `referencePoint` - Object to keep visible (defaults to scene root)
16847
+ * - `fadeDuration` - Transition speed (default: 0.05 seconds)
16848
+ * - `minAlpha` - Minimum opacity when faded (default: 0 = fully transparent)
16849
+ * - `useAlphaHash` - Use dithered transparency instead of true transparency (default: true)
16850
+ *
16851
+ * **Performance:**
16852
+ * - Materials are cloned once per renderer to avoid affecting shared materials
16853
+ * - Updates direction calculation every 20 frames by default (configurable via `autoUpdate`)
16854
+ * - Use `needsUpdate = true` to force immediate recalculation
16855
+ *
16856
+ * **Requirements:**
16857
+ * Requires at least one {@link Renderer} component on the same object or child objects.
16555
16858
  *
16556
- * Requires a Renderer component on the same object or a child object.
16859
+ * @example Make walls transparent when blocking view
16860
+ * ```ts
16861
+ * // Add to walls or obstacles
16862
+ * const seeThrough = wall.addComponent(SeeThrough);
16863
+ * seeThrough.referencePoint = player; // Keep player visible
16864
+ * seeThrough.fadeDuration = 0.2; // Smooth fade
16865
+ * seeThrough.minAlpha = 0.2; // Slightly visible when faded
16866
+ * ```
16867
+ *
16868
+ * @example Third-person camera with see-through objects
16869
+ * ```ts
16870
+ * const character = GameObject.findByName("Character");
16871
+ * const obstacles = GameObject.findByTag("Obstacle");
16872
+ *
16873
+ * for (const obstacle of obstacles) {
16874
+ * const st = obstacle.addComponent(SeeThrough);
16875
+ * st.referencePoint = character;
16876
+ * st.useAlphaHash = true; // Better performance
16877
+ * }
16878
+ * ```
16879
+ *
16880
+ * @example Manual control of see-through effect
16881
+ * ```ts
16882
+ * const seeThrough = this.gameObject.getComponent(SeeThrough);
16883
+ * if (seeThrough) {
16884
+ * seeThrough.autoUpdate = false; // Disable automatic fading
16557
16885
  *
16558
- * - Example https://see-through-walls-z23hmxbz1kjfjn.needle.run/
16886
+ * // Manually control transparency
16887
+ * seeThrough.updateAlpha(0.5, 0.3); // Fade to 50% over 0.3 seconds
16559
16888
  *
16560
- * @summary Makes objects fade out when obscuring a reference point from the camera
16889
+ * // Or use override for precise control
16890
+ * seeThrough.overrideAlpha = 0.8; // Force 80% opacity
16891
+ * }
16892
+ * ```
16893
+ *
16894
+ * @summary Fades objects when they obscure the camera's view of a reference point
16561
16895
  * @category Rendering
16562
16896
  * @group Components
16897
+ * @see {@link Renderer} for material/rendering control (required)
16898
+ * @see {@link Camera} for camera setup and configuration
16899
+ * @see {@link OrbitControls} for camera controls in similar use cases
16900
+ * @link https://see-through-walls-z23hmxbz1kjfjn.needle.run/ for live demo
16901
+ * @link https://engine.needle.tools/samples/see-through for sample project
16563
16902
  */
16564
16903
  export declare class SeeThrough extends Component {
16565
16904
  /**
@@ -16821,14 +17160,66 @@ export declare class OrbitControls extends Component implements ICameraControlle
16821
17160
  }
16822
17161
 
16823
17162
  /**
16824
- * ShadowCatcher can be added to an Object3D to make it render shadows (or light) in the scene. It can also be used to create a shadow mask, or to occlude light.
16825
- * If the GameObject is a Mesh, it will apply a shadow-catching material to it - otherwise it will create a quad with the shadow-catching material.
17163
+ * ShadowCatcher renders real-time shadows cast by lights onto a mesh surface.
17164
+ * Captures actual shadow data from the scene's lighting system (directional lights, point lights, spot lights).
17165
+ *
17166
+ * If the GameObject is a Mesh, it applies a shadow-catching material to it.
17167
+ * Otherwise, it creates a quad mesh with the shadow-catching material automatically.
17168
+ *
17169
+ * [![](https://cloud.needle.tools/-/media/pFXPchA4vynNKOjgG_KucQ.gif)](https://engine.needle.tools/samples/shadow-catcher/)
17170
+ * *Additive ShadowCatcher mode with point light shadows*
17171
+ *
17172
+ * [![](https://cloud.needle.tools/-/media/oIWgEU49rEA0xJ2TrbzVlg.gif)](https://engine.needle.tools/samples/transmission/)
17173
+ * *ShadowCatcher with directional light shadows*
17174
+ *
17175
+ * **Shadow Modes:**
17176
+ * - `ShadowMask` - Only renders shadows (works best with directional lights)
17177
+ * - `Additive` - Renders light additively (works best with point/spot lights)
17178
+ * - `Occluder` - Occludes light without rendering shadows
17179
+ *
17180
+ * **ShadowCatcher vs ContactShadows:**
17181
+ * - **ShadowCatcher**: Real-time shadows from actual lights. Accurate directional shadows that match light sources. Requires lights with shadows enabled. Updates every frame.
17182
+ * - **{@link ContactShadows}**: Proximity-based ambient occlusion-style shadows. Extremely soft and diffuse, ideal for subtle grounding. Better performance, works without lights.
17183
+ *
17184
+ * **When to use ShadowCatcher:**
17185
+ * - You need accurate shadows that match specific light directions
17186
+ * - Scene has real-time lighting with shadow-casting lights
17187
+ * - Shadows need to follow light attenuation and angles
17188
+ * - AR/VR scenarios where light estimation is available
17189
+ * - Hard or semi-hard shadow edges are desired
16826
17190
  *
16827
- * Note that ShadowCatcher meshes are not raycastable by default; if you want them to be raycastable, change the layers in `onEnable()`.
17191
+ * **When to use ContactShadows instead:**
17192
+ * - You want very soft, ambient occlusion-style ground shadows
17193
+ * - Performance is critical (no per-frame shadow rendering)
17194
+ * - Scene doesn't have shadow-casting lights
17195
+ * - Product visualization or configurators (subtle grounding effect)
17196
+ * - Soft, diffuse shadows are more visually appealing than accurate ones
16828
17197
  *
16829
- * @summary Creates a shadow mask or a light occluder
17198
+ * **Note:** ShadowCatcher meshes are not raycastable by default (layer 2). Change layers in `onEnable()` if raycasting is needed.
17199
+ *
17200
+ * @example Basic shadow catcher plane
17201
+ * ```ts
17202
+ * const plane = new Object3D();
17203
+ * const catcher = addComponent(plane, ShadowCatcher);
17204
+ * catcher.mode = ShadowMode.ShadowMask;
17205
+ * catcher.shadowColor = new RGBAColor(0, 0, 0, 0.8);
17206
+ * ```
17207
+ *
17208
+ * @example Apply to existing mesh
17209
+ * ```ts
17210
+ * const mesh = this.gameObject.getComponent(Mesh);
17211
+ * const catcher = addComponent(mesh, ShadowCatcher);
17212
+ * // The mesh will now catch shadows from scene lights
17213
+ * ```
17214
+ *
17215
+ * @summary Renders real-time shadows from lights onto surfaces
16830
17216
  * @category Rendering
16831
17217
  * @group Components
17218
+ * @see {@link ContactShadows} for proximity-based fake shadows (better performance)
17219
+ * @see {@link Light} for shadow-casting light configuration
17220
+ * @see {@link Renderer} for shadow receiving settings
17221
+ * @link https://engine.needle.tools/samples/shadow-catcher/
17222
+ * @link https://engine.needle.tools/samples/transmission/
16832
17223
  */
16833
17224
  export declare class ShadowCatcher extends Component {
16834
17225
  mode: ShadowMode;
@@ -16982,6 +17373,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
16982
17373
 
16983
17374
  /**
16984
17375
  * @category Animation and Sequencing
17376
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
16985
17377
  */
16986
17378
  export declare class SignalMarkerModel extends MarkerModel {
16987
17379
  retroActive: boolean;
@@ -18975,6 +19367,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
18975
19367
 
18976
19368
  /**
18977
19369
  * @category Animation and Sequencing
19370
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
18978
19371
  */
18979
19372
  export declare type TimelineAssetModel = {
18980
19373
  name: string;
@@ -19031,6 +19424,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
19031
19424
 
19032
19425
  /**
19033
19426
  * @category Animation and Sequencing
19427
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
19034
19428
  */
19035
19429
  export declare type TrackModel = {
19036
19430
  name: string;
@@ -19045,6 +19439,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
19045
19439
 
19046
19440
  /**
19047
19441
  * @category Animation and Sequencing
19442
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
19048
19443
  */
19049
19444
  export declare type TrackOffset = {
19050
19445
  position: Vec3_3 | Vector3;
@@ -19064,6 +19459,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
19064
19459
 
19065
19460
  /**
19066
19461
  * @category Animation and Sequencing
19462
+ * @see {@link TimelineAssetModel} for the data structure of a timeline asset, which can be played using the PlayableDirector component.
19463
+ * @see {@link PlayableDirector} for the main component to control timelines in Needle Engine.
19067
19464
  */
19068
19465
  export declare enum TrackType {
19069
19466
  Activation = "ActivationTrack",
@@ -19901,7 +20298,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
19901
20298
  * - Media streams (from webcam, screen capture, etc.)
19902
20299
  * - HLS playlists (m3u8) for livestreaming
19903
20300
  *
19904
- * ![](https://cloud.needle.tools/-/media/w1uHur5yu3Ni7qFaKIFX-g.gif)
20301
+ * [![](https://cloud.needle.tools/-/media/w1uHur5yu3Ni7qFaKIFX-g.gif)](https://engine.needle.tools/samples/video-playback/)
19905
20302
  *
19906
20303
  * **Rendering modes:**
19907
20304
  * Video can be rendered to a material texture, render texture, or camera planes.
@@ -20548,11 +20945,20 @@ export declare class OrbitControls extends Component implements ICameraControlle
20548
20945
  /**
20549
20946
  * WebARCameraBackground is a component that allows to display the camera feed as a background in an AR session to more easily blend the real world with the virtual world or applying effects to the camera feed.
20550
20947
  *
20948
+ * This component automatically requests `camera-access` permission when entering AR mode, which is required to:
20949
+ * - Display the real-world camera feed as a background
20950
+ * - Include the camera feed in AR screenshots taken with {@link screenshot2}
20951
+ *
20952
+ * **Note**: If you want to take AR screenshots with the camera feed but don't need to display it as a background,
20953
+ * you can still add this component to your scene (it will request camera access) or manually request the
20954
+ * `camera-access` feature in your `onBeforeXR` method.
20955
+ *
20551
20956
  * - Example: https://samples.needle.tools/ar-camera-background
20552
20957
  *
20553
20958
  * @summary Displays the camera feed as background in WebAR sessions
20554
20959
  * @category XR
20555
20960
  * @group Components
20961
+ * @see {@link screenshot2} for taking screenshots in AR (requires camera access for camera feed compositing)
20556
20962
  */
20557
20963
  export declare class WebARCameraBackground extends Component {
20558
20964
  /* Excluded from this release type: onBeforeXR */
@@ -20711,6 +21117,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
20711
21117
  * @see {@link XRControllerMovement} for VR locomotion
20712
21118
  * @see {@link WebARSessionRoot} for AR session configuration
20713
21119
  * @see {@link Avatar} for networked user avatars
21120
+ * @see {@link screenshot2} for taking screenshots in XR (including AR camera feed compositing)
20714
21121
  * @link https://engine.needle.tools/docs/xr.html
20715
21122
  * @link https://engine.needle.tools/samples/?overlay=samples&tag=xr
20716
21123
  * @link https://engine.needle.tools/samples/collaborative-sandbox