@needle-tools/engine 5.1.0-alpha.7 → 5.1.0-alpha.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 +17 -0
- package/components.needle.json +1 -1
- package/dist/{materialx-CE2sUv2B.umd.cjs → materialx-B47Bz-xs.umd.cjs} +1 -1
- package/dist/{materialx-u1EqYrhu.min.js → materialx-B85WjP7E.min.js} +1 -1
- package/dist/{materialx-vyB2Zbt4.js → materialx-jkHmVPez.js} +1 -1
- package/dist/{needle-engine.bundle-BNj2FJS7.min.js → needle-engine.bundle-BotdnwVF.min.js} +173 -173
- package/dist/{needle-engine.bundle-tHGdwr9a.umd.cjs → needle-engine.bundle-DagaNrZK.umd.cjs} +147 -147
- package/dist/{needle-engine.bundle-BwS5IsLn.js → needle-engine.bundle-mtqHZ45d.js} +7832 -7624
- package/dist/needle-engine.d.ts +301 -23
- package/dist/needle-engine.js +575 -565
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{vendor-ButPLzor.umd.cjs → vendor-1UvpPPSB.umd.cjs} +2 -2
- package/dist/{vendor-DqZC4Is7.min.js → vendor-BQ2Vuntm.min.js} +4 -4
- package/dist/{vendor-DkWSNjMV.js → vendor-BslSKZPo.js} +113 -106
- 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_audio.d.ts +30 -1
- package/lib/engine/engine_audio.js +57 -13
- package/lib/engine/engine_audio.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_instantiate_resolve.js +40 -10
- package/lib/engine/engine_instantiate_resolve.js.map +1 -1
- package/lib/engine/engine_license.d.ts +7 -7
- package/lib/engine/engine_license.js +72 -72
- package/lib/engine/engine_license.js.map +1 -1
- package/lib/engine/engine_math.d.ts +1 -1
- package/lib/engine/engine_math.js +10 -4
- package/lib/engine/engine_math.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_scenedata.js +7 -0
- package/lib/engine/engine_scenedata.js.map +1 -1
- package/lib/engine/engine_serialization_core.js +7 -2
- package/lib/engine/engine_serialization_core.js.map +1 -1
- package/lib/engine/engine_time_utils.d.ts +10 -6
- package/lib/engine/engine_time_utils.js +10 -6
- package/lib/engine/engine_time_utils.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.d.ts +46 -2
- package/lib/engine-components/AudioSource.js +268 -60
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/DragControls.js +2 -2
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DragControlsConstraints.d.ts +0 -15
- package/lib/engine-components/DragControlsConstraints.js +14 -8
- package/lib/engine-components/DragControlsConstraints.js.map +1 -1
- package/lib/engine-components/EventList.js +1 -1
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +17 -2
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/codegen/components.d.ts +10 -0
- package/lib/engine-components/codegen/components.js +10 -0
- package/lib/engine-components/codegen/components.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/timeline/PlayableDirector.d.ts +6 -0
- package/lib/engine-components/timeline/PlayableDirector.js +25 -12
- package/lib/engine-components/timeline/PlayableDirector.js.map +1 -1
- package/lib/engine-components/web/ScrollFollow.d.ts +33 -0
- package/lib/engine-components/web/ScrollFollow.js +164 -22
- package/lib/engine-components/web/ScrollFollow.js.map +1 -1
- package/lib/needle-app.d.ts +18 -0
- package/lib/needle-app.js +19 -0
- package/lib/needle-app.js.map +1 -0
- package/package.json +3 -2
- package/plugins/common/license.js +25 -4
- package/plugins/common/needle-engine.js +5 -2
- package/plugins/types/userconfig.d.ts +22 -0
- package/plugins/vite/dts-generator.d.ts +24 -0
- package/plugins/vite/dts-generator.js +40 -7
- package/plugins/vite/index.d.ts +2 -0
- package/plugins/vite/index.js +17 -0
- package/plugins/vite/license.js +4 -4
- package/plugins/vite/needle-app.js +78 -5
- package/plugins/vite/remote.d.ts +28 -0
- package/plugins/vite/remote.js +124 -0
- package/src/engine/api.ts +1 -1
- package/src/engine/engine_audio.ts +68 -15
- package/src/engine/engine_init.ts +2 -2
- package/src/engine/engine_instantiate_resolve.ts +37 -10
- package/src/engine/engine_license.ts +69 -69
- package/src/engine/engine_math.ts +11 -4
- package/src/engine/engine_networking_blob.ts +3 -3
- package/src/engine/engine_scenedata.ts +7 -2
- package/src/engine/engine_serialization_core.ts +7 -2
- package/src/engine/engine_time_utils.ts +10 -6
- 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 +256 -55
- package/src/engine-components/DragControls.ts +3 -2
- package/src/engine-components/DragControlsConstraints.ts +16 -8
- package/src/engine-components/EventList.ts +1 -1
- package/src/engine-components/SceneSwitcher.ts +14 -2
- package/src/engine-components/codegen/components.ts +10 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
- package/src/engine-components/timeline/PlayableDirector.ts +23 -12
- package/src/engine-components/web/ScrollFollow.ts +168 -22
package/dist/needle-engine.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ import { Pass } from 'postprocessing';
|
|
|
75
75
|
import { peerjs } from 'peerjs';
|
|
76
76
|
import { PeerJSOption } from 'peerjs';
|
|
77
77
|
import { PerspectiveCamera } from 'three';
|
|
78
|
+
import { Plane } from 'three';
|
|
78
79
|
import { PositionalAudio } from 'three';
|
|
79
80
|
import { postprocessing } from 'postprocessing';
|
|
80
81
|
import { Particle as QParticle } from 'three.quarks';
|
|
@@ -117,8 +118,6 @@ import { XRHandSpace } from 'three';
|
|
|
117
118
|
|
|
118
119
|
export declare const $componentName: unique symbol;
|
|
119
120
|
|
|
120
|
-
/* Excluded from this release type: $HDGDr */
|
|
121
|
-
|
|
122
121
|
export declare const $physicsKey: unique symbol;
|
|
123
122
|
|
|
124
123
|
export declare class __Ignore {
|
|
@@ -1978,11 +1977,18 @@ export declare class AudioSource extends Component {
|
|
|
1978
1977
|
private sound;
|
|
1979
1978
|
private helper;
|
|
1980
1979
|
private wasPlaying;
|
|
1981
|
-
private audioLoader;
|
|
1982
1980
|
private shouldPlay;
|
|
1983
|
-
private _lastClipStartedLoading;
|
|
1984
1981
|
private _loadedClip;
|
|
1985
1982
|
private _audioElement;
|
|
1983
|
+
/**
|
|
1984
|
+
* True when {@link _audioElement} is a file-URL element routed through
|
|
1985
|
+
* `sound.setMediaElementSource()` (the iOS-survivable string-clip path). For this path ALL
|
|
1986
|
+
* playback control (play/pause/stop/loop/pitch/time/isPlaying) goes through the element,
|
|
1987
|
+
* because three.js sets `hasPlaybackControl = false` once a media source is attached.
|
|
1988
|
+
* It is `false` for the distinct MediaStream path (which uses an element with `srcObject`
|
|
1989
|
+
* plus `setMediaStreamSource()` and is controlled differently).
|
|
1990
|
+
*/
|
|
1991
|
+
private _usesMediaElementSource;
|
|
1986
1992
|
private _entryNode;
|
|
1987
1993
|
private _spatialGain;
|
|
1988
1994
|
private _bypassGain;
|
|
@@ -2006,11 +2012,39 @@ export declare class AudioSource extends Component {
|
|
|
2006
2012
|
* @returns The {@link AudioContext} or null if not available
|
|
2007
2013
|
*/
|
|
2008
2014
|
get audioContext(): AudioContext | undefined;
|
|
2015
|
+
/**
|
|
2016
|
+
* Resumes the shared AudioContext if it is currently suspended/interrupted and the
|
|
2017
|
+
* page is visible. Uses the same policy as the global resume handler so this never
|
|
2018
|
+
* triggers the iOS `InvalidStateError: Failed to start the audio device` (which
|
|
2019
|
+
* happens when resuming while the page is hidden). No-op when the context is already
|
|
2020
|
+
* running or when resuming is not currently allowed.
|
|
2021
|
+
*/
|
|
2022
|
+
private ensureContextResumed;
|
|
2009
2023
|
/* Excluded from this release type: awake */
|
|
2010
2024
|
/* Excluded from this release type: onEnable */
|
|
2011
2025
|
/* Excluded from this release type: onDisable */
|
|
2012
2026
|
private onVisibilityChanged;
|
|
2013
2027
|
private onApplicationMuteChanged;
|
|
2028
|
+
/**
|
|
2029
|
+
* Sets up playback of a string (file URL) clip through an `HTMLAudioElement` routed into the
|
|
2030
|
+
* Web Audio graph via `sound.setMediaElementSource()`.
|
|
2031
|
+
*
|
|
2032
|
+
* Why a media element instead of a decoded `AudioBuffer`: on iOS Safari an
|
|
2033
|
+
* `AudioBufferSourceNode` has its output torn down after a device lock / audio-session
|
|
2034
|
+
* interruption and cannot be reliably revived. A `MediaElementAudioSourceNode` survives the
|
|
2035
|
+
* lock because the playing `<audio>` element keeps iOS's media session alive, so the shared
|
|
2036
|
+
* AudioContext is never torn down and resumes cleanly. This is the same approach three.js's own
|
|
2037
|
+
* `webaudio_orientation` example uses.
|
|
2038
|
+
*
|
|
2039
|
+
* This does NOT start playback — it only creates/wires the element so a later `.play()` (driven
|
|
2040
|
+
* by a user gesture) is cheap.
|
|
2041
|
+
*/
|
|
2042
|
+
private createAudioFromElement;
|
|
2043
|
+
/**
|
|
2044
|
+
* Sets up the {@link PositionalAudio} graph for a MediaStream clip (used for the MediaStream
|
|
2045
|
+
* path only — string clips go through {@link createAudioFromElement}). The actual stream node
|
|
2046
|
+
* is attached in {@link play} via `setMediaStreamSource`.
|
|
2047
|
+
*/
|
|
2014
2048
|
private createAudio;
|
|
2015
2049
|
private __onAllowAudioCallback;
|
|
2016
2050
|
/**
|
|
@@ -2032,6 +2066,15 @@ export declare class AudioSource extends Component {
|
|
|
2032
2066
|
* @returns A promise that resolves when playback starts successfully, or rejects on error
|
|
2033
2067
|
*/
|
|
2034
2068
|
play(clip?: string | MediaStream | undefined): Promise<boolean>;
|
|
2069
|
+
/**
|
|
2070
|
+
* Smoothly ramp the spatial-graph entry-gain node to `target` (1 = audible, 0 = silent) over a
|
|
2071
|
+
* few ms. A short *fade* — not a hard 0/1 gain change and not a connect/disconnect — is what
|
|
2072
|
+
* avoids the click on pause/resume (an instant change or a graph (dis)connect steps the waveform
|
|
2073
|
+
* → audible click). On iOS the MediaElementAudioSourceNode keeps feeding the graph after
|
|
2074
|
+
* element.pause() following an interruption, so fading this gain to 0 is what actually silences a
|
|
2075
|
+
* "paused" media clip; element.pause() only freezes its playback position.
|
|
2076
|
+
*/
|
|
2077
|
+
private fadeEntryGain;
|
|
2035
2078
|
/**
|
|
2036
2079
|
* Pauses audio playback while maintaining the current position.
|
|
2037
2080
|
* Use play() to resume from the paused position.
|
|
@@ -2215,6 +2258,24 @@ declare enum Axis {
|
|
|
2215
2258
|
Vertical = "y"
|
|
2216
2259
|
}
|
|
2217
2260
|
|
|
2261
|
+
/**
|
|
2262
|
+
* Constrains a dragged object to rotate only around a fixed world-space axis.
|
|
2263
|
+
* Uses swing-twist decomposition to extract only the twist component around
|
|
2264
|
+
* the given axis from the delta rotation since drag start, discarding any
|
|
2265
|
+
* perpendicular swing that would tilt the object.
|
|
2266
|
+
*
|
|
2267
|
+
* This is the correct constraint for XZ-plane dragging when the parent is
|
|
2268
|
+
* rotated — it restricts the object to yaw around the plane normal regardless
|
|
2269
|
+
* of how the plane is oriented in world space.
|
|
2270
|
+
*/
|
|
2271
|
+
export declare class AxisRotationConstraint implements IDragConstraint {
|
|
2272
|
+
private readonly _startQuat;
|
|
2273
|
+
private readonly _axis;
|
|
2274
|
+
constructor(axis: Vector3);
|
|
2275
|
+
init(ctx: IDragConstraintContext): void;
|
|
2276
|
+
apply(followObject: GameObject): void;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2218
2279
|
declare type BalloonOptions = {
|
|
2219
2280
|
type: LogType;
|
|
2220
2281
|
/**
|
|
@@ -5985,7 +6046,7 @@ export declare enum DragMode {
|
|
|
5985
6046
|
* All properties are lazy getters over the flat serialized fields on the owning `DragControls`,
|
|
5986
6047
|
* so runtime writes to those fields are reflected immediately without any extra bookkeeping.
|
|
5987
6048
|
*/
|
|
5988
|
-
declare class DragProfile {
|
|
6049
|
+
export declare class DragProfile {
|
|
5989
6050
|
private readonly _dc;
|
|
5990
6051
|
private readonly _xr;
|
|
5991
6052
|
/* Excluded from this release type: __constructor */
|
|
@@ -7003,6 +7064,33 @@ export declare class FixedJoint extends Joint {
|
|
|
7003
7064
|
protected createJoint(self: Rigidbody, other: Rigidbody): any;
|
|
7004
7065
|
}
|
|
7005
7066
|
|
|
7067
|
+
/**
|
|
7068
|
+
* Freezes individual rotation axes (X, Y, and/or Z) of the dragged object.
|
|
7069
|
+
* The locked axis values are captured once at construction time and restored every frame.
|
|
7070
|
+
*
|
|
7071
|
+
* Set {@link useLocalSpace} to `true` to lock axes in the object's local space;
|
|
7072
|
+
* leave it `false` (default) to lock axes in world space.
|
|
7073
|
+
*
|
|
7074
|
+
* @example Lock Y-axis rotation in world space:
|
|
7075
|
+
* ```ts
|
|
7076
|
+
* const c = new FixedRotationAxesConstraint(RotationAxis.Y, false);
|
|
7077
|
+
* // init is called automatically by DragControls, or call manually: c.init(ctx);
|
|
7078
|
+
* ```
|
|
7079
|
+
*/
|
|
7080
|
+
export declare class FixedRotationAxesConstraint implements IDragConstraint {
|
|
7081
|
+
frozenAxes: RotationAxis;
|
|
7082
|
+
useLocalSpace: boolean;
|
|
7083
|
+
private readonly _startEuler;
|
|
7084
|
+
private readonly _eulerCache;
|
|
7085
|
+
/**
|
|
7086
|
+
* @param frozenAxes Bitfield of {@link RotationAxis} values indicating which axes to lock.
|
|
7087
|
+
* @param useLocalSpace When `true`, axes are locked in the object's local space; otherwise world space.
|
|
7088
|
+
*/
|
|
7089
|
+
constructor(frozenAxes: RotationAxis, useLocalSpace?: boolean);
|
|
7090
|
+
init(ctx: IDragConstraintContext): void;
|
|
7091
|
+
apply(followObject: GameObject): void;
|
|
7092
|
+
}
|
|
7093
|
+
|
|
7006
7094
|
declare type FocusRect = DOMRect | Element | {
|
|
7007
7095
|
x: number;
|
|
7008
7096
|
y: number;
|
|
@@ -7913,6 +8001,22 @@ export declare class GltfExportBox extends BoxHelperComponent {
|
|
|
7913
8001
|
sceneRoot?: Object3D;
|
|
7914
8002
|
}
|
|
7915
8003
|
|
|
8004
|
+
/** Projects the grabbed attachment point back onto a plane after position is resolved,
|
|
8005
|
+
* with optional grid snapping on that plane.
|
|
8006
|
+
* Owned by the strategy that requires plane-clamping (e.g. {@link XZPlaneDragStrategy}). */
|
|
8007
|
+
export declare class GrabPointPlaneConstraint implements IDragConstraint {
|
|
8008
|
+
/** Plane to project the grabbed point onto. Typically the strategy's fixed drag plane. */
|
|
8009
|
+
readonly plane: Plane;
|
|
8010
|
+
/** Attachment point in dragged-object local space. Set once at drag start; the handler
|
|
8011
|
+
* mutates this Vector3 in-place so updates are reflected automatically. */
|
|
8012
|
+
hitPointInLocalSpace: Vector3 | null;
|
|
8013
|
+
/** Grid snap resolution on the plane. 0 = projection only, no snapping. */
|
|
8014
|
+
snapResolution: number;
|
|
8015
|
+
constructor(plane: Plane);
|
|
8016
|
+
init(ctx: IDragConstraintContext): void;
|
|
8017
|
+
apply(followObject: GameObject): void;
|
|
8018
|
+
}
|
|
8019
|
+
|
|
7916
8020
|
export declare class Gradient {
|
|
7917
8021
|
alphaKeys: Array<AlphaKey>;
|
|
7918
8022
|
colorKeys: Array<ColorKey>;
|
|
@@ -8074,6 +8178,15 @@ export declare class GridLayoutGroup extends LayoutGroup {
|
|
|
8074
8178
|
protected onCalculateLayout(): void;
|
|
8075
8179
|
}
|
|
8076
8180
|
|
|
8181
|
+
/** Snaps the follow object's world position to a uniform grid. Resolution ≤ 0 is a no-op.
|
|
8182
|
+
* For XZ-plane mode, use {@link GrabPointPlaneConstraint} instead (it handles both
|
|
8183
|
+
* plane-clamping and optional grid-snapping on the plane). */
|
|
8184
|
+
export declare class GridSnapConstraint implements IDragConstraint {
|
|
8185
|
+
snapGridResolution: number;
|
|
8186
|
+
constructor(snapGridResolution: number);
|
|
8187
|
+
apply(followObject: GameObject): void;
|
|
8188
|
+
}
|
|
8189
|
+
|
|
8077
8190
|
/**
|
|
8078
8191
|
* The [GroundProjectedEnv](https://engine.needle.tools/docs/api/GroundProjectedEnv) projects the environment map onto a virtual ground plane.
|
|
8079
8192
|
* Creates a realistic floor from 360° panoramas/HDRIs by deforming the skybox
|
|
@@ -8628,6 +8741,47 @@ export declare interface IDisposable {
|
|
|
8628
8741
|
dispose(): void;
|
|
8629
8742
|
}
|
|
8630
8743
|
|
|
8744
|
+
/**
|
|
8745
|
+
* Contract for drag constraints applied after a follow object's position is resolved each frame.
|
|
8746
|
+
* Implement this interface to add custom position/rotation/scale restrictions.
|
|
8747
|
+
*/
|
|
8748
|
+
declare interface IDragConstraint {
|
|
8749
|
+
/**
|
|
8750
|
+
* Called once at drag start and again whenever the drag context resets
|
|
8751
|
+
* (e.g. multi-touch → single-pointer transition). Capture any object snapshot
|
|
8752
|
+
* (position, rotation, scale) you need to hold fixed during the drag.
|
|
8753
|
+
* Constraints that need no dynamic initialization may omit this method.
|
|
8754
|
+
*/
|
|
8755
|
+
init?(context: IDragConstraintContext): void;
|
|
8756
|
+
/** Modifies followObject in-place. Invoked after position is resolved each frame. */
|
|
8757
|
+
apply(followObject: GameObject): void;
|
|
8758
|
+
}
|
|
8759
|
+
|
|
8760
|
+
/**
|
|
8761
|
+
* Context passed to {@link IDragConstraint.init} at drag start and whenever the drag context
|
|
8762
|
+
* resets (e.g. transitioning from multi-touch back to single-pointer).
|
|
8763
|
+
* Provides a snapshot of the dragged object and attachment data a constraint needs
|
|
8764
|
+
* to initialize or re-initialize its locked reference values.
|
|
8765
|
+
*/
|
|
8766
|
+
declare interface IDragConstraintContext {
|
|
8767
|
+
/** The object being dragged. Cast to IGameObject for world-space properties. */
|
|
8768
|
+
readonly gameObject: Object3D;
|
|
8769
|
+
/** Drag attachment point in the dragged object's local space. */
|
|
8770
|
+
readonly hitPointInLocalSpace: Vector3;
|
|
8771
|
+
/** Surface normal at drag attachment in the dragged object's local space. */
|
|
8772
|
+
readonly hitNormalInLocalSpace: Vector3;
|
|
8773
|
+
/**
|
|
8774
|
+
* Local-space bounding box at scale=1. Non-null only for multi-touch drags
|
|
8775
|
+
* where scale-aware constraints (e.g. keeping the bounds bottom grounded) are needed.
|
|
8776
|
+
*/
|
|
8777
|
+
readonly boundsAtScaleOne: Box3 | null;
|
|
8778
|
+
/**
|
|
8779
|
+
* World scale of the object captured at the start of the current drag phase.
|
|
8780
|
+
* Non-null alongside boundsAtScaleOne for multi-touch; null for single-pointer.
|
|
8781
|
+
*/
|
|
8782
|
+
readonly initialWorldScale: Vector3 | null;
|
|
8783
|
+
}
|
|
8784
|
+
|
|
8631
8785
|
/** Implement to receive callbacks from {@type @needle-tools/editor-sync} package */
|
|
8632
8786
|
declare interface IEditorModification {
|
|
8633
8787
|
/**
|
|
@@ -8857,6 +9011,8 @@ export declare class ImageReference {
|
|
|
8857
9011
|
*/
|
|
8858
9012
|
export declare function imageToCanvas(image: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap, color?: Vector4 | undefined, flipY?: boolean, maxTextureSize?: number): Promise<OffscreenCanvasExt>;
|
|
8859
9013
|
|
|
9014
|
+
/* Excluded from this release type: _imGyfK */
|
|
9015
|
+
|
|
8860
9016
|
export declare interface IModel {
|
|
8861
9017
|
guid: string;
|
|
8862
9018
|
/**
|
|
@@ -10060,8 +10216,6 @@ export declare interface IRaycastOptions {
|
|
|
10060
10216
|
allowSlowRaycastFallback?: boolean;
|
|
10061
10217
|
}
|
|
10062
10218
|
|
|
10063
|
-
/* Excluded from this release type: _IrDl */
|
|
10064
|
-
|
|
10065
10219
|
declare interface IRectTransform extends IComponent {
|
|
10066
10220
|
get isDirty(): boolean;
|
|
10067
10221
|
markDirty(): any;
|
|
@@ -10363,6 +10517,20 @@ declare abstract class Joint extends Component {
|
|
|
10363
10517
|
protected abstract createJoint(self: Rigidbody, other: Rigidbody): any;
|
|
10364
10518
|
}
|
|
10365
10519
|
|
|
10520
|
+
/** Locks the follow object's world rotation to the quaternion captured at drag-start. */
|
|
10521
|
+
export declare class KeepRotationConstraint implements IDragConstraint {
|
|
10522
|
+
private readonly _savedQuat;
|
|
10523
|
+
init(ctx: IDragConstraintContext): void;
|
|
10524
|
+
apply(followObject: GameObject): void;
|
|
10525
|
+
}
|
|
10526
|
+
|
|
10527
|
+
/** Locks the follow object's world scale to the value captured at drag-start. */
|
|
10528
|
+
export declare class KeepScaleConstraint implements IDragConstraint {
|
|
10529
|
+
private readonly _savedScale;
|
|
10530
|
+
init(ctx: IDragConstraintContext): void;
|
|
10531
|
+
apply(followObject: GameObject): void;
|
|
10532
|
+
}
|
|
10533
|
+
|
|
10366
10534
|
declare const enum KeyboardEnumType {
|
|
10367
10535
|
KeyDown = "keydown",
|
|
10368
10536
|
KeyUp = "keyup",
|
|
@@ -10706,8 +10874,6 @@ export declare class LimitVelocityOverLifetimeModule {
|
|
|
10706
10874
|
apply(_position: Vec3, baseVelocity: Vector3, currentVelocity: Vector3 | Vector3_2, _size: Vector3_2, t01: number, _dt: number, _scale: number): void;
|
|
10707
10875
|
}
|
|
10708
10876
|
|
|
10709
|
-
/* Excluded from this release type: _LMtzpq */
|
|
10710
|
-
|
|
10711
10877
|
/**
|
|
10712
10878
|
* Load a 3D model file from a URL (glTF, glb, FBX, OBJ, or any format with a registered loader).
|
|
10713
10879
|
* @param url URL to the model file.
|
|
@@ -11006,7 +11172,7 @@ declare class LowPassFilter {
|
|
|
11006
11172
|
setAlpha(alpha: number): void;
|
|
11007
11173
|
filter(value: number, alpha: number): number;
|
|
11008
11174
|
lastValue(): number | null;
|
|
11009
|
-
reset(value
|
|
11175
|
+
reset(value?: number): void;
|
|
11010
11176
|
}
|
|
11011
11177
|
|
|
11012
11178
|
declare type MagicSkyboxName = "studio" | "blurred-skybox" | "quicklook-ar" | "quicklook";
|
|
@@ -15337,6 +15503,24 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15337
15503
|
bounds: Box3;
|
|
15338
15504
|
};
|
|
15339
15505
|
|
|
15506
|
+
/** Locks the follow object's signed distance from a plane to a value set at drag start.
|
|
15507
|
+
* Owned by {@link XZPlaneDragStrategy} to prevent slow Y drift in the side-view fallback path.
|
|
15508
|
+
* Immune to grab-point projection errors, stale matrixWorld, and epsilon guards.
|
|
15509
|
+
*
|
|
15510
|
+
* When {@link boundsBottomSignedDistFromPivot} is non-zero (set by {@link MultiTouchDragHandler}
|
|
15511
|
+
* for XZPlane scaling), the effective locked height is shifted each frame so the **bottom of the
|
|
15512
|
+
* object's bounds** stays at the height captured at drag start instead of the pivot. */
|
|
15513
|
+
export declare class PlaneHeightLockConstraint implements IDragConstraint {
|
|
15514
|
+
private readonly plane;
|
|
15515
|
+
private _lockedHeight;
|
|
15516
|
+
private _boundsBottomSignedDistFromPivot;
|
|
15517
|
+
/** Current pinch-scale ratio, updated each frame by {@link MultiTouchDragHandler}. */
|
|
15518
|
+
currentScaleRatio: number;
|
|
15519
|
+
constructor(plane: Plane);
|
|
15520
|
+
init(ctx: IDragConstraintContext): void;
|
|
15521
|
+
apply(followObject: GameObject): void;
|
|
15522
|
+
}
|
|
15523
|
+
|
|
15340
15524
|
/**
|
|
15341
15525
|
* PlayableDirector is the main component for controlling timelines in Needle Engine.
|
|
15342
15526
|
* It orchestrates playback of TimelineAssets containing animation, audio, signal,
|
|
@@ -15403,6 +15587,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15403
15587
|
get playableAsset(): Models.TimelineAssetModel | undefined;
|
|
15404
15588
|
set playableAsset(value: Models.TimelineAssetModel | undefined);
|
|
15405
15589
|
private _playableAsset?;
|
|
15590
|
+
private _didWarnInvalid;
|
|
15406
15591
|
/**
|
|
15407
15592
|
* When true, the timeline starts playing automatically when the component awakens.
|
|
15408
15593
|
* Set to false to control playback manually via `play()`.
|
|
@@ -15458,6 +15643,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15458
15643
|
private _clonedPlayableAsset;
|
|
15459
15644
|
private _speed;
|
|
15460
15645
|
/* Excluded from this release type: awake */
|
|
15646
|
+
/**
|
|
15647
|
+
* Returns true if the director has a valid playable asset. When invalid, warns once (dev only)
|
|
15648
|
+
* that the director has no tracks — called from the user-facing play()/evaluate() entry points.
|
|
15649
|
+
*/
|
|
15650
|
+
private warnIfInvalid;
|
|
15461
15651
|
/* Excluded from this release type: onEnable */
|
|
15462
15652
|
/* Excluded from this release type: onDisable */
|
|
15463
15653
|
/* Excluded from this release type: onDestroy */
|
|
@@ -16416,11 +16606,14 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
16416
16606
|
* Progress.end("export-usdz");
|
|
16417
16607
|
*
|
|
16418
16608
|
* // Auto step with weights:
|
|
16609
|
+
* // A numeric weight applies to the NEXT step — it sets how many steps the
|
|
16610
|
+
* // following auto-step advances. The call it is passed on advances by the
|
|
16611
|
+
* // previously-set weight (1 by default).
|
|
16419
16612
|
* Progress.start("export-usdz", undefined, (progress) => console.log("Progress: " + progress));
|
|
16420
|
-
* Progress.report("export-usdz", { message: "Exporting objects", autoStep: true, totalSteps: 10 });
|
|
16421
|
-
* Progress.report("export-usdz", { message: "
|
|
16422
|
-
* Progress.report("export-usdz", "Exporting object 2");
|
|
16423
|
-
* Progress.report("export-usdz", "Exporting object 3");
|
|
16613
|
+
* Progress.report("export-usdz", { message: "Exporting objects", autoStep: true, totalSteps: 10 }); // step 1/10 (10%)
|
|
16614
|
+
* Progress.report("export-usdz", { message: "Heavy step", autoStep: 8 }); // step 2/10 (20%); weight 8 applies to the next step
|
|
16615
|
+
* Progress.report("export-usdz", "Exporting object 2"); // advances by 8 -> step 10/10 (100%)
|
|
16616
|
+
* Progress.report("export-usdz", "Exporting object 3"); // stays at 100%
|
|
16424
16617
|
*
|
|
16425
16618
|
* // Child scopes:
|
|
16426
16619
|
* Progress.start("export-usdz", undefined, (progress) => console.log("Progress: " + progress));
|
|
@@ -16452,8 +16645,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
16452
16645
|
* Progress.report("export-usdz", { totalSteps: 20, autoStep: true });
|
|
16453
16646
|
* // show the progress as 50%
|
|
16454
16647
|
* Progress.report("export-usdz", { progress: 0.5 });
|
|
16455
|
-
* // give
|
|
16456
|
-
*
|
|
16648
|
+
* // give a weight of 20 to the NEXT step (useful for steps that take longer
|
|
16649
|
+
* // and/or have child scopes); the following auto-step will advance by 20.
|
|
16650
|
+
* Progress.report("export-usdz", { message: "Long process", autoStep: 20 });
|
|
16457
16651
|
* // show the current step and total steps and implicitly calculate progress as 10%
|
|
16458
16652
|
* Progress.report("export-usdz", { currentStep: 1, totalSteps: 10 });
|
|
16459
16653
|
*/
|
|
@@ -16518,6 +16712,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
16518
16712
|
/** Adds an entry to the browser history. Internally uses `window.history.pushState` */
|
|
16519
16713
|
export declare function pushState(title: string, urlParams: URLSearchParams, state?: any): void;
|
|
16520
16714
|
|
|
16715
|
+
/* Excluded from this release type: _QchMjAD */
|
|
16521
16716
|
export { QParticle }
|
|
16522
16717
|
|
|
16523
16718
|
export { QParticleBehaviour }
|
|
@@ -17788,6 +17983,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
17788
17983
|
FreezeAll = 126
|
|
17789
17984
|
}
|
|
17790
17985
|
|
|
17986
|
+
/* Excluded from this release type: rkHTARX */
|
|
17987
|
+
|
|
17791
17988
|
/** Use to listen to room networking events like joining a networked room
|
|
17792
17989
|
* For example: `this.context.connection.beginListen(RoomEvents.JoinedRoom, () => { })`
|
|
17793
17990
|
* @link https://engine.needle.tools/docs/networking.html#manual-networking
|
|
@@ -17809,6 +18006,17 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
17809
18006
|
RoomStateSent = "room-state-sent"
|
|
17810
18007
|
}
|
|
17811
18008
|
|
|
18009
|
+
/**
|
|
18010
|
+
* Flags controlling which rotation axes are frozen by {@link FixedRotationAxesConstraint}.
|
|
18011
|
+
* Values can be combined with the bitwise OR operator (`|`).
|
|
18012
|
+
* @example Freeze X and Z: `RotationAxis.X | RotationAxis.Z`
|
|
18013
|
+
*/
|
|
18014
|
+
declare enum RotationAxis {
|
|
18015
|
+
X = 1,
|
|
18016
|
+
Y = 2,
|
|
18017
|
+
Z = 4
|
|
18018
|
+
}
|
|
18019
|
+
|
|
17812
18020
|
export declare class RotationBySpeedModule {
|
|
17813
18021
|
enabled: boolean;
|
|
17814
18022
|
range: Vec2;
|
|
@@ -17866,6 +18074,22 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
17866
18074
|
*/
|
|
17867
18075
|
declare type ScaleClipType = "linear" | "spring";
|
|
17868
18076
|
|
|
18077
|
+
export declare class ScaleLimitConstraint implements IDragConstraint {
|
|
18078
|
+
min: number;
|
|
18079
|
+
max: number;
|
|
18080
|
+
relativeToInitialScale: boolean;
|
|
18081
|
+
/**
|
|
18082
|
+
* @param min Lower bound. Relative mode: fraction of initial scale. Raw mode: absolute world-scale per axis.
|
|
18083
|
+
* @param max Upper bound. Relative mode: fraction of initial scale. Raw mode: absolute world-scale per axis.
|
|
18084
|
+
* @param relativeToInitialScale When `true`, clamp is relative to `initialWorldScale`. When `false`, each axis is clamped independently.
|
|
18085
|
+
* @param initialWorldScale Reference to the object's world scale captured at drag start. Required for relative mode.
|
|
18086
|
+
*/
|
|
18087
|
+
private readonly _initialWorldScale;
|
|
18088
|
+
constructor(min: number, max: number, relativeToInitialScale?: boolean);
|
|
18089
|
+
init(ctx: IDragConstraintContext): void;
|
|
18090
|
+
apply(followObject: GameObject): void;
|
|
18091
|
+
}
|
|
18092
|
+
|
|
17869
18093
|
export { SceneData }
|
|
17870
18094
|
|
|
17871
18095
|
export declare class SceneLightSettings extends Component {
|
|
@@ -18752,6 +18976,22 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
18752
18976
|
*/
|
|
18753
18977
|
htmlSelector: string | null;
|
|
18754
18978
|
mode: "window";
|
|
18979
|
+
/**
|
|
18980
|
+
* Read the scroll position from the **top-level window** instead of the window Needle Engine
|
|
18981
|
+
* runs in. This matters when the canvas is embedded in an iframe:
|
|
18982
|
+
* - When the page is **not** embedded this has no effect — the top window *is* the current window.
|
|
18983
|
+
* - When embedded in a **same-origin** iframe, the component follows the *host page's* scroll,
|
|
18984
|
+
* which is almost always the intent (an embedded iframe usually isn't scrollable itself).
|
|
18985
|
+
*
|
|
18986
|
+
* Set this to `false` to always follow the engine's own window scroll, e.g. when the iframe
|
|
18987
|
+
* itself is scrollable and you want to follow its own scroll rather than the host's.
|
|
18988
|
+
*
|
|
18989
|
+
* If the top window is **cross-origin** (and therefore inaccessible), the component
|
|
18990
|
+
* transparently falls back to the local window and logs a warning in development —
|
|
18991
|
+
* cross-origin embeds would require a `postMessage` scroll bridge from the host page.
|
|
18992
|
+
* @default true
|
|
18993
|
+
*/
|
|
18994
|
+
useTopWindowScroll: boolean;
|
|
18755
18995
|
/**
|
|
18756
18996
|
* Event fired when the scroll position changes
|
|
18757
18997
|
*/
|
|
@@ -18765,9 +19005,25 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
18765
19005
|
private _appliedValue;
|
|
18766
19006
|
private _needsUpdate;
|
|
18767
19007
|
private _firstUpdate;
|
|
19008
|
+
/** The window whose scroll position currently drives this component (resolved from {@link useTopWindowScroll}). */
|
|
19009
|
+
private _scrollWindow;
|
|
19010
|
+
/** The window the `wheel` listener is attached to — kept so we remove it from the same window. */
|
|
19011
|
+
private _wheelTarget;
|
|
19012
|
+
private _crossOriginWarned;
|
|
19013
|
+
private _viewTimelineWarned;
|
|
18768
19014
|
awake(): void;
|
|
18769
19015
|
/* Excluded from this release type: onEnable */
|
|
18770
19016
|
/* Excluded from this release type: onDisable */
|
|
19017
|
+
/* Excluded from this release type: onValidate */
|
|
19018
|
+
/**
|
|
19019
|
+
* Resolves which browsing context's scroll position should drive this component.
|
|
19020
|
+
* Honors {@link useTopWindowScroll}. When the top window is requested but is cross-origin
|
|
19021
|
+
* (and therefore inaccessible) it falls back to the local window and warns once —
|
|
19022
|
+
* cross-origin embeds would need a `postMessage` scroll bridge from the host page.
|
|
19023
|
+
*/
|
|
19024
|
+
private resolveScrollWindow;
|
|
19025
|
+
/** (Re)resolves the scroll window and moves the `wheel` listener onto it. */
|
|
19026
|
+
private rebindScrollListener;
|
|
18771
19027
|
/* Excluded from this release type: lateUpdate */
|
|
18772
19028
|
private _lastSelectorValue;
|
|
18773
19029
|
private _lastSelectorElement;
|
|
@@ -19584,6 +19840,28 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19584
19840
|
updateNow(hard: boolean): void;
|
|
19585
19841
|
}
|
|
19586
19842
|
|
|
19843
|
+
/**
|
|
19844
|
+
* Used by {@link SnapToSurfacesDragStrategy} for two-pointer (multi-touch) drags.
|
|
19845
|
+
* Casts a downward ray each frame from the follow object's world position and adjusts
|
|
19846
|
+
* it so the dragged object's bounding-box contact face rests on the detected surface.
|
|
19847
|
+
*
|
|
19848
|
+
* Only injected into the constraint pipeline for multi-touch; the single-pointer path
|
|
19849
|
+
* continues to use {@link SnapToSurfacesDragStrategy.update} (pointer ray + drag plane
|
|
19850
|
+
* intersection) unchanged.
|
|
19851
|
+
*/
|
|
19852
|
+
export declare class SnapToSurfaceConstraint implements IDragConstraint {
|
|
19853
|
+
private readonly _context;
|
|
19854
|
+
private _gameObject;
|
|
19855
|
+
private _boundsAtScaleOne;
|
|
19856
|
+
private readonly _t1;
|
|
19857
|
+
private readonly _t2;
|
|
19858
|
+
private readonly _t3;
|
|
19859
|
+
private readonly _t4;
|
|
19860
|
+
constructor(_context: Context);
|
|
19861
|
+
init(ctx: IDragConstraintContext): void;
|
|
19862
|
+
apply(followObject: GameObject): void;
|
|
19863
|
+
}
|
|
19864
|
+
|
|
19587
19865
|
/** used to find data registered via gltf files e.g. find lightmaps for a Renderer component that were shipped inside a gltf */
|
|
19588
19866
|
export declare type SourceIdentifier = string;
|
|
19589
19867
|
|
|
@@ -24838,6 +25116,13 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
24838
25116
|
export { }
|
|
24839
25117
|
|
|
24840
25118
|
|
|
25119
|
+
declare module 'three' {
|
|
25120
|
+
interface Vector3 {
|
|
25121
|
+
slerp(end: Vector3, t: number): Vector3;
|
|
25122
|
+
}
|
|
25123
|
+
}
|
|
25124
|
+
|
|
25125
|
+
|
|
24841
25126
|
declare module 'three' {
|
|
24842
25127
|
interface Object3D {
|
|
24843
25128
|
get guid(): string | undefined;
|
|
@@ -24978,13 +25263,6 @@ declare module 'three' {
|
|
|
24978
25263
|
}
|
|
24979
25264
|
|
|
24980
25265
|
|
|
24981
|
-
declare module 'three' {
|
|
24982
|
-
interface Vector3 {
|
|
24983
|
-
slerp(end: Vector3, t: number): Vector3;
|
|
24984
|
-
}
|
|
24985
|
-
}
|
|
24986
|
-
|
|
24987
|
-
|
|
24988
25266
|
declare module 'three' {
|
|
24989
25267
|
interface SkinnedMesh {
|
|
24990
25268
|
staticGenerator?: StaticGeometryGenerator;
|