@needle-tools/engine 5.1.0-alpha.5 → 5.1.0-canary.02ccb45
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 +13 -1
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-OPkPmdUM.umd.cjs → needle-engine.bundle-BSJwg312.umd.cjs} +146 -145
- package/dist/{needle-engine.bundle-C-LG00ZZ.js → needle-engine.bundle-DLNnLj9B.js} +6650 -6494
- package/dist/{needle-engine.bundle-D7tzaiYE.min.js → needle-engine.bundle-I8Lv85MA.min.js} +175 -174
- package/dist/needle-engine.d.ts +95 -17
- package/dist/needle-engine.js +554 -553
- 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_context.js +7 -0
- package/lib/engine/engine_context.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 +185 -57
- 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_format.js +20 -14
- package/lib/engine/engine_utils_format.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.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/TempXRContext.js +2 -2
- package/lib/engine/xr/TempXRContext.js.map +1 -1
- package/lib/engine-components/AudioSource.js +1 -1
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/DropListener.js +1 -0
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/OrbitControls.d.ts +1 -0
- package/lib/engine-components/OrbitControls.js +7 -2
- package/lib/engine-components/OrbitControls.js.map +1 -1
- package/lib/engine-components/VideoPlayer.d.ts +8 -2
- package/lib/engine-components/VideoPlayer.js +42 -19
- package/lib/engine-components/VideoPlayer.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +16 -7
- package/lib/engine-components/Voip.js +90 -53
- package/lib/engine-components/Voip.js.map +1 -1
- package/lib/engine-components/api.d.ts +1 -0
- package/lib/engine-components/api.js +1 -0
- package/lib/engine-components/api.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 +62 -1
- package/lib/engine-components/webxr/WebXRImageTracking.js +55 -2
- package/lib/engine-components/webxr/WebXRImageTracking.js.map +1 -1
- package/package.json +2 -2
- package/plugins/common/license.js +50 -10
- package/plugins/types/userconfig.d.ts +4 -1
- package/plugins/vite/build-pipeline.js +57 -20
- package/plugins/vite/license.js +29 -12
- package/src/engine/api.ts +1 -1
- package/src/engine/engine_context.ts +11 -1
- package/src/engine/engine_init.ts +2 -2
- package/src/engine/engine_license.ts +201 -55
- package/src/engine/engine_networking_blob.ts +3 -3
- package/src/engine/engine_utils_format.ts +20 -14
- 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.loading.ts +6 -6
- package/src/engine/webcomponents/needle-engine.ts +2 -2
- package/src/engine/xr/TempXRContext.ts +2 -2
- package/src/engine-components/AudioSource.ts +1 -1
- package/src/engine-components/DropListener.ts +1 -0
- package/src/engine-components/OrbitControls.ts +8 -2
- package/src/engine-components/VideoPlayer.ts +40 -17
- package/src/engine-components/Voip.ts +88 -53
- package/src/engine-components/api.ts +1 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
- package/src/engine-components/webxr/WebXRImageTracking.ts +77 -7
- package/src/vite-env.d.ts +0 -16
package/dist/needle-engine.d.ts
CHANGED
|
@@ -117,8 +117,12 @@ import { XRHandSpace } from 'three';
|
|
|
117
117
|
|
|
118
118
|
export declare const $componentName: unique symbol;
|
|
119
119
|
|
|
120
|
+
/* Excluded from this release type: _$HwXA */
|
|
121
|
+
|
|
120
122
|
export declare const $physicsKey: unique symbol;
|
|
121
123
|
|
|
124
|
+
/* Excluded from this release type: _$xxpfa */
|
|
125
|
+
|
|
122
126
|
export declare class __Ignore {
|
|
123
127
|
}
|
|
124
128
|
|
|
@@ -1794,7 +1798,7 @@ export { AudioListener_2 as AudioListener }
|
|
|
1794
1798
|
/**
|
|
1795
1799
|
* Defines how audio volume attenuates over distance from the listener.
|
|
1796
1800
|
*/
|
|
1797
|
-
declare enum AudioRolloffMode {
|
|
1801
|
+
export declare enum AudioRolloffMode {
|
|
1798
1802
|
/**
|
|
1799
1803
|
* Logarithmic rolloff provides a natural, real-world attenuation where volume decreases
|
|
1800
1804
|
* exponentially with distance.
|
|
@@ -8147,14 +8151,8 @@ export declare type GuidsMap = {
|
|
|
8147
8151
|
[key: string]: string;
|
|
8148
8152
|
};
|
|
8149
8153
|
|
|
8150
|
-
/* Excluded from this release type: hasCommercialLicense */
|
|
8151
|
-
|
|
8152
|
-
/* Excluded from this release type: hasIndieLicense */
|
|
8153
|
-
|
|
8154
8154
|
/* Excluded from this release type: hasPointerEventComponent */
|
|
8155
8155
|
|
|
8156
|
-
/* Excluded from this release type: hasProLicense */
|
|
8157
|
-
|
|
8158
8156
|
export declare function hideDebugConsole(): void;
|
|
8159
8157
|
|
|
8160
8158
|
export declare enum HideFlags {
|
|
@@ -14470,6 +14468,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14470
14468
|
*/
|
|
14471
14469
|
private setLookTargetFromConstraint;
|
|
14472
14470
|
private lerpLookTarget;
|
|
14471
|
+
private canFocusAtPointer;
|
|
14473
14472
|
private setTargetFromRaycast;
|
|
14474
14473
|
/**
|
|
14475
14474
|
* Fits the camera to show the objects provided (defaults to the scene if no objects are passed in)
|
|
@@ -22597,6 +22596,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
22597
22596
|
userId: string;
|
|
22598
22597
|
}
|
|
22599
22598
|
|
|
22599
|
+
/* Excluded from this release type: UsFaeEU */
|
|
22600
|
+
|
|
22600
22601
|
/**
|
|
22601
22602
|
* Marks a field to trigger the `onValidate` callback when its value changes.
|
|
22602
22603
|
* Useful for reacting to property changes from the editor or at runtime.
|
|
@@ -22906,8 +22907,14 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
22906
22907
|
private _receivedInput;
|
|
22907
22908
|
/* Excluded from this release type: __constructor */
|
|
22908
22909
|
private _playErrors;
|
|
22909
|
-
/**
|
|
22910
|
-
|
|
22910
|
+
/**
|
|
22911
|
+
* Plays the assigned video clip, URL, or MediaStream.
|
|
22912
|
+
* If a `clip` argument is passed, it is used as the new video source (mirroring {@link AudioSource.play}).
|
|
22913
|
+
*
|
|
22914
|
+
* @param clip - Optional video URL string or {@link MediaStream} to play. If omitted, plays the currently assigned source.
|
|
22915
|
+
* @returns A promise that resolves to `true` when playback was successfully started, or `false` on error.
|
|
22916
|
+
*/
|
|
22917
|
+
play(clip?: string | MediaStream): Promise<boolean>;
|
|
22911
22918
|
/**
|
|
22912
22919
|
* Stop the video playback. This will reset the video to the beginning
|
|
22913
22920
|
*/
|
|
@@ -23177,9 +23184,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
23177
23184
|
* voip.createMenuButton = true;
|
|
23178
23185
|
*
|
|
23179
23186
|
* // Manual control
|
|
23180
|
-
* voip.connect(); // Start sending
|
|
23181
|
-
* voip.disconnect(); // Stop sending
|
|
23182
|
-
* voip.setMuted(true); // Mute
|
|
23187
|
+
* voip.connect(); // Start sending your microphone
|
|
23188
|
+
* voip.disconnect(); // Stop sending your microphone
|
|
23189
|
+
* voip.setMuted(true); // Mute incoming audio (silence other users)
|
|
23183
23190
|
* ```
|
|
23184
23191
|
*
|
|
23185
23192
|
* @summary Voice over IP for networked audio communication
|
|
@@ -23238,8 +23245,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
23238
23245
|
*/
|
|
23239
23246
|
get incomingStreams(): ReadonlyMap<string, HTMLAudioElement>;
|
|
23240
23247
|
/**
|
|
23241
|
-
*
|
|
23242
|
-
* they are considered "speaking". Default is
|
|
23248
|
+
* Normalized amplitude threshold for speaking detection (0–1). When a user's average
|
|
23249
|
+
* audio amplitude exceeds this, they are considered "speaking". Default is 0.1.
|
|
23243
23250
|
*/
|
|
23244
23251
|
speakingThreshold: number;
|
|
23245
23252
|
/**
|
|
@@ -23249,6 +23256,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
23249
23256
|
onSpeakingChanged: EventList;
|
|
23250
23257
|
private _speakingStates;
|
|
23251
23258
|
private _analysers;
|
|
23259
|
+
private _sharedAudioContext?;
|
|
23260
|
+
private _lastSpeakingPollMs;
|
|
23252
23261
|
private _net?;
|
|
23253
23262
|
private _menubutton?;
|
|
23254
23263
|
/* Excluded from this release type: awake */
|
|
@@ -23258,21 +23267,27 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
23258
23267
|
/** Set via the mic button (e.g. when the websocket connection closes and rejoins but the user was muted before we don't want to enable VOIP again automatically) */
|
|
23259
23268
|
private _allowSending;
|
|
23260
23269
|
private _outputStream;
|
|
23270
|
+
private _connectInFlight?;
|
|
23261
23271
|
/**
|
|
23262
23272
|
* @returns true if the component is currently sending audio
|
|
23263
23273
|
*/
|
|
23264
23274
|
get isSending(): boolean;
|
|
23265
23275
|
/** Start sending audio. */
|
|
23266
23276
|
connect(audioSource?: MediaTrackConstraints): Promise<boolean>;
|
|
23277
|
+
private _connectImpl;
|
|
23267
23278
|
/** Stop sending audio (muting your own microphone) */
|
|
23268
23279
|
disconnect(opts?: {
|
|
23269
23280
|
remember: boolean;
|
|
23270
23281
|
}): void;
|
|
23271
23282
|
/**
|
|
23272
|
-
* Mute or unmute the audio
|
|
23283
|
+
* Mute or unmute the audio you hear from other users (incoming streams).
|
|
23284
|
+
* This does NOT mute your own microphone — use {@link disconnect} to stop sending your microphone.
|
|
23273
23285
|
*/
|
|
23274
23286
|
setMuted(mute: boolean): void;
|
|
23275
|
-
/**
|
|
23287
|
+
/**
|
|
23288
|
+
* Returns true if incoming audio is currently muted (you can't hear other users).
|
|
23289
|
+
* When there are no incoming streams, returns false.
|
|
23290
|
+
*/
|
|
23276
23291
|
get isMuted(): boolean;
|
|
23277
23292
|
private updateButton;
|
|
23278
23293
|
/** @deprecated */
|
|
@@ -23284,6 +23299,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
23284
23299
|
/* Excluded from this release type: update */
|
|
23285
23300
|
private setupAnalyser;
|
|
23286
23301
|
private cleanupAnalyser;
|
|
23302
|
+
private closeSharedAudioContext;
|
|
23287
23303
|
private onReceiveStream;
|
|
23288
23304
|
private onStreamEnded;
|
|
23289
23305
|
private onEnabledChanged;
|
|
@@ -24001,6 +24017,25 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24001
24017
|
* @link https://github.com/immersive-web/marker-tracking/blob/main/explainer.md - WebXR Marker Tracking Specification
|
|
24002
24018
|
*/
|
|
24003
24019
|
export declare class WebXRImageTracking extends Component {
|
|
24020
|
+
/**
|
|
24021
|
+
* Event invoked every frame when images are being tracked.
|
|
24022
|
+
* @example
|
|
24023
|
+
* ```ts
|
|
24024
|
+
* const tracker = this.gameObject.getComponent(WebXRImageTracking);
|
|
24025
|
+
* tracker?.imageTracked.addEventListener(evt => {
|
|
24026
|
+
* for (const img of evt.trackedImages) {
|
|
24027
|
+
* console.log(img.url, img.state);
|
|
24028
|
+
* }
|
|
24029
|
+
* });
|
|
24030
|
+
* ```
|
|
24031
|
+
*/
|
|
24032
|
+
imageTracked: EventList<WebXRImageTrackingEvent>;
|
|
24033
|
+
/** @inheritdoc */
|
|
24034
|
+
addEventListener<K extends keyof WebXRImageTrackingEventMap>(type: K, listener: (evt: WebXRImageTrackingEventMap[K]) => any): void;
|
|
24035
|
+
addEventListener<T extends Event>(type: string, listener: (evt: T) => any): void;
|
|
24036
|
+
/** @inheritdoc */
|
|
24037
|
+
removeEventListener<K extends keyof WebXRImageTrackingEventMap>(type: K, listener: (evt: WebXRImageTrackingEventMap[K]) => any): void;
|
|
24038
|
+
removeEventListener<T extends Event>(type: string, listener: (evt: T) => any): void;
|
|
24004
24039
|
/**
|
|
24005
24040
|
* Set which marker should be primary (first in the list).
|
|
24006
24041
|
* Useful when deploying to QuickLook mode where one marker is tracked at a time.
|
|
@@ -24087,6 +24122,18 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24087
24122
|
private onImageTrackingUpdate;
|
|
24088
24123
|
}
|
|
24089
24124
|
|
|
24125
|
+
/** Data passed to image tracking event listeners. */
|
|
24126
|
+
export declare interface WebXRImageTrackingEvent {
|
|
24127
|
+
/** The images currently being tracked this frame. */
|
|
24128
|
+
readonly trackedImages: readonly WebXRTrackedImage[];
|
|
24129
|
+
}
|
|
24130
|
+
|
|
24131
|
+
/** Event map for {@link WebXRImageTracking} events. Use with `addEventListener` for typed event handling. */
|
|
24132
|
+
export declare interface WebXRImageTrackingEventMap {
|
|
24133
|
+
/** Dispatched every frame when images are being tracked. The event detail contains the tracking data for the current frame. */
|
|
24134
|
+
"image-tracking": CustomEvent<WebXRImageTrackingEvent>;
|
|
24135
|
+
}
|
|
24136
|
+
|
|
24090
24137
|
/**
|
|
24091
24138
|
* Configuration model for a tracked image marker.
|
|
24092
24139
|
* Defines which image to track, its physical size, and which 3D content to display when detected.
|
|
@@ -24285,8 +24332,39 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24285
24332
|
get widthInMeters(): number;
|
|
24286
24333
|
/** The ImageBitmap used for tracking */
|
|
24287
24334
|
get bitmap(): ImageBitmap;
|
|
24288
|
-
/**
|
|
24335
|
+
/**
|
|
24336
|
+
* The {@link WebXRImageTrackingModel} configuration for this tracked image.
|
|
24337
|
+
* Use this to access the assigned 3D object, marker settings, and other image tracking configuration.
|
|
24338
|
+
* Available on each {@link WebXRTrackedImage} received from the `image-tracking` {@link CustomEvent} (`event.detail`).
|
|
24339
|
+
* @example
|
|
24340
|
+
* ```ts
|
|
24341
|
+
* tracker.addEventListener("image-tracking", event => {
|
|
24342
|
+
* for (const img of event.detail.trackedImages) {
|
|
24343
|
+
* const model = img.model;
|
|
24344
|
+
* // Access the assigned 3D object
|
|
24345
|
+
* const obj = model.object;
|
|
24346
|
+
* // Access other settings
|
|
24347
|
+
* console.log(model.widthInMeters, model.hideWhenTrackingIsLost);
|
|
24348
|
+
* }
|
|
24349
|
+
* });
|
|
24350
|
+
* ```
|
|
24351
|
+
*/
|
|
24289
24352
|
get model(): WebXRImageTrackingModel;
|
|
24353
|
+
/**
|
|
24354
|
+
* The 3D object or prefab assigned to this tracked image marker in the {@link WebXRImageTrackingModel}.
|
|
24355
|
+
* Use this to access the object associated with an AR image tracking marker from the `image-tracking` {@link CustomEvent}.
|
|
24356
|
+
* Shorthand for `this.model.object`.
|
|
24357
|
+
* @example
|
|
24358
|
+
* ```ts
|
|
24359
|
+
* tracker.addEventListener("image-tracking", event => {
|
|
24360
|
+
* for (const img of event.detail.trackedImages) {
|
|
24361
|
+
* const obj = img.trackedModel;
|
|
24362
|
+
* // verbose alternative: img.model.object
|
|
24363
|
+
* }
|
|
24364
|
+
* });
|
|
24365
|
+
* ```
|
|
24366
|
+
*/
|
|
24367
|
+
get trackedModel(): AssetReference | undefined;
|
|
24290
24368
|
/**
|
|
24291
24369
|
* The measured size of the detected image in the real world.
|
|
24292
24370
|
* May differ from `widthInMeters` if the physical marker doesn't match the configured size.
|