@needle-tools/engine 5.1.8 → 5.1.9
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 +10 -0
- package/dist/{needle-engine.bundle-X7Y4A-EO.min.js → needle-engine.bundle-CHq9xqXv.min.js} +144 -144
- package/dist/{needle-engine.bundle-D8gP8Nd0.umd.cjs → needle-engine.bundle-DYPk7VZg.umd.cjs} +146 -146
- package/dist/{needle-engine.bundle-CaD5rOJ0.js → needle-engine.bundle-XZ6cKssu.js} +6086 -6052
- package/dist/needle-engine.d.ts +49 -25
- package/dist/needle-engine.js +251 -251
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/api.d.ts +1 -1
- package/lib/engine/api.js +1 -1
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_init.js +2 -2
- package/lib/engine/engine_init.js.map +1 -1
- package/lib/engine/engine_license.d.ts +7 -7
- package/lib/engine/engine_license.js +71 -71
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_networking_blob.js +3 -3
- package/lib/engine/engine_networking_blob.js.map +1 -1
- package/lib/engine/engine_utils_qrcode.js +2 -2
- package/lib/engine/engine_utils_qrcode.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
- package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
- package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
- package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js +11 -0
- package/lib/engine/webcomponents/needle-engine.ar-overlay.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.js +2 -2
- package/lib/engine/webcomponents/needle-engine.js.map +1 -1
- package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
- package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.d.ts +7 -2
- package/lib/engine/xr/NeedleXRSession.js +65 -5
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine/xr/TempXRContext.js +2 -2
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine-components/Component.d.ts +2 -1
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.d.ts +35 -18
- package/lib/engine-components/webxr/WebXRImageTracking.js +93 -78
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/lib/engine-components/webxr/WebXRImageTracking.utils.d.ts +35 -0
- package/lib/engine-components/webxr/WebXRImageTracking.utils.js +96 -0
- package/lib/engine-components/webxr/WebXRImageTracking.utils.js.map +1 -0
- package/package.json +1 -1
- package/plugins/common/license.js +4 -4
- package/plugins/vite/license.js +4 -4
- package/src/engine/api.ts +1 -1
- package/src/engine/engine_init.ts +2 -2
- package/src/engine/engine_license.ts +68 -68
- package/src/engine/engine_networking_blob.ts +3 -3
- package/src/engine/engine_utils_qrcode.ts +2 -2
- package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
- package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
- package/src/engine/webcomponents/needle-engine.ar-overlay.ts +13 -0
- package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine/xr/NeedleXRSession.ts +68 -8
- package/src/engine/xr/TempXRContext.ts +2 -2
- package/src/engine-components/Component.ts +2 -1
- package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
- package/src/engine-components/webxr/WebXRImageTracking.ts +120 -66
- package/src/engine-components/webxr/WebXRImageTracking.utils.ts +105 -0
package/dist/needle-engine.d.ts
CHANGED
|
@@ -116,15 +116,17 @@ import { XRHandSpace } from 'three';
|
|
|
116
116
|
|
|
117
117
|
export declare const $componentName: unique symbol;
|
|
118
118
|
|
|
119
|
+
/* Excluded from this release type: $iNNlsg */
|
|
120
|
+
|
|
119
121
|
export declare const $physicsKey: unique symbol;
|
|
120
122
|
|
|
123
|
+
/* Excluded from this release type: _$qxlHFE */
|
|
124
|
+
|
|
121
125
|
export declare class __Ignore {
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
export declare function __internalNotifyObjectDestroyed(obj: Object3D): void;
|
|
125
129
|
|
|
126
|
-
/* Excluded from this release type: __sKHtRdk */
|
|
127
|
-
|
|
128
130
|
/** Data describing the accessible semantics for a 3D object or component. */
|
|
129
131
|
declare type AccessibilityData = {
|
|
130
132
|
/** ARIA role (e.g. `"button"`, `"img"`, `"region"`). */
|
|
@@ -4119,8 +4121,9 @@ declare abstract class Component implements IComponent, EventTarget, Partial<INe
|
|
|
4119
4121
|
* Use to modify session initialization parameters
|
|
4120
4122
|
* @param mode The XR session mode being requested
|
|
4121
4123
|
* @param args The session initialization parameters that can be modified
|
|
4124
|
+
* @returns void, or a promise that is awaited before the session is requested (e.g. to load assets)
|
|
4122
4125
|
*/
|
|
4123
|
-
onBeforeXR?(mode: XRSessionMode, args: XRSessionInit): void
|
|
4126
|
+
onBeforeXR?(mode: XRSessionMode, args: XRSessionInit): void | Promise<void>;
|
|
4124
4127
|
/**
|
|
4125
4128
|
* Called when this component joins an XR session or becomes active in a running session
|
|
4126
4129
|
* @param args Event data for the XR session
|
|
@@ -9052,8 +9055,8 @@ export declare type INeedleXRSession = NeedleXRSession;
|
|
|
9052
9055
|
export declare interface INeedleXRSessionEventReceiver extends Pick<IComponent, "destroyed"> {
|
|
9053
9056
|
get activeAndEnabled(): boolean;
|
|
9054
9057
|
supportsXR?(mode: XRSessionMode): boolean;
|
|
9055
|
-
/** Called before requesting a XR session */
|
|
9056
|
-
onBeforeXR?(mode: XRSessionMode, args: XRSessionInit): void
|
|
9058
|
+
/** Called before requesting a XR session. May return a promise that is awaited before requesting. */
|
|
9059
|
+
onBeforeXR?(mode: XRSessionMode, args: XRSessionInit): void | Promise<void>;
|
|
9057
9060
|
onEnterXR?(args: NeedleXREventArgs): void;
|
|
9058
9061
|
onUpdateXR?(args: NeedleXREventArgs): void;
|
|
9059
9062
|
onLeaveXR?(args: NeedleXREventArgs): void;
|
|
@@ -10455,6 +10458,8 @@ export declare interface IWatch {
|
|
|
10455
10458
|
dispose(): any;
|
|
10456
10459
|
}
|
|
10457
10460
|
|
|
10461
|
+
/* Excluded from this release type: _iXmRJVD */
|
|
10462
|
+
|
|
10458
10463
|
export declare interface IXRRig extends Pick<IComponent, "gameObject"> {
|
|
10459
10464
|
isXRRig(): boolean;
|
|
10460
10465
|
get isActive(): boolean;
|
|
@@ -11155,8 +11160,6 @@ declare class LowPassFilter {
|
|
|
11155
11160
|
reset(value?: number): void;
|
|
11156
11161
|
}
|
|
11157
11162
|
|
|
11158
|
-
/* Excluded from this release type: LuMYUbW */
|
|
11159
|
-
|
|
11160
11163
|
declare type MagicSkyboxName = "studio" | "blurred-skybox" | "quicklook-ar" | "quicklook";
|
|
11161
11164
|
|
|
11162
11165
|
export declare class MainModule {
|
|
@@ -12956,6 +12959,11 @@ export declare class NeedleXRSession implements INeedleXRSession {
|
|
|
12956
12959
|
readonly session: XRSession;
|
|
12957
12960
|
/** XR Session Mode: AR or VR */
|
|
12958
12961
|
readonly mode: XRSessionMode;
|
|
12962
|
+
/** The framebuffer scale factor this session was started with. On this
|
|
12963
|
+
* version the engine never requests a custom scale, so it is always 1 —
|
|
12964
|
+
* the property exists so session-resolution handling (e.g. the App Clip
|
|
12965
|
+
* canvas scaling) reads one authoritative value. */
|
|
12966
|
+
readonly appliedFramebufferScaleFactor: number;
|
|
12959
12967
|
/**
|
|
12960
12968
|
* The XRSession interface's read-only interactionMode property describes the best space (according to the user agent) for the application to draw an interactive UI for the current session.
|
|
12961
12969
|
* @link https://developer.mozilla.org/en-US/docs/Web/API/XRSession/interactionMode
|
|
@@ -23551,8 +23559,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
23551
23559
|
private updateDarkness;
|
|
23552
23560
|
}
|
|
23553
23561
|
|
|
23554
|
-
/* Excluded from this release type: _VIq */
|
|
23555
|
-
|
|
23556
23562
|
/**
|
|
23557
23563
|
* Action to show or hide an object.
|
|
23558
23564
|
* Use together with a {@link TapGestureTrigger} to show or hide objects when tapped or clicked.
|
|
@@ -24493,22 +24499,22 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24493
24499
|
* **Tip:** Add all your markers upfront. In WebXR mode they all work simultaneously.
|
|
24494
24500
|
* In QuickLook mode, the first (primary) marker is used.
|
|
24495
24501
|
*
|
|
24496
|
-
* @param image The marker configuration
|
|
24497
|
-
*
|
|
24502
|
+
* @param image The marker configuration - either a plain options object or a {@link WebXRImageTrackingModel}.
|
|
24503
|
+
* Set `asPrimary: true` to make this the primary marker (for QuickLook fallback).
|
|
24498
24504
|
*
|
|
24499
24505
|
* @example
|
|
24500
24506
|
* ```ts
|
|
24501
|
-
* // Super simple -
|
|
24502
|
-
*
|
|
24507
|
+
* // Super simple - just pass the marker url and the object to show
|
|
24508
|
+
* imageTracking.addImage({
|
|
24503
24509
|
* url: "https://mysite.com/poster.png",
|
|
24504
|
-
*
|
|
24505
|
-
*
|
|
24510
|
+
* object: cool3DModel,
|
|
24511
|
+
* widthInMeters: 0.42, // A3 poster width (optional, defaults to 0.25)
|
|
24506
24512
|
* });
|
|
24507
|
-
* imageTracking.addImage(marker);
|
|
24508
24513
|
* // That's it! Needle does the rest.
|
|
24509
24514
|
* ```
|
|
24510
24515
|
*/
|
|
24511
|
-
addImage(
|
|
24516
|
+
addImage(options: WebXRImageTrackingOptions): void;
|
|
24517
|
+
addImage(model: WebXRImageTrackingModel): void;
|
|
24512
24518
|
/**
|
|
24513
24519
|
* Your list of markers to track. Add as many as you need!
|
|
24514
24520
|
*
|
|
@@ -24544,9 +24550,13 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24544
24550
|
/* Excluded from this release type: awake */
|
|
24545
24551
|
/* Excluded from this release type: onEnable */
|
|
24546
24552
|
/* Excluded from this release type: onDisable */
|
|
24553
|
+
private onInvalidImageSizeDetected;
|
|
24547
24554
|
private onBeforeUSDZExport;
|
|
24548
24555
|
/* Excluded from this release type: onBeforeXR */
|
|
24549
24556
|
/* Excluded from this release type: onEnterXR */
|
|
24557
|
+
/** Late-registers this component's marker images into an already running session
|
|
24558
|
+
* via the NeedleGo polyfill's runtime hook. See {@link onEnterXR}. */
|
|
24559
|
+
private registerImagesWithRunningSession;
|
|
24550
24560
|
/* Excluded from this release type: onLeaveXR */
|
|
24551
24561
|
private readonly imageToObjectMap;
|
|
24552
24562
|
private readonly currentImages;
|
|
@@ -24598,14 +24608,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24598
24608
|
* @param params.imageDoesNotMove Enable for static markers (floor/wall mounted) to improve tracking stability
|
|
24599
24609
|
* @param params.hideWhenTrackingIsLost If true, hides the object when tracking is lost; if false, leaves it at the last known position
|
|
24600
24610
|
*/
|
|
24601
|
-
constructor(params:
|
|
24602
|
-
url: string;
|
|
24603
|
-
widthInMeters: number; /** Object to track */
|
|
24604
|
-
object: AssetReference | Object3D;
|
|
24605
|
-
createObjectInstance?: boolean;
|
|
24606
|
-
imageDoesNotMove?: boolean;
|
|
24607
|
-
hideWhenTrackingIsLost?: boolean;
|
|
24608
|
-
});
|
|
24611
|
+
constructor(params: Omit<WebXRImageTrackingOptions, "asPrimary">);
|
|
24609
24612
|
/**
|
|
24610
24613
|
* URL to the marker image to track.
|
|
24611
24614
|
* **Important:** Use images with high contrast and unique features to improve tracking quality.
|
|
@@ -24680,6 +24683,27 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24680
24683
|
getNameFromUrl(): string | null;
|
|
24681
24684
|
}
|
|
24682
24685
|
|
|
24686
|
+
/**
|
|
24687
|
+
* Options for adding a trackable image marker via {@link WebXRImageTracking.addImage}.
|
|
24688
|
+
* A convenience shape that also accepts a plain {@link Object3D} for `object`.
|
|
24689
|
+
*/
|
|
24690
|
+
export declare interface WebXRImageTrackingOptions {
|
|
24691
|
+
/** URL to the marker image to track. Use high-contrast images with unique features for reliable tracking. */
|
|
24692
|
+
url?: string;
|
|
24693
|
+
/** The 3D object (or {@link AssetReference}) to display when the marker is detected. */
|
|
24694
|
+
object: AssetReference | Object3D;
|
|
24695
|
+
/** Physical width of the printed marker in meters. Must match the real marker size. @default 0.25 */
|
|
24696
|
+
widthInMeters?: number;
|
|
24697
|
+
/** Create a new instance of the object for each detection. @default false */
|
|
24698
|
+
createObjectInstance?: boolean;
|
|
24699
|
+
/** Enable for static markers (walls/floor) to improve tracking stability. @default false */
|
|
24700
|
+
imageDoesNotMove?: boolean;
|
|
24701
|
+
/** Hide the object when tracking is lost. @default true */
|
|
24702
|
+
hideWhenTrackingIsLost?: boolean;
|
|
24703
|
+
/** Make this the primary marker (used in QuickLook fallback mode). @default false */
|
|
24704
|
+
asPrimary?: boolean;
|
|
24705
|
+
}
|
|
24706
|
+
|
|
24683
24707
|
/**
|
|
24684
24708
|
* [WebXRPlaneTracking](https://engine.needle.tools/docs/api/WebXRPlaneTracking) tracks planes and meshes in the real world when in immersive-ar (e.g. on Oculus Quest).
|
|
24685
24709
|
* @category XR
|