@needle-tools/engine 4.14.0-next.b2e3b1a → 4.15.0-next.cecd8e7
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.
- package/CHANGELOG.md +9 -1
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-Bhgt3W8p.min.js → needle-engine.bundle-CuAiLb-d.min.js} +134 -126
- package/dist/{needle-engine.bundle-BC1QDiuv.umd.cjs → needle-engine.bundle-JQGIFVRm.umd.cjs} +128 -120
- package/dist/{needle-engine.bundle-CeQXs7Hh.js → needle-engine.bundle-VZVrVbc3.js} +3521 -3315
- package/dist/needle-engine.d.ts +450 -107
- package/dist/needle-engine.js +570 -569
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/api.d.ts +202 -17
- package/lib/engine/api.js +270 -17
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_accessibility.d.ts +77 -0
- package/lib/engine/engine_accessibility.js +162 -0
- package/lib/engine/engine_accessibility.js.map +1 -0
- package/lib/engine/engine_components.d.ts +1 -1
- package/lib/engine/engine_components.js +3 -7
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_context.d.ts +2 -12
- package/lib/engine/engine_context.js +7 -29
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_gltf_builtin_components.js +1 -16
- package/lib/engine/engine_gltf_builtin_components.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.d.ts +90 -4
- package/lib/engine/engine_materialpropertyblock.js +97 -7
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine/engine_math.d.ts +34 -1
- package/lib/engine/engine_math.js +34 -1
- package/lib/engine/engine_math.js.map +1 -1
- package/lib/engine/engine_networking.js +1 -1
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_types.d.ts +2 -0
- package/lib/engine/engine_types.js +2 -0
- package/lib/engine/engine_types.js.map +1 -1
- package/lib/engine/webcomponents/icons.js +3 -0
- package/lib/engine/webcomponents/icons.js.map +1 -1
- package/lib/engine/webcomponents/logo-element.d.ts +1 -0
- package/lib/engine/webcomponents/logo-element.js +3 -1
- package/lib/engine/webcomponents/logo-element.js.map +1 -1
- package/lib/engine/webcomponents/needle-button.d.ts +37 -11
- package/lib/engine/webcomponents/needle-button.js +42 -11
- package/lib/engine/webcomponents/needle-button.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.d.ts +10 -2
- package/lib/engine/webcomponents/needle-engine.js +13 -3
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine-components/Component.d.ts +1 -2
- package/lib/engine-components/Component.js +1 -2
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +1 -0
- package/lib/engine-components/DragControls.js +21 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +2 -0
- package/lib/engine-components/NeedleMenu.js +2 -0
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/Networking.d.ts +28 -3
- package/lib/engine-components/Networking.js +28 -3
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/ReflectionProbe.d.ts +1 -0
- package/lib/engine-components/ReflectionProbe.js +20 -2
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.d.ts +107 -13
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js +167 -30
- package/lib/engine-components/export/usdz/extensions/behavior/BehaviourComponents.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.utils.d.ts +1 -1
- package/lib/engine-components/ui/Button.d.ts +1 -0
- package/lib/engine-components/ui/Button.js +11 -0
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +1 -0
- package/lib/engine-components/ui/Text.js +11 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/api.ts +370 -18
- package/src/engine/engine_accessibility.ts +198 -0
- package/src/engine/engine_components.ts +3 -7
- package/src/engine/engine_context.ts +11 -28
- package/src/engine/engine_gltf_builtin_components.ts +1 -17
- package/src/engine/engine_materialpropertyblock.ts +102 -11
- package/src/engine/engine_math.ts +34 -1
- package/src/engine/engine_networking.ts +1 -1
- package/src/engine/engine_types.ts +5 -0
- package/src/engine/webcomponents/icons.ts +3 -0
- package/src/engine/webcomponents/logo-element.ts +4 -1
- package/src/engine/webcomponents/needle-button.ts +44 -13
- package/src/engine/webcomponents/needle-engine.ts +18 -7
- package/src/engine-components/Component.ts +1 -3
- package/src/engine-components/DragControls.ts +29 -4
- package/src/engine-components/NeedleMenu.ts +5 -3
- package/src/engine-components/Networking.ts +29 -4
- package/src/engine-components/ReflectionProbe.ts +21 -2
- package/src/engine-components/export/usdz/extensions/behavior/BehaviourComponents.ts +198 -65
- package/src/engine-components/ui/Button.ts +12 -0
- package/src/engine-components/ui/Text.ts +13 -0
package/dist/needle-engine.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerM
|
|
|
111
111
|
import { XRHandMeshModel } from 'three/examples/jsm/webxr/XRHandMeshModel.js';
|
|
112
112
|
import { XRHandSpace } from 'three';
|
|
113
113
|
|
|
114
|
-
declare const $componentName: unique symbol;
|
|
114
|
+
export declare const $componentName: unique symbol;
|
|
115
115
|
|
|
116
116
|
export declare const $physicsKey: unique symbol;
|
|
117
117
|
|
|
@@ -120,6 +120,81 @@ export declare class __Ignore {
|
|
|
120
120
|
|
|
121
121
|
export declare function __internalNotifyObjectDestroyed(obj: Object3D): void;
|
|
122
122
|
|
|
123
|
+
/** Data describing the accessible semantics for a 3D object or component. */
|
|
124
|
+
declare type AccessibilityData = {
|
|
125
|
+
/** ARIA role (e.g. `"button"`, `"img"`, `"region"`). */
|
|
126
|
+
role: string;
|
|
127
|
+
/** Human-readable label announced by screen readers. */
|
|
128
|
+
label: string;
|
|
129
|
+
/** When `true`, the element is hidden from the accessibility tree. */
|
|
130
|
+
hidden?: boolean;
|
|
131
|
+
/** When `true`, indicates the element's content is being updated. */
|
|
132
|
+
busy?: boolean;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Manages an accessible, screen-reader-friendly overlay for a Needle Engine {@link Context}.
|
|
137
|
+
*
|
|
138
|
+
* The manager maintains a visually-hidden DOM tree that mirrors relevant 3D scene objects
|
|
139
|
+
* with appropriate ARIA roles and labels. It also provides a live region so that hover
|
|
140
|
+
* events in the 3D scene can be announced to assistive technology without stealing focus.
|
|
141
|
+
*
|
|
142
|
+
* ## Automatic integration
|
|
143
|
+
* Several built-in components register accessible elements automatically:
|
|
144
|
+
* - {@link DragControls} — announces draggable objects and drag state
|
|
145
|
+
* - {@link Button} — exposes UI buttons to the accessibility tree
|
|
146
|
+
* - {@link Text} — exposes UI text content to screen readers
|
|
147
|
+
* - {@link ChangeTransformOnClick} — announces clickable transform actions
|
|
148
|
+
* - {@link ChangeMaterialOnClick} — announces clickable material changes
|
|
149
|
+
* - {@link EmphasizeOnClick} — announces clickable emphasis effects
|
|
150
|
+
* - {@link PlayAudioOnClick} — announces clickable audio playback
|
|
151
|
+
* - {@link PlayAnimationOnClick} — announces clickable animation triggers
|
|
152
|
+
*
|
|
153
|
+
* ## What this unlocks
|
|
154
|
+
* - Hovering over buttons and interactive objects with the cursor announces them to screen readers via an ARIA live region — no focus steal required
|
|
155
|
+
* - Screen readers can discover and navigate interactive 3D objects in the scene
|
|
156
|
+
* - Drag operations update the accessibility state (busy, label changes) in real time
|
|
157
|
+
* - Custom components can participate by calling {@link updateElement}, {@link focus}, and {@link hover}
|
|
158
|
+
*
|
|
159
|
+
* Access the manager via `this.context.accessibility` from any component.
|
|
160
|
+
*/
|
|
161
|
+
declare class AccessibilityManager {
|
|
162
|
+
private readonly context;
|
|
163
|
+
private static readonly _managers;
|
|
164
|
+
/** Returns the {@link AccessibilityManager} associated with the given context or component. */
|
|
165
|
+
static get(obj: Context | IComponent): AccessibilityManager | undefined;
|
|
166
|
+
constructor(context: Context);
|
|
167
|
+
private _enabled;
|
|
168
|
+
/** Enables or disables the accessibility overlay. When disabled, the overlay DOM is removed. */
|
|
169
|
+
set enabled(value: boolean);
|
|
170
|
+
/** Removes all tracked accessibility elements, keeping only the live region. */
|
|
171
|
+
clear(): void;
|
|
172
|
+
/** Removes the overlay from the DOM and unregisters this manager from the context. */
|
|
173
|
+
dispose(): void;
|
|
174
|
+
private readonly root;
|
|
175
|
+
private readonly liveRegion;
|
|
176
|
+
private readonly treeElements;
|
|
177
|
+
/**
|
|
178
|
+
* Creates or updates the accessible DOM element for a 3D object or component.
|
|
179
|
+
* @param obj - The scene object or component to represent.
|
|
180
|
+
* @param data - Partial accessibility data (role, label, hidden, busy) to apply.
|
|
181
|
+
*/
|
|
182
|
+
updateElement<T extends Object3D | IComponent>(obj: T, data: Partial<AccessibilityData>): void;
|
|
183
|
+
/** Moves keyboard focus to the accessible element representing the given object. */
|
|
184
|
+
focus<T extends Object3D | IComponent>(obj: T): void;
|
|
185
|
+
/** Removes keyboard focus from the accessible element representing the given object. */
|
|
186
|
+
unfocus<T extends Object3D | IComponent>(obj: T): void;
|
|
187
|
+
/**
|
|
188
|
+
* Announces a hover event to screen readers via the ARIA live region.
|
|
189
|
+
* @param obj - The hovered object (used to look up its label if `text` is not provided).
|
|
190
|
+
* @param text - Optional text to announce. Falls back to the element's `aria-label`.
|
|
191
|
+
*/
|
|
192
|
+
hover<T extends Object3D | IComponent>(obj: T, text?: string): void;
|
|
193
|
+
/** Removes the accessible DOM element for the given object and stops tracking it. */
|
|
194
|
+
removeElement(obj: Object3D | IComponent): void;
|
|
195
|
+
private set liveRegionMode(value);
|
|
196
|
+
}
|
|
197
|
+
|
|
123
198
|
export declare class ActionBuilder {
|
|
124
199
|
static sequence(...params: IBehaviorElement[]): GroupActionModel;
|
|
125
200
|
static parallel(...params: IBehaviorElement[]): GroupActionModel;
|
|
@@ -193,7 +268,7 @@ export declare function addComponent<T extends IComponent>(obj: Object3D, compon
|
|
|
193
268
|
/** Register callbacks for registering custom gltf importer or exporter plugins */
|
|
194
269
|
export declare function addCustomExtensionPlugin(ext: INeedleGLTFExtensionPlugin): void;
|
|
195
270
|
|
|
196
|
-
export declare function addNewComponent<T extends IComponent>(obj: Object3D, componentInstance: T, callAwake?: boolean
|
|
271
|
+
export declare function addNewComponent<T extends IComponent>(obj: Object3D, componentInstance: T, callAwake?: boolean): T;
|
|
197
272
|
|
|
198
273
|
/**
|
|
199
274
|
* Use patcher for patching properties insteadof calling Object.defineProperty individually
|
|
@@ -2267,6 +2342,7 @@ export declare class Button extends Component implements IPointerEventHandler {
|
|
|
2267
2342
|
awake(): void;
|
|
2268
2343
|
start(): void;
|
|
2269
2344
|
onEnable(): void;
|
|
2345
|
+
onDisable(): void;
|
|
2270
2346
|
onDestroy(): void;
|
|
2271
2347
|
private _requestedAnimatorTrigger?;
|
|
2272
2348
|
private setAnimatorTriggerAtEndOfFrame;
|
|
@@ -2815,7 +2891,15 @@ export declare class CapsuleCollider extends Collider {
|
|
|
2815
2891
|
}
|
|
2816
2892
|
|
|
2817
2893
|
/**
|
|
2818
|
-
*
|
|
2894
|
+
* Switches the material of objects in the scene when clicked.
|
|
2895
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
2896
|
+
*
|
|
2897
|
+
* Finds all objects in the scene that use `materialToSwitch` and replaces it with `variantMaterial`.
|
|
2898
|
+
* Multiple `ChangeMaterialOnClick` components using the same `materialToSwitch` can be combined to create a material selection UI.
|
|
2899
|
+
*
|
|
2900
|
+
* @see {@link SetActiveOnClick} to toggle visibility of objects when clicked
|
|
2901
|
+
* @see {@link PlayAnimationOnClick} to play animations when clicked
|
|
2902
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
2819
2903
|
* @summary Changes the material of objects when clicked
|
|
2820
2904
|
* @category Everywhere Actions
|
|
2821
2905
|
* @group Components
|
|
@@ -2835,6 +2919,9 @@ export declare class ChangeMaterialOnClick extends Component implements IPointer
|
|
|
2835
2919
|
*/
|
|
2836
2920
|
fadeDuration: number;
|
|
2837
2921
|
start(): void;
|
|
2922
|
+
onEnable(): void;
|
|
2923
|
+
onDisable(): void;
|
|
2924
|
+
onDestroy(): void;
|
|
2838
2925
|
onPointerEnter(_args: PointerEventData): void;
|
|
2839
2926
|
onPointerExit(_: PointerEventData): void;
|
|
2840
2927
|
onPointerClick(args: PointerEventData): void;
|
|
@@ -2856,21 +2943,32 @@ export declare class ChangeMaterialOnClick extends Component implements IPointer
|
|
|
2856
2943
|
}
|
|
2857
2944
|
|
|
2858
2945
|
/**
|
|
2859
|
-
*
|
|
2946
|
+
* Moves an object to the target object's transform when clicked.
|
|
2947
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
2948
|
+
*
|
|
2949
|
+
* @see {@link SetActiveOnClick}to toggle visibility of objects when clicked
|
|
2950
|
+
* @see {@link PlayAnimationOnClick} to play animations when clicked
|
|
2951
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
2860
2952
|
* @summary Moves an object to a target transform upon click
|
|
2861
2953
|
* @category Everywhere Actions
|
|
2862
2954
|
* @group Components
|
|
2863
2955
|
*/
|
|
2864
2956
|
export declare class ChangeTransformOnClick extends Component implements IPointerClickHandler, UsdzBehaviour {
|
|
2957
|
+
/** The object to move. */
|
|
2865
2958
|
object?: Object3D;
|
|
2959
|
+
/** The target object whose transform to move to. */
|
|
2866
2960
|
target?: Object3D;
|
|
2961
|
+
/** The duration of the movement animation in seconds. */
|
|
2867
2962
|
duration: number;
|
|
2963
|
+
/** If true, the motion is relative to the object's current transform instead of moving to the target's absolute position. */
|
|
2868
2964
|
relativeMotion: boolean;
|
|
2869
2965
|
private coroutine;
|
|
2870
2966
|
private targetPos;
|
|
2871
2967
|
private targetRot;
|
|
2872
2968
|
private targetScale;
|
|
2873
|
-
|
|
2969
|
+
onEnable(): void;
|
|
2970
|
+
onDisable(): void;
|
|
2971
|
+
onDestroy(): void;
|
|
2874
2972
|
onPointerEnter(): void;
|
|
2875
2973
|
onPointerExit(): void;
|
|
2876
2974
|
onPointerClick(args: PointerEventData): void;
|
|
@@ -4276,6 +4374,7 @@ export declare class Context implements IContext {
|
|
|
4276
4374
|
readonly lodsManager: LODsManager;
|
|
4277
4375
|
/** Access the needle menu to add or remove buttons to the menu element */
|
|
4278
4376
|
readonly menu: NeedleMenu_2;
|
|
4377
|
+
readonly accessibility: AccessibilityManager;
|
|
4279
4378
|
/**
|
|
4280
4379
|
* Checks if the context is fully created and ready
|
|
4281
4380
|
* @returns true if the context is fully created and ready
|
|
@@ -4324,18 +4423,6 @@ export declare class Context implements IContext {
|
|
|
4324
4423
|
* Update the camera aspect ratio or orthorgraphic camera size. This is automatically called when a DOM size change is detected.
|
|
4325
4424
|
*/
|
|
4326
4425
|
updateAspect(camera: PerspectiveCamera | OrthographicCamera, width?: number, height?: number): void;
|
|
4327
|
-
/**
|
|
4328
|
-
* Registers all uninitialized components found in the scene hierarchy with this context.
|
|
4329
|
-
* Components that have been added to objects (e.g. via `addComponent`) but are not yet registered
|
|
4330
|
-
* with a context will be collected and queued for initialization.
|
|
4331
|
-
* On the next frame, these components will go through the full lifecycle: `awake` → `onEnable` → `start` → `update`.
|
|
4332
|
-
*
|
|
4333
|
-
* This is useful when components are created outside of the normal glTF loading pipeline,
|
|
4334
|
-
* for example in an editor that adds components during edit mode and then needs to activate them for play mode.
|
|
4335
|
-
* @param root The root object to search for components. Defaults to the context's scene.
|
|
4336
|
-
* @returns The number of components that were newly registered.
|
|
4337
|
-
*/
|
|
4338
|
-
registerSceneComponents(root?: Object3D): number;
|
|
4339
4426
|
/** This will recreate the whole needle engine context and dispose the whole scene content
|
|
4340
4427
|
* All content will be reloaded (loading times might be faster due to browser caches)
|
|
4341
4428
|
* All scripts will be recreated */
|
|
@@ -5278,6 +5365,7 @@ export declare class DragControls extends Component implements IPointerEventHand
|
|
|
5278
5365
|
/* Excluded from this release type: start */
|
|
5279
5366
|
/* Excluded from this release type: onEnable */
|
|
5280
5367
|
/* Excluded from this release type: onDisable */
|
|
5368
|
+
onDestroy(): void;
|
|
5281
5369
|
/**
|
|
5282
5370
|
* Checks if editing is allowed for the current networking connection.
|
|
5283
5371
|
* @param _obj Optional object to check edit permissions for
|
|
@@ -5650,15 +5738,28 @@ export declare class EmissionModule {
|
|
|
5650
5738
|
/* Excluded from this release type: EmphasizeActionMotionType */
|
|
5651
5739
|
|
|
5652
5740
|
/**
|
|
5653
|
-
*
|
|
5741
|
+
* Applies an emphasis animation to a target object when this object is clicked.
|
|
5742
|
+
* Works in USDZ/QuickLook (Everywhere Actions).
|
|
5743
|
+
*
|
|
5744
|
+
* The emphasis effect can be a bounce, jiggle, or other motion type defined by `motionType`.
|
|
5745
|
+
*
|
|
5746
|
+
* @see {@link PlayAnimationOnClick} to play animations when clicked
|
|
5747
|
+
* @see {@link SetActiveOnClick} to toggle visibility when clicked
|
|
5748
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
5654
5749
|
* @summary Emphasizes the target object when clicked
|
|
5655
5750
|
* @category Everywhere Actions
|
|
5656
5751
|
* @group Components
|
|
5657
5752
|
*/
|
|
5658
5753
|
export declare class EmphasizeOnClick extends Component implements UsdzBehaviour {
|
|
5754
|
+
/** The target object to emphasize. */
|
|
5659
5755
|
target?: Object3D;
|
|
5756
|
+
/** The duration of the emphasis animation in seconds. */
|
|
5660
5757
|
duration: number;
|
|
5758
|
+
/** The type of motion to use for the emphasis effect (e.g. `"bounce"`, `"jiggle"`). */
|
|
5661
5759
|
motionType: EmphasizeActionMotionType;
|
|
5760
|
+
onEnable(): void;
|
|
5761
|
+
onDisable(): void;
|
|
5762
|
+
onDestroy(): void;
|
|
5662
5763
|
beforeCreateDocument(): void;
|
|
5663
5764
|
createBehaviours(ext: any, model: any, _context: any): void;
|
|
5664
5765
|
afterCreateDocument(_ext: any, _context: any): void;
|
|
@@ -7410,7 +7511,13 @@ export declare enum HideFlags {
|
|
|
7410
7511
|
}
|
|
7411
7512
|
|
|
7412
7513
|
/**
|
|
7413
|
-
* Hides the object
|
|
7514
|
+
* Hides the object when the scene starts.
|
|
7515
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
7516
|
+
*
|
|
7517
|
+
* Useful for setting up objects that should initially be hidden and shown later via a {@link SetActiveOnClick} component.
|
|
7518
|
+
*
|
|
7519
|
+
* @see {@link SetActiveOnClick} to show or hide objects on click
|
|
7520
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
7414
7521
|
* @summary Hides the object on scene start
|
|
7415
7522
|
* @category Everywhere Actions
|
|
7416
7523
|
* @group Components
|
|
@@ -7756,6 +7863,7 @@ export declare type ICollisionContext = {
|
|
|
7756
7863
|
|
|
7757
7864
|
export declare interface IComponent extends IHasGuid {
|
|
7758
7865
|
get isComponent(): boolean;
|
|
7866
|
+
get [$componentName](): string | undefined;
|
|
7759
7867
|
/** the object this component is attached to */
|
|
7760
7868
|
gameObject: IGameObject;
|
|
7761
7869
|
enabled: boolean;
|
|
@@ -10073,13 +10181,22 @@ export declare class MaskableGraphic extends Graphic {
|
|
|
10073
10181
|
* This is useful for rendering multiple objects with the same base material but different properties
|
|
10074
10182
|
* (e.g., different colors, textures, or shader parameters).
|
|
10075
10183
|
*
|
|
10184
|
+
* ## How Property Blocks Work
|
|
10185
|
+
*
|
|
10186
|
+
* **Important**: Overrides are registered on the **Object3D**, not on the material.
|
|
10187
|
+
* This means:
|
|
10188
|
+
* - If you change the object's material, the overrides will still be applied to the new material
|
|
10189
|
+
* - Multiple objects can share the same material but have different property overrides
|
|
10190
|
+
* - If you don't want overrides applied after changing a material, you must remove them using {@link removeOveride}, {@link clearAllOverrides}, or {@link dispose}
|
|
10191
|
+
*
|
|
10076
10192
|
* The property block system works by:
|
|
10077
10193
|
* - Temporarily applying overrides in onBeforeRender
|
|
10078
10194
|
* - Restoring original values in onAfterRender
|
|
10079
10195
|
* - Managing shader defines and program cache keys for correct shader compilation
|
|
10080
10196
|
* - Supporting texture coordinate transforms per object
|
|
10081
10197
|
*
|
|
10082
|
-
* Common
|
|
10198
|
+
* ## Common Use Cases
|
|
10199
|
+
*
|
|
10083
10200
|
* - **Lightmaps**: Apply unique lightmap textures to individual objects sharing the same material
|
|
10084
10201
|
* - **Reflection Probes**: Apply different environment maps per object for localized reflections
|
|
10085
10202
|
* - **See-through effects**: Temporarily override transparency/transmission properties for X-ray effects
|
|
@@ -10117,6 +10234,26 @@ export declare class MaskableGraphic extends Graphic {
|
|
|
10117
10234
|
* block.setDefine("USE_CUSTOM_FEATURE", 1);
|
|
10118
10235
|
* ```
|
|
10119
10236
|
*
|
|
10237
|
+
* @example Material swapping behavior
|
|
10238
|
+
* ```typescript
|
|
10239
|
+
* const mesh = new Mesh(geometry, materialA);
|
|
10240
|
+
* const block = MaterialPropertyBlock.get(mesh);
|
|
10241
|
+
* block.setOverride("color", new Color(1, 0, 0));
|
|
10242
|
+
*
|
|
10243
|
+
* // The color override is red for materialA
|
|
10244
|
+
*
|
|
10245
|
+
* // Swap the material - overrides persist and apply to the new material!
|
|
10246
|
+
* mesh.material = materialB;
|
|
10247
|
+
* // The color override is now red for materialB too
|
|
10248
|
+
*
|
|
10249
|
+
* // If you don't want overrides on the new material, remove them:
|
|
10250
|
+
* block.clearAllOverrides(); // Remove all overrides
|
|
10251
|
+
* // or
|
|
10252
|
+
* block.removeOveride("color"); // Remove specific override
|
|
10253
|
+
* // or
|
|
10254
|
+
* block.dispose(); // Remove the entire property block
|
|
10255
|
+
* ```
|
|
10256
|
+
*
|
|
10120
10257
|
* @example Lightmap usage
|
|
10121
10258
|
* ```typescript
|
|
10122
10259
|
* const block = MaterialPropertyBlock.get(mesh);
|
|
@@ -10224,12 +10361,69 @@ export declare class MaterialPropertyBlock<T extends Material = Material> {
|
|
|
10224
10361
|
getOverride<K extends NonFunctionPropertyNames<T>>(name: K): PropertyBlockOverride<T[K] & MaterialPropertyType> | undefined;
|
|
10225
10362
|
getOverride<V extends MaterialPropertyType = MaterialPropertyType>(name: string): PropertyBlockOverride<V> | undefined;
|
|
10226
10363
|
/**
|
|
10227
|
-
* Removes a specific property override
|
|
10228
|
-
*
|
|
10364
|
+
* Removes a specific property override.
|
|
10365
|
+
* After removal, the material will use its original property value for this property.
|
|
10366
|
+
*
|
|
10367
|
+
* @param name The property name to remove the override for
|
|
10368
|
+
*
|
|
10369
|
+
* @example
|
|
10370
|
+
* ```typescript
|
|
10371
|
+
* const block = MaterialPropertyBlock.get(mesh);
|
|
10372
|
+
*
|
|
10373
|
+
* // Set some overrides
|
|
10374
|
+
* block.setOverride("color", new Color(1, 0, 0));
|
|
10375
|
+
* block.setOverride("roughness", 0.5);
|
|
10376
|
+
* block.setOverride("lightMap", lightmapTexture);
|
|
10377
|
+
*
|
|
10378
|
+
* // Remove a specific override - the material will now use its original color
|
|
10379
|
+
* block.removeOveride("color");
|
|
10380
|
+
*
|
|
10381
|
+
* // Other overrides (roughness, lightMap) remain active
|
|
10382
|
+
* ```
|
|
10229
10383
|
*/
|
|
10230
10384
|
removeOveride<K extends NonFunctionPropertyNames<T>>(name: K | ({} & string)): void;
|
|
10231
10385
|
/**
|
|
10232
|
-
* Removes all property overrides from this block
|
|
10386
|
+
* Removes all property overrides from this block.
|
|
10387
|
+
* After calling this, the material will use its original values for all properties.
|
|
10388
|
+
*
|
|
10389
|
+
* **Note**: This does NOT remove shader defines. Use {@link clearDefine} or {@link dispose} for that.
|
|
10390
|
+
*
|
|
10391
|
+
* @example Remove all overrides but keep the property block
|
|
10392
|
+
* ```typescript
|
|
10393
|
+
* const block = MaterialPropertyBlock.get(mesh);
|
|
10394
|
+
*
|
|
10395
|
+
* // Set multiple overrides
|
|
10396
|
+
* block.setOverride("color", new Color(1, 0, 0));
|
|
10397
|
+
* block.setOverride("roughness", 0.5);
|
|
10398
|
+
* block.setOverride("lightMap", lightmapTexture);
|
|
10399
|
+
*
|
|
10400
|
+
* // Later, remove all overrides at once
|
|
10401
|
+
* block.clearAllOverrides();
|
|
10402
|
+
*
|
|
10403
|
+
* // The material now uses its original values
|
|
10404
|
+
* // The property block still exists and can be reused with new overrides
|
|
10405
|
+
* ```
|
|
10406
|
+
*
|
|
10407
|
+
* @example Temporarily disable all overrides
|
|
10408
|
+
* ```typescript
|
|
10409
|
+
* const block = MaterialPropertyBlock.get(mesh);
|
|
10410
|
+
*
|
|
10411
|
+
* // Save current overrides if you want to restore them later
|
|
10412
|
+
* const savedOverrides = [...block.overrides];
|
|
10413
|
+
*
|
|
10414
|
+
* // Clear all overrides temporarily
|
|
10415
|
+
* block.clearAllOverrides();
|
|
10416
|
+
*
|
|
10417
|
+
* // Do some rendering without overrides...
|
|
10418
|
+
*
|
|
10419
|
+
* // Restore overrides
|
|
10420
|
+
* savedOverrides.forEach(override => {
|
|
10421
|
+
* block.setOverride(override.name, override.value, override.textureTransform);
|
|
10422
|
+
* });
|
|
10423
|
+
* ```
|
|
10424
|
+
*
|
|
10425
|
+
* @see {@link removeOveride} - To remove a single override
|
|
10426
|
+
* @see {@link dispose} - To completely remove the property block and clean up resources
|
|
10233
10427
|
*/
|
|
10234
10428
|
clearAllOverrides(): void;
|
|
10235
10429
|
/**
|
|
@@ -10630,32 +10824,58 @@ export declare namespace NEEDLE_ENGINE_MODULES {
|
|
|
10630
10824
|
export { NEEDLE_progressive }
|
|
10631
10825
|
|
|
10632
10826
|
/**
|
|
10633
|
-
*
|
|
10634
|
-
*
|
|
10827
|
+
* [<needle-button>](https://engine.needle.tools/docs/api/NeedleButtonElement) is a web component for easily adding AR, VR, Quicklook, or QR code buttons to your website without writing JavaScript code.
|
|
10828
|
+
*
|
|
10829
|
+
* The button automatically handles session management and displays appropriate UI based on device capabilities.
|
|
10830
|
+
* It comes with default styling (glassmorphism design) but can be fully customized with CSS.
|
|
10831
|
+
*
|
|
10832
|
+
* **Supported button types:**
|
|
10833
|
+
* - `ar` - WebXR AR session button
|
|
10834
|
+
* - `vr` - WebXR VR session button
|
|
10835
|
+
* - `quicklook` - Apple AR Quick Look button (iOS only)
|
|
10836
|
+
* - `qrcode` - QR code sharing button
|
|
10837
|
+
*
|
|
10838
|
+
* @example Basic AR/VR buttons
|
|
10635
10839
|
* ```html
|
|
10840
|
+
* <needle-engine src="scene.glb"></needle-engine>
|
|
10636
10841
|
* <needle-button ar></needle-button>
|
|
10637
10842
|
* <needle-button vr></needle-button>
|
|
10638
10843
|
* <needle-button quicklook></needle-button>
|
|
10639
10844
|
* ```
|
|
10640
10845
|
*
|
|
10641
|
-
* @example
|
|
10846
|
+
* @example Custom button labels
|
|
10642
10847
|
* ```html
|
|
10643
|
-
* <needle-button ar>Start AR</needle-button>
|
|
10644
|
-
* <needle-button vr>
|
|
10848
|
+
* <needle-button ar>Start AR Experience</needle-button>
|
|
10849
|
+
* <needle-button vr>Enter VR Mode</needle-button>
|
|
10645
10850
|
* <needle-button quicklook>View in AR</needle-button>
|
|
10646
10851
|
* ```
|
|
10647
10852
|
*
|
|
10648
|
-
* @example
|
|
10853
|
+
* @example Custom styling
|
|
10649
10854
|
* ```html
|
|
10650
|
-
* <!-- You can either style the element directly or use a CSS stylesheet -->
|
|
10651
10855
|
* <style>
|
|
10652
|
-
*
|
|
10653
|
-
*
|
|
10654
|
-
*
|
|
10655
|
-
*
|
|
10856
|
+
* needle-button {
|
|
10857
|
+
* background-color: #ff6b6b;
|
|
10858
|
+
* color: white;
|
|
10859
|
+
* border-radius: 8px;
|
|
10860
|
+
* padding: 1rem 2rem;
|
|
10861
|
+
* }
|
|
10862
|
+
* needle-button:hover {
|
|
10863
|
+
* background-color: #ff5252;
|
|
10864
|
+
* }
|
|
10656
10865
|
* </style>
|
|
10657
10866
|
* <needle-button ar>Start AR</needle-button>
|
|
10658
10867
|
* ```
|
|
10868
|
+
*
|
|
10869
|
+
* @example Unstyled button (for complete custom styling)
|
|
10870
|
+
* ```html
|
|
10871
|
+
* <needle-button ar unstyled>
|
|
10872
|
+
* <span class="my-icon">🥽</span>
|
|
10873
|
+
* Launch AR
|
|
10874
|
+
* </needle-button>
|
|
10875
|
+
* ```
|
|
10876
|
+
*
|
|
10877
|
+
* @see {@link NeedleEngineWebComponent} for the main <needle-engine> element
|
|
10878
|
+
* @see {@link NeedleMenu} for the built-in menu component that can display similar buttons
|
|
10659
10879
|
*/
|
|
10660
10880
|
export declare class NeedleButtonElement extends HTMLElement {
|
|
10661
10881
|
#private;
|
|
@@ -10732,10 +10952,18 @@ export declare namespace NeedleEngineModelLoader {
|
|
|
10732
10952
|
* The context is accessible from the `<needle-engine>` element: `document.querySelector("needle-engine").context`.
|
|
10733
10953
|
* See {@link https://engine.needle.tools/docs/reference/needle-engine-attributes}
|
|
10734
10954
|
*
|
|
10735
|
-
* @example
|
|
10955
|
+
* @example Basic usage
|
|
10956
|
+
* ```html
|
|
10736
10957
|
* <needle-engine src="https://example.com/scene.glb"></needle-engine>
|
|
10737
|
-
*
|
|
10958
|
+
* ```
|
|
10959
|
+
*
|
|
10960
|
+
* @example With camera controls disabled
|
|
10961
|
+
* ```html
|
|
10738
10962
|
* <needle-engine src="https://example.com/scene.glb" camera-controls="false"></needle-engine>
|
|
10963
|
+
* ```
|
|
10964
|
+
*
|
|
10965
|
+
* @see {@link NeedleButtonElement} for adding AR/VR/Quicklook buttons via <needle-button>
|
|
10966
|
+
* @see {@link NeedleMenu} for the built-in menu configuration component
|
|
10739
10967
|
*/
|
|
10740
10968
|
export declare class NeedleEngineWebComponent extends HTMLElement implements INeedleEngineComponent {
|
|
10741
10969
|
static get observedAttributes(): string[];
|
|
@@ -11062,6 +11290,8 @@ declare class NeedleGamepadButton {
|
|
|
11062
11290
|
* @category User Interface
|
|
11063
11291
|
* @group Components
|
|
11064
11292
|
* @see {@link Context.menu} for programmatic menu control
|
|
11293
|
+
* @see {@link NeedleButtonElement} for standalone <needle-button> web component
|
|
11294
|
+
* @see {@link NeedleEngineWebComponent} for the main <needle-engine> element
|
|
11065
11295
|
* @see {@link Voip} adds a microphone button to the menu
|
|
11066
11296
|
* @see {@link ScreenCapture} adds a screen sharing button
|
|
11067
11297
|
**/
|
|
@@ -12283,10 +12513,34 @@ export declare class NetworkedStreams extends EventDispatcher<any> {
|
|
|
12283
12513
|
}
|
|
12284
12514
|
|
|
12285
12515
|
/**
|
|
12286
|
-
* Provides configuration
|
|
12287
|
-
*
|
|
12288
|
-
* It implements the {@link INetworkingWebsocketUrlProvider} interface.
|
|
12516
|
+
* Provides websocket URL configuration for the built-in networking system.
|
|
12517
|
+
* Add this component to override the default networking backend URL used by {@link NetworkConnection} (`this.context.connection`).
|
|
12289
12518
|
*
|
|
12519
|
+
* The component registers itself as a URL provider on `awake()`. When the networking system connects,
|
|
12520
|
+
* it queries this provider for the websocket URL to use instead of the default Needle networking backend.
|
|
12521
|
+
*
|
|
12522
|
+
* **URL resolution order:**
|
|
12523
|
+
* 1. If `urlParameterName` is set and the corresponding URL parameter exists in the browser URL, that value is used
|
|
12524
|
+
* 2. If running on a local network and `localhost` is set, the `localhost` URL is used
|
|
12525
|
+
* 3. Otherwise, the `url` field is used
|
|
12526
|
+
*
|
|
12527
|
+
* Without this component, the default backend URL `wss://networking-2.needle.tools/socket` is used.
|
|
12528
|
+
*
|
|
12529
|
+
* **Note:** This component only configures the websocket URL. To actually join a networked room,
|
|
12530
|
+
* use a `SyncedRoom` component or call `this.context.connection.joinRoom("room-name")` directly.
|
|
12531
|
+
*
|
|
12532
|
+
* @example Overriding the URL via browser parameter
|
|
12533
|
+
* ```ts
|
|
12534
|
+
* // With urlParameterName="server", visiting:
|
|
12535
|
+
* // https://myapp.com/?server=wss://my-server.com/socket
|
|
12536
|
+
* // will connect to that server instead
|
|
12537
|
+
* ```
|
|
12538
|
+
*
|
|
12539
|
+
* @see {@link NetworkConnection} for the main networking API (`this.context.connection`)
|
|
12540
|
+
* @see {@link SyncedRoom} for automatic room joining
|
|
12541
|
+
* @see {@link OwnershipModel} for networked object ownership
|
|
12542
|
+
* @see {@link RoomEvents} for room lifecycle events
|
|
12543
|
+
* @link https://engine.needle.tools/docs/how-to-guides/networking/
|
|
12290
12544
|
* @summary Networking configuration
|
|
12291
12545
|
* @category Networking
|
|
12292
12546
|
* @group Components
|
|
@@ -12295,6 +12549,7 @@ export declare class Networking extends Component implements INetworkingWebsocke
|
|
|
12295
12549
|
/**
|
|
12296
12550
|
* The websocket URL to connect to for networking functionality.
|
|
12297
12551
|
* Can be a complete URL or a relative path that will be resolved against the current origin.
|
|
12552
|
+
* @default null
|
|
12298
12553
|
*/
|
|
12299
12554
|
url: string | null;
|
|
12300
12555
|
/**
|
|
@@ -12668,7 +12923,40 @@ export declare function onClear(cb: LifecycleMethod, opts?: LifecycleMethodOptio
|
|
|
12668
12923
|
export declare function onDestroy(cb: LifecycleMethod, opts?: LifecycleMethodOptions): () => void;
|
|
12669
12924
|
|
|
12670
12925
|
/**
|
|
12671
|
-
* OneEuroFilter is a
|
|
12926
|
+
* [OneEuroFilter](https://engine.needle.tools/docs/api/OneEuroFilter) is a low-pass filter designed to reduce jitter in noisy signals while maintaining low latency.
|
|
12927
|
+
* It's particularly useful for smoothing tracking data from XR controllers, hand tracking, or other input devices where the signal contains noise but responsiveness is important.
|
|
12928
|
+
*
|
|
12929
|
+
* The filter automatically adapts its smoothing strength based on the signal's velocity:
|
|
12930
|
+
* - When the signal moves slowly, it applies strong smoothing to reduce jitter
|
|
12931
|
+
* - When the signal moves quickly, it reduces smoothing to maintain responsiveness
|
|
12932
|
+
*
|
|
12933
|
+
* Based on the research paper: [1€ Filter: A Simple Speed-based Low-pass Filter for Noisy Input](http://cristal.univ-lille.fr/~casiez/1euro/)
|
|
12934
|
+
*
|
|
12935
|
+
* @example Basic usage with timestamp
|
|
12936
|
+
* ```ts
|
|
12937
|
+
* const filter = new OneEuroFilter(120, 1.0, 0.0);
|
|
12938
|
+
*
|
|
12939
|
+
* // In your update loop:
|
|
12940
|
+
* const smoothedValue = filter.filter(noisyValue, this.context.time.time);
|
|
12941
|
+
* ```
|
|
12942
|
+
*
|
|
12943
|
+
* @example Without timestamps (using frequency estimate)
|
|
12944
|
+
* ```ts
|
|
12945
|
+
* // Assuming 60 FPS update rate
|
|
12946
|
+
* const filter = new OneEuroFilter(60, 1.0, 0.5);
|
|
12947
|
+
*
|
|
12948
|
+
* // Call without timestamp - uses the frequency estimate
|
|
12949
|
+
* const smoothedValue = filter.filter(noisyValue);
|
|
12950
|
+
* ```
|
|
12951
|
+
*
|
|
12952
|
+
* @example Smoothing 3D positions
|
|
12953
|
+
* ```ts
|
|
12954
|
+
* const posFilter = new OneEuroFilterXYZ(90, 0.5, 0.0);
|
|
12955
|
+
*
|
|
12956
|
+
* posFilter.filter(trackedPosition, smoothedPosition, this.context.time.time);
|
|
12957
|
+
* ```
|
|
12958
|
+
*
|
|
12959
|
+
* @see {@link OneEuroFilterXYZ} for filtering 3D vectors
|
|
12672
12960
|
*/
|
|
12673
12961
|
export declare class OneEuroFilter {
|
|
12674
12962
|
/**
|
|
@@ -14154,18 +14442,34 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14154
14442
|
/* Excluded from this release type: PlayAction */
|
|
14155
14443
|
|
|
14156
14444
|
/**
|
|
14157
|
-
* Plays an animation when clicked.
|
|
14445
|
+
* Plays an animation state when this object is clicked.
|
|
14446
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
14447
|
+
*
|
|
14448
|
+
* Assign an {@link Animator} and a `stateName` to play a specific animation state,
|
|
14449
|
+
* or assign an {@link Animation} component to play a legacy animation clip.
|
|
14450
|
+
*
|
|
14451
|
+
* For USDZ export, the component follows animator state transitions automatically, including looping states.
|
|
14452
|
+
*
|
|
14453
|
+
* @see {@link Animator}for playing animator state machine animations
|
|
14454
|
+
* @see {@link Animation} for playing legacy animation clips
|
|
14455
|
+
* @see {@link PlayAudioOnClick} to play audio when clicked
|
|
14456
|
+
* @see {@link SetActiveOnClick} to toggle visibility when clicked
|
|
14457
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
14158
14458
|
* @summary Plays an animation when clicked
|
|
14159
14459
|
* @category Everywhere Actions
|
|
14160
14460
|
* @group Components
|
|
14161
14461
|
*/
|
|
14162
14462
|
export declare class PlayAnimationOnClick extends Component implements IPointerClickHandler, UsdzBehaviour, UsdzAnimation {
|
|
14463
|
+
/** The {@link Animator} component whose state to play when clicked. */
|
|
14163
14464
|
animator?: Animator;
|
|
14465
|
+
/** The name of the animation state to play. Required when using an {@link Animator}. */
|
|
14164
14466
|
stateName?: string;
|
|
14165
14467
|
trigger: "tap" | "start";
|
|
14166
14468
|
animation?: Animation_2;
|
|
14167
14469
|
private get target();
|
|
14168
|
-
|
|
14470
|
+
onEnable(): void;
|
|
14471
|
+
onDisable(): void;
|
|
14472
|
+
onDestroy(): void;
|
|
14169
14473
|
onPointerEnter(): void;
|
|
14170
14474
|
onPointerExit(): void;
|
|
14171
14475
|
onPointerClick(args: PointerEventData): void;
|
|
@@ -14189,18 +14493,32 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14189
14493
|
}
|
|
14190
14494
|
|
|
14191
14495
|
/**
|
|
14192
|
-
* Plays an audio clip when clicked.
|
|
14496
|
+
* Plays an audio clip when this object is clicked.
|
|
14497
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
14498
|
+
*
|
|
14499
|
+
* Assign a `target` {@link AudioSource} to use its spatial audio settings, or assign a `clip` URL directly.
|
|
14500
|
+
* If no `target` is assigned, an {@link AudioSource} will be created automatically on this object.
|
|
14501
|
+
*
|
|
14502
|
+
* @see {@link AudioSource}for spatial audio settings
|
|
14503
|
+
* @see {@link PlayAnimationOnClick} to play animations when clicked
|
|
14504
|
+
* @see {@link SetActiveOnClick} to toggle visibility when clicked
|
|
14505
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
14193
14506
|
* @summary Plays an audio clip when clicked
|
|
14194
14507
|
* @category Everywhere Actions
|
|
14195
14508
|
* @group Components
|
|
14196
14509
|
*/
|
|
14197
14510
|
export declare class PlayAudioOnClick extends Component implements IPointerClickHandler, UsdzBehaviour {
|
|
14511
|
+
/** The {@link AudioSource} to use for playback. If not set, one will be created automatically on this object. */
|
|
14198
14512
|
target?: AudioSource;
|
|
14513
|
+
/** URL of the audio clip to play. If not set, the clip assigned to `target` is used. */
|
|
14199
14514
|
clip: string;
|
|
14515
|
+
/** If true, clicking again while the audio is playing will stop it. */
|
|
14200
14516
|
toggleOnClick: boolean;
|
|
14201
14517
|
trigger: "tap" | "start";
|
|
14202
|
-
start(): void;
|
|
14203
14518
|
ensureAudioSource(): void;
|
|
14519
|
+
onEnable(): void;
|
|
14520
|
+
onDisable(): void;
|
|
14521
|
+
onDestroy(): void;
|
|
14204
14522
|
onPointerEnter(): void;
|
|
14205
14523
|
onPointerExit(): void;
|
|
14206
14524
|
onPointerClick(args: PointerEventData): void;
|
|
@@ -15331,6 +15649,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15331
15649
|
*/
|
|
15332
15650
|
static get(object: Object3D | null | undefined, context: Context, isAnchor: boolean, anchor?: Object3D): ReflectionProbe | null;
|
|
15333
15651
|
private _texture;
|
|
15652
|
+
private _textureUrlInFlight?;
|
|
15334
15653
|
set texture(tex: Texture);
|
|
15335
15654
|
get texture(): Texture;
|
|
15336
15655
|
intensity: number;
|
|
@@ -17315,17 +17634,28 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
17315
17634
|
export declare function setActive(go: Object3D, active: boolean | number): boolean;
|
|
17316
17635
|
|
|
17317
17636
|
/**
|
|
17318
|
-
*
|
|
17637
|
+
* Shows or hides a target object when this object is clicked.
|
|
17638
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
17639
|
+
*
|
|
17640
|
+
* Optionally hides itself after being clicked (`hideSelf`), or toggles the target's visibility on each click (`toggleOnClick`).
|
|
17641
|
+
*
|
|
17642
|
+
* @see {@link HideOnStart}to hide an object when the scene starts
|
|
17643
|
+
* @see {@link PlayAnimationOnClick} to play animations when clicked
|
|
17644
|
+
* @see {@link ChangeMaterialOnClick} to change material when clicked
|
|
17645
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
17319
17646
|
* @summary Sets the active state of an object when clicked
|
|
17320
17647
|
* @category Everywhere Actions
|
|
17321
17648
|
* @group Components
|
|
17322
17649
|
*/
|
|
17323
17650
|
export declare class SetActiveOnClick extends Component implements IPointerClickHandler, UsdzBehaviour {
|
|
17651
|
+
/** The target object to show or hide. */
|
|
17324
17652
|
target?: Object3D;
|
|
17653
|
+
/** If true, the target's visibility will be toggled on each click. When enabled, `hideSelf` and `targetState` are ignored. */
|
|
17325
17654
|
toggleOnClick: boolean;
|
|
17655
|
+
/** The visibility state to apply to the target when clicked. Only used when `toggleOnClick` is false. */
|
|
17326
17656
|
targetState: boolean;
|
|
17657
|
+
/** If true, this object will hide itself after being clicked. Only used when `toggleOnClick` is false. */
|
|
17327
17658
|
hideSelf: boolean;
|
|
17328
|
-
start(): void;
|
|
17329
17659
|
onPointerEnter(): void;
|
|
17330
17660
|
onPointerExit(): void;
|
|
17331
17661
|
onPointerClick(args: PointerEventData): void;
|
|
@@ -19305,7 +19635,12 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19305
19635
|
export declare type SyncInstantiateOptions = IInstantiateOptions & Pick<IModel, "deleteOnDisconnect">;
|
|
19306
19636
|
|
|
19307
19637
|
/**
|
|
19308
|
-
* Triggers
|
|
19638
|
+
* Triggers a {@link PreliminaryAction} (such as {@link VisibilityAction}) when the object is tapped or clicked.
|
|
19639
|
+
* Works in the browser and in USDZ/QuickLook (Everywhere Actions).
|
|
19640
|
+
*
|
|
19641
|
+
* @see {@link VisibilityAction} for controlling object visibility on tap
|
|
19642
|
+
* @see {@link SetActiveOnClick} for a combined trigger and action component
|
|
19643
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
19309
19644
|
* @summary Triggers an action when the object is tapped/clicked
|
|
19310
19645
|
* @category Everywhere Actions
|
|
19311
19646
|
* @group Components
|
|
@@ -19428,6 +19763,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19428
19763
|
private getTextOpts;
|
|
19429
19764
|
onEnable(): void;
|
|
19430
19765
|
onDisable(): void;
|
|
19766
|
+
onDestroy(): void;
|
|
19431
19767
|
private getAlignment;
|
|
19432
19768
|
private feedText;
|
|
19433
19769
|
private _didHandleTextRenderOnTop;
|
|
@@ -20944,13 +21280,20 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
20944
21280
|
}
|
|
20945
21281
|
|
|
20946
21282
|
/**
|
|
20947
|
-
*
|
|
21283
|
+
* Action to show or hide an object.
|
|
21284
|
+
* Use together with a {@link TapGestureTrigger} to show or hide objects when tapped or clicked.
|
|
21285
|
+
*
|
|
21286
|
+
* @see {@link TapGestureTrigger} to trigger actions on tap/click
|
|
21287
|
+
* @see {@link SetActiveOnClick} for a combined trigger and action component
|
|
21288
|
+
* @see [Everywhere Actions](https://engine.needle.tools/docs/everywhere-actions)
|
|
20948
21289
|
* @summary Hides or shows the object when clicked
|
|
20949
21290
|
* @category Everywhere Actions
|
|
20950
21291
|
* @group Components
|
|
20951
21292
|
*/
|
|
20952
21293
|
export declare class VisibilityAction extends PreliminaryAction {
|
|
21294
|
+
/** The type of visibility action to apply. */
|
|
20953
21295
|
type: VisibilityActionType;
|
|
21296
|
+
/** The duration of the fade animation in seconds. */
|
|
20954
21297
|
duration: number;
|
|
20955
21298
|
getType(): "show" | "hide";
|
|
20956
21299
|
getDuration(): number;
|
|
@@ -22401,45 +22744,6 @@ declare global {
|
|
|
22401
22744
|
}
|
|
22402
22745
|
}
|
|
22403
22746
|
|
|
22404
|
-
|
|
22405
|
-
declare module 'three/examples/jsm/controls/OrbitControls.js' {
|
|
22406
|
-
interface OrbitControls {
|
|
22407
|
-
_sphericalDelta: import("three").Spherical;
|
|
22408
|
-
_rotateLeft: (angleInRadians: number) => void;
|
|
22409
|
-
_rotateUp: (angleInRadians: number) => void;
|
|
22410
|
-
_pan: (dx: number, dy: number) => void;
|
|
22411
|
-
_dollyIn: (dollyScale: number) => void;
|
|
22412
|
-
_dollyOut: (dollyScale: number) => void;
|
|
22413
|
-
}
|
|
22414
|
-
interface OrbitControlsEventMap {
|
|
22415
|
-
endMovement: Event;
|
|
22416
|
-
}
|
|
22417
|
-
}
|
|
22418
|
-
|
|
22419
|
-
|
|
22420
|
-
declare global {
|
|
22421
|
-
interface ViewTimeline {
|
|
22422
|
-
axis: 'block' | 'inline';
|
|
22423
|
-
currentTime: {
|
|
22424
|
-
unit: 'seconds' | 'percent';
|
|
22425
|
-
value: number;
|
|
22426
|
-
};
|
|
22427
|
-
duration: {
|
|
22428
|
-
unit: 'seconds' | 'percent';
|
|
22429
|
-
value: number;
|
|
22430
|
-
};
|
|
22431
|
-
source: Element | null;
|
|
22432
|
-
startOffset: {
|
|
22433
|
-
unit: 'px';
|
|
22434
|
-
value: number;
|
|
22435
|
-
};
|
|
22436
|
-
endOffset: {
|
|
22437
|
-
unit: 'px';
|
|
22438
|
-
value: number;
|
|
22439
|
-
};
|
|
22440
|
-
}
|
|
22441
|
-
}
|
|
22442
|
-
|
|
22443
22747
|
export declare namespace NEEDLE_ENGINE_FEATURE_FLAGS {
|
|
22444
22748
|
let experimentalSmartHierarchyUpdate: boolean;
|
|
22445
22749
|
}
|
|
@@ -22578,6 +22882,45 @@ export declare namespace DeviceUtilities {
|
|
|
22578
22882
|
}
|
|
22579
22883
|
|
|
22580
22884
|
|
|
22885
|
+
declare module 'three/examples/jsm/controls/OrbitControls.js' {
|
|
22886
|
+
interface OrbitControls {
|
|
22887
|
+
_sphericalDelta: import("three").Spherical;
|
|
22888
|
+
_rotateLeft: (angleInRadians: number) => void;
|
|
22889
|
+
_rotateUp: (angleInRadians: number) => void;
|
|
22890
|
+
_pan: (dx: number, dy: number) => void;
|
|
22891
|
+
_dollyIn: (dollyScale: number) => void;
|
|
22892
|
+
_dollyOut: (dollyScale: number) => void;
|
|
22893
|
+
}
|
|
22894
|
+
interface OrbitControlsEventMap {
|
|
22895
|
+
endMovement: Event;
|
|
22896
|
+
}
|
|
22897
|
+
}
|
|
22898
|
+
|
|
22899
|
+
|
|
22900
|
+
declare global {
|
|
22901
|
+
interface ViewTimeline {
|
|
22902
|
+
axis: 'block' | 'inline';
|
|
22903
|
+
currentTime: {
|
|
22904
|
+
unit: 'seconds' | 'percent';
|
|
22905
|
+
value: number;
|
|
22906
|
+
};
|
|
22907
|
+
duration: {
|
|
22908
|
+
unit: 'seconds' | 'percent';
|
|
22909
|
+
value: number;
|
|
22910
|
+
};
|
|
22911
|
+
source: Element | null;
|
|
22912
|
+
startOffset: {
|
|
22913
|
+
unit: 'px';
|
|
22914
|
+
value: number;
|
|
22915
|
+
};
|
|
22916
|
+
endOffset: {
|
|
22917
|
+
unit: 'px';
|
|
22918
|
+
value: number;
|
|
22919
|
+
};
|
|
22920
|
+
}
|
|
22921
|
+
}
|
|
22922
|
+
|
|
22923
|
+
|
|
22581
22924
|
declare global {
|
|
22582
22925
|
interface Window {
|
|
22583
22926
|
SPECTOR?: {
|
|
@@ -22612,12 +22955,6 @@ export declare namespace MaterialX {
|
|
|
22612
22955
|
}): Promise<import("three").Material | null>;
|
|
22613
22956
|
}
|
|
22614
22957
|
|
|
22615
|
-
declare global {
|
|
22616
|
-
interface HTMLElementTagNameMap {
|
|
22617
|
-
"needle-button": NeedleButtonElement;
|
|
22618
|
-
}
|
|
22619
|
-
}
|
|
22620
|
-
|
|
22621
22958
|
/**
|
|
22622
22959
|
* @internal
|
|
22623
22960
|
*/
|
|
@@ -22667,20 +23004,10 @@ export declare namespace InternalAttributeUtils {
|
|
|
22667
23004
|
}): false | string | null;
|
|
22668
23005
|
}
|
|
22669
23006
|
|
|
22670
|
-
|
|
22671
|
-
|
|
22672
|
-
|
|
22673
|
-
|
|
22674
|
-
*/
|
|
22675
|
-
export declare namespace SplineUtils {
|
|
22676
|
-
/**
|
|
22677
|
-
* Creates a SplineContainer from an array of points.
|
|
22678
|
-
* @param positions The positions of the knots.
|
|
22679
|
-
* @param closed Whether the spline is closed (the last knot connects to the first).
|
|
22680
|
-
* @param tension The tension of the spline. 0 is no tension, 1 is high tension (straight lines between knots). Default is 0.75.
|
|
22681
|
-
* @return The created SplineContainer component - add it to an Object3D to use it.
|
|
22682
|
-
*/
|
|
22683
|
-
function createFromPoints(positions: Vector3[], closed?: boolean, tension?: number): SplineContainer;
|
|
23007
|
+
declare global {
|
|
23008
|
+
interface HTMLElementTagNameMap {
|
|
23009
|
+
"needle-button": NeedleButtonElement;
|
|
23010
|
+
}
|
|
22684
23011
|
}
|
|
22685
23012
|
|
|
22686
23013
|
|
|
@@ -22823,6 +23150,22 @@ declare module 'three' {
|
|
|
22823
23150
|
}
|
|
22824
23151
|
}
|
|
22825
23152
|
|
|
23153
|
+
|
|
23154
|
+
/**
|
|
23155
|
+
* @category Splines
|
|
23156
|
+
* @see {@link SplineContainer} for the main spline component that defines the path and knots
|
|
23157
|
+
*/
|
|
23158
|
+
export declare namespace SplineUtils {
|
|
23159
|
+
/**
|
|
23160
|
+
* Creates a SplineContainer from an array of points.
|
|
23161
|
+
* @param positions The positions of the knots.
|
|
23162
|
+
* @param closed Whether the spline is closed (the last knot connects to the first).
|
|
23163
|
+
* @param tension The tension of the spline. 0 is no tension, 1 is high tension (straight lines between knots). Default is 0.75.
|
|
23164
|
+
* @return The created SplineContainer component - add it to an Object3D to use it.
|
|
23165
|
+
*/
|
|
23166
|
+
function createFromPoints(positions: Vector3[], closed?: boolean, tension?: number): SplineContainer;
|
|
23167
|
+
}
|
|
23168
|
+
|
|
22826
23169
|
declare global {
|
|
22827
23170
|
interface HTMLElementTagNameMap {
|
|
22828
23171
|
"needle-logo-element": NeedleLogoElement;
|