@needle-tools/engine 5.0.3 → 5.1.0-alpha.1
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 +31 -4
- package/README.md +6 -7
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-BXk8jYW3.js → needle-engine.bundle-BGyKqxBH.js} +12394 -11786
- package/dist/needle-engine.bundle-CiYtOO2O.min.js +1732 -0
- package/dist/needle-engine.bundle-DzVx9Z8D.umd.cjs +1732 -0
- package/dist/needle-engine.d.ts +660 -63
- package/dist/needle-engine.js +579 -566
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{vendor-vHLk8sXu.js → vendor-CAcsI0eU.js} +116 -115
- package/dist/{vendor-CntUvmJu.umd.cjs → vendor-CEM38hLE.umd.cjs} +2 -2
- package/dist/{vendor-DPbfJJ4d.min.js → vendor-HRlxIBga.min.js} +2 -2
- package/lib/engine/api.d.ts +2 -0
- package/lib/engine/api.js +2 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_addressables.js +5 -1
- package/lib/engine/engine_addressables.js.map +1 -1
- package/lib/engine/engine_animation.d.ts +14 -7
- package/lib/engine/engine_animation.js +49 -9
- package/lib/engine/engine_animation.js.map +1 -1
- package/lib/engine/engine_components.js +33 -4
- package/lib/engine/engine_components.js.map +1 -1
- package/lib/engine/engine_context.d.ts +7 -2
- package/lib/engine/engine_context.js +10 -2
- package/lib/engine/engine_context.js.map +1 -1
- package/lib/engine/engine_gameobject.d.ts +4 -0
- package/lib/engine/engine_gameobject.js.map +1 -1
- package/lib/engine/engine_init.js +4 -0
- package/lib/engine/engine_init.js.map +1 -1
- package/lib/engine/engine_input.js +4 -1
- package/lib/engine/engine_input.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.js +0 -19
- package/lib/engine/engine_materialpropertyblock.js.map +1 -1
- package/lib/engine/engine_networking.d.ts +11 -8
- package/lib/engine/engine_networking.js +43 -26
- package/lib/engine/engine_networking.js.map +1 -1
- package/lib/engine/engine_networking_instantiate.d.ts +100 -5
- package/lib/engine/engine_networking_instantiate.js +150 -16
- package/lib/engine/engine_networking_instantiate.js.map +1 -1
- package/lib/engine/engine_networking_prefabs.d.ts +59 -0
- package/lib/engine/engine_networking_prefabs.js +67 -0
- package/lib/engine/engine_networking_prefabs.js.map +1 -0
- package/lib/engine/engine_physics_rapier.d.ts +3 -0
- package/lib/engine/engine_physics_rapier.js +13 -9
- package/lib/engine/engine_physics_rapier.js.map +1 -1
- package/lib/engine/engine_utils.js +2 -2
- package/lib/engine/engine_utils.js.map +1 -1
- package/lib/engine/postprocessing/api.d.ts +2 -0
- package/lib/engine/postprocessing/api.js +2 -0
- package/lib/engine/postprocessing/api.js.map +1 -0
- package/lib/engine/postprocessing/index.d.ts +2 -0
- package/lib/engine/postprocessing/index.js +2 -0
- package/lib/engine/postprocessing/index.js.map +1 -0
- package/lib/engine/postprocessing/postprocessing.d.ts +83 -0
- package/lib/engine/postprocessing/postprocessing.js +280 -0
- package/lib/engine/postprocessing/postprocessing.js.map +1 -0
- package/lib/engine/postprocessing/types.d.ts +39 -0
- package/lib/engine/postprocessing/types.js +2 -0
- package/lib/engine/postprocessing/types.js.map +1 -0
- package/lib/engine/webcomponents/WebXRButtons.js +17 -3
- package/lib/engine/webcomponents/WebXRButtons.js.map +1 -1
- package/lib/engine/xr/NeedleXRSession.d.ts +2 -0
- package/lib/engine/xr/NeedleXRSession.js +47 -14
- package/lib/engine/xr/NeedleXRSession.js.map +1 -1
- package/lib/engine/xr/events.d.ts +30 -3
- package/lib/engine/xr/events.js +38 -0
- package/lib/engine/xr/events.js.map +1 -1
- package/lib/engine/xr/init.d.ts +4 -0
- package/lib/engine/xr/init.js +43 -0
- package/lib/engine/xr/init.js.map +1 -0
- package/lib/engine-components/AnimationUtils.d.ts +4 -1
- package/lib/engine-components/AnimationUtils.js +7 -19
- package/lib/engine-components/AnimationUtils.js.map +1 -1
- package/lib/engine-components/AnimatorController.d.ts +135 -2
- package/lib/engine-components/AnimatorController.js +216 -13
- package/lib/engine-components/AnimatorController.js.map +1 -1
- package/lib/engine-components/SeeThrough.d.ts +0 -2
- package/lib/engine-components/SeeThrough.js +0 -89
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/SyncedRoom.d.ts +4 -0
- package/lib/engine-components/SyncedRoom.js +23 -8
- package/lib/engine-components/SyncedRoom.js.map +1 -1
- package/lib/engine-components/SyncedTransform.js +5 -5
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/Voip.d.ts +46 -0
- package/lib/engine-components/Voip.js +126 -2
- 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/codegen/components.d.ts +1 -0
- package/lib/engine-components/codegen/components.js +1 -0
- package/lib/engine-components/codegen/components.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Tonemapping.d.ts +5 -2
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js +11 -18
- package/lib/engine-components/postprocessing/Effects/Tonemapping.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingEffect.d.ts +3 -4
- package/lib/engine-components/postprocessing/PostProcessingEffect.js +6 -15
- package/lib/engine-components/postprocessing/PostProcessingEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +2 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/lib/engine-components/postprocessing/Volume.d.ts +18 -11
- package/lib/engine-components/postprocessing/Volume.js +61 -140
- package/lib/engine-components/postprocessing/Volume.js.map +1 -1
- package/lib/engine-components/postprocessing/index.d.ts +1 -0
- package/lib/engine-components/postprocessing/index.js +1 -0
- package/lib/engine-components/postprocessing/index.js.map +1 -1
- package/lib/engine-components/postprocessing/utils.d.ts +2 -0
- package/lib/engine-components/postprocessing/utils.js +2 -0
- package/lib/engine-components/postprocessing/utils.js.map +1 -1
- package/lib/engine-components/ui/Canvas.js +2 -2
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/Graphic.d.ts +3 -3
- package/lib/engine-components/ui/Graphic.js +6 -2
- package/lib/engine-components/ui/Graphic.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +64 -11
- package/lib/engine-components/ui/Text.js +154 -45
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/ui/index.d.ts +1 -0
- package/lib/engine-components/ui/index.js +1 -0
- package/lib/engine-components/ui/index.js.map +1 -1
- package/lib/engine-components-experimental/networking/PlayerSync.d.ts +25 -3
- package/lib/engine-components-experimental/networking/PlayerSync.js +60 -11
- package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
- package/package.json +5 -4
- package/plugins/common/logger.js +42 -19
- package/plugins/vite/ai.d.ts +11 -10
- package/plugins/vite/ai.js +305 -31
- package/plugins/vite/logger.client.js +4 -3
- package/src/engine/api.ts +3 -0
- package/src/engine/engine_addressables.ts +4 -1
- package/src/engine/engine_animation.ts +47 -9
- package/src/engine/engine_components.ts +36 -7
- package/src/engine/engine_context.ts +11 -2
- package/src/engine/engine_gameobject.ts +5 -0
- package/src/engine/engine_init.ts +4 -0
- package/src/engine/engine_input.ts +2 -1
- package/src/engine/engine_materialpropertyblock.ts +0 -19
- package/src/engine/engine_networking.ts +46 -23
- package/src/engine/engine_networking_instantiate.ts +160 -18
- package/src/engine/engine_networking_prefabs.ts +80 -0
- package/src/engine/engine_physics_rapier.ts +14 -9
- package/src/engine/engine_utils.ts +2 -2
- package/src/engine/postprocessing/api.ts +2 -0
- package/src/engine/postprocessing/index.ts +2 -0
- package/src/engine/postprocessing/postprocessing.ts +322 -0
- package/src/engine/postprocessing/types.ts +43 -0
- package/src/engine/webcomponents/WebXRButtons.ts +21 -4
- package/src/engine/xr/NeedleXRSession.ts +55 -20
- package/src/engine/xr/events.ts +44 -1
- package/src/engine/xr/init.ts +49 -0
- package/src/engine-components/AnimationUtils.ts +7 -17
- package/src/engine-components/AnimatorController.ts +288 -18
- package/src/engine-components/SeeThrough.ts +0 -116
- package/src/engine-components/SyncedRoom.ts +28 -9
- package/src/engine-components/SyncedTransform.ts +5 -5
- package/src/engine-components/Voip.ts +129 -2
- package/src/engine-components/api.ts +1 -0
- package/src/engine-components/codegen/components.ts +1 -0
- package/src/engine-components/postprocessing/Effects/Tonemapping.ts +16 -24
- package/src/engine-components/postprocessing/PostProcessingEffect.ts +9 -16
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +2 -1
- package/src/engine-components/postprocessing/Volume.ts +72 -163
- package/src/engine-components/postprocessing/index.ts +1 -0
- package/src/engine-components/postprocessing/utils.ts +2 -0
- package/src/engine-components/ui/Canvas.ts +2 -2
- package/src/engine-components/ui/Graphic.ts +7 -3
- package/src/engine-components/ui/Text.ts +170 -52
- package/src/engine-components/ui/index.ts +2 -1
- package/src/engine-components-experimental/networking/PlayerSync.ts +64 -11
- package/dist/needle-engine.bundle-CNH61kLA.umd.cjs +0 -1730
- package/dist/needle-engine.bundle-Dvh1jROn.min.js +0 -1730
package/dist/needle-engine.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { DocumentedOptions } from '../../../node_modules/three-mesh-ui/build/typ
|
|
|
22
22
|
import { Effect } from 'postprocessing';
|
|
23
23
|
import { EffectComposer } from 'postprocessing';
|
|
24
24
|
import { EffectComposer as EffectComposer_2 } from '../../node_modules/@types/three/examples/jsm/postprocessing/EffectComposer.js';
|
|
25
|
+
import { EffectComposer as EffectComposer_3 } from '../../../node_modules/@types/three/examples/jsm/postprocessing/EffectComposer.js';
|
|
25
26
|
import { EmitterShape } from 'three.quarks';
|
|
26
27
|
import { Euler } from 'three';
|
|
27
28
|
import { EventDispatcher } from 'three';
|
|
@@ -90,6 +91,7 @@ import { Sprite as Sprite_2 } from 'three';
|
|
|
90
91
|
import { SpriteMaterial } from 'three';
|
|
91
92
|
import { Texture } from 'three';
|
|
92
93
|
import * as ThreeMeshUI from 'three-mesh-ui';
|
|
94
|
+
import { ToneMapping } from 'three';
|
|
93
95
|
import { TransformControls } from '../../node_modules/@types/three/examples/jsm/controls/TransformControls.js';
|
|
94
96
|
import { Vector2 } from 'three';
|
|
95
97
|
import { Vector2Like } from 'three';
|
|
@@ -644,29 +646,36 @@ declare class AnimationTriggers {
|
|
|
644
646
|
/**
|
|
645
647
|
* Utility class for working with animations.
|
|
646
648
|
*/
|
|
647
|
-
export declare
|
|
649
|
+
export declare namespace AnimationUtils {
|
|
648
650
|
/**
|
|
649
651
|
* Tests if the root object of an AnimationAction can be animated. Objects where matrixAutoUpdate or matrixWorldAutoUpdate is set to false may not animate correctly.
|
|
650
652
|
* @param action The AnimationAction to test
|
|
651
653
|
* @param allowLog Whether to allow logging warnings. Default is false, which only allows logging in development environments.
|
|
652
654
|
* @returns True if the root object can be animated, false otherwise
|
|
653
655
|
*/
|
|
654
|
-
|
|
656
|
+
export function testIfRootCanAnimate(action: AnimationAction, allowLog?: boolean): boolean;
|
|
655
657
|
/**
|
|
656
658
|
* Tries to get the animation actions from an animation mixer.
|
|
657
659
|
* @param mixer The animation mixer to get the actions from
|
|
658
660
|
* @returns The actions or null if the mixer is invalid
|
|
659
661
|
*/
|
|
660
|
-
|
|
661
|
-
|
|
662
|
+
export function tryGetActionsFromMixer(mixer: AnimationMixer): Array<AnimationAction> | null;
|
|
663
|
+
export function tryGetAnimationClipsFromObjectHierarchy(obj: Object3D, target?: Array<AnimationClip>): Array<AnimationClip>;
|
|
664
|
+
/** Internal method - This marks an object as being animated. Make sure to always call isAnimated=false if you stop animating the object
|
|
665
|
+
* @param obj The object to mark
|
|
666
|
+
* @param isAnimated Whether the object is animated or not
|
|
667
|
+
*/
|
|
668
|
+
export function setObjectAnimated(obj: Object3D, animatedBy: object, isAnimated: boolean): void;
|
|
669
|
+
/** Get is the object is currently animated. Currently used by the Animator to check if a timeline animationtrack is actively animating an object */
|
|
670
|
+
export function getObjectAnimated(obj: Object3D): boolean;
|
|
662
671
|
/**
|
|
663
672
|
* Assigns animations from a GLTF file to the objects in the scene.
|
|
664
673
|
* This method will look for objects in the scene that have animations and assign them to the correct objects.
|
|
665
674
|
* @param file The GLTF file to assign the animations from
|
|
666
675
|
*/
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
676
|
+
export function autoplayAnimations(file: Object3D | Pick<Model, "animations" | "scene">): Array<IAnimationComponent> | null;
|
|
677
|
+
export function emptyClip(): AnimationClip;
|
|
678
|
+
export function createScaleClip(options?: ScaleClipOptions): AnimationClip;
|
|
670
679
|
}
|
|
671
680
|
|
|
672
681
|
/**
|
|
@@ -909,8 +918,9 @@ export declare enum AnimatorConditionMode {
|
|
|
909
918
|
* and parameters that affect those transitions. It is used by the {@link Animator}
|
|
910
919
|
* component to control animation behavior on 3D models.
|
|
911
920
|
*
|
|
912
|
-
* Use
|
|
913
|
-
*
|
|
921
|
+
* Use {@link AnimatorController.build} to fluently create a controller with parameters,
|
|
922
|
+
* states, transitions, and conditions. For simple sequential playback,
|
|
923
|
+
* use {@link AnimatorController.createFromClips}.
|
|
914
924
|
*
|
|
915
925
|
* @category Animation and Sequencing
|
|
916
926
|
* @group Utilities
|
|
@@ -925,6 +935,27 @@ export declare class AnimatorController {
|
|
|
925
935
|
* @returns A new AnimatorController instance
|
|
926
936
|
*/
|
|
927
937
|
static createFromClips(clips: AnimationClip[], options?: CreateAnimatorControllerOptions): AnimatorController;
|
|
938
|
+
/**
|
|
939
|
+
* Creates a new {@link AnimatorControllerBuilder} for fluently constructing a controller with
|
|
940
|
+
* parameters, states, transitions, and conditions.
|
|
941
|
+
*
|
|
942
|
+
* @param name - Optional name for the controller
|
|
943
|
+
* @returns A new builder instance
|
|
944
|
+
*
|
|
945
|
+
* @example
|
|
946
|
+
* ```ts
|
|
947
|
+
* const ctrl = AnimatorController.build("MyController")
|
|
948
|
+
* .floatParameter("Speed")
|
|
949
|
+
* .state("Idle", { clip: idleClip, loop: true })
|
|
950
|
+
* .state("Walk", { clip: walkClip, loop: true })
|
|
951
|
+
* .transition("Idle", "Walk", { duration: 0.25 })
|
|
952
|
+
* .condition("Speed", "greater", 0.1)
|
|
953
|
+
* .transition("Walk", "Idle", { duration: 0.25 })
|
|
954
|
+
* .condition("Speed", "less", 0.1)
|
|
955
|
+
* .build();
|
|
956
|
+
* ```
|
|
957
|
+
*/
|
|
958
|
+
static build(name?: string): AnimatorControllerBuilder;
|
|
928
959
|
/**
|
|
929
960
|
* Plays an animation state by name or hash.
|
|
930
961
|
*
|
|
@@ -1116,6 +1147,84 @@ export declare class AnimatorController {
|
|
|
1116
1147
|
private rootMotionHandler?;
|
|
1117
1148
|
}
|
|
1118
1149
|
|
|
1150
|
+
/**
|
|
1151
|
+
* A fluent builder for creating {@link AnimatorController} instances from code.
|
|
1152
|
+
*
|
|
1153
|
+
* Use {@link AnimatorController.build} to create a new builder.
|
|
1154
|
+
*
|
|
1155
|
+
* @example
|
|
1156
|
+
* ```ts
|
|
1157
|
+
* const controller = AnimatorController.build("CharacterController")
|
|
1158
|
+
* .floatParameter("Speed", 0)
|
|
1159
|
+
* .triggerParameter("Jump")
|
|
1160
|
+
* .state("Idle", { clip: idleClip, loop: true })
|
|
1161
|
+
* .state("Walk", { clip: walkClip, loop: true })
|
|
1162
|
+
* .state("Jump", { clip: jumpClip })
|
|
1163
|
+
* .transition("Idle", "Walk", { duration: 0.25 })
|
|
1164
|
+
* .condition("Speed", "greater", 0.1)
|
|
1165
|
+
* .transition("Walk", "Idle", { duration: 0.25 })
|
|
1166
|
+
* .condition("Speed", "less", 0.1)
|
|
1167
|
+
* .transition("*", "Jump", { duration: 0.1 })
|
|
1168
|
+
* .condition("Jump", "if")
|
|
1169
|
+
* .transition("Jump", "Idle", { hasExitTime: true, exitTime: 0.9, duration: 0.25 })
|
|
1170
|
+
* .build();
|
|
1171
|
+
* ```
|
|
1172
|
+
*
|
|
1173
|
+
* @category Animation and Sequencing
|
|
1174
|
+
* @group Utilities
|
|
1175
|
+
*/
|
|
1176
|
+
export declare class AnimatorControllerBuilder {
|
|
1177
|
+
private _name;
|
|
1178
|
+
private _parameters;
|
|
1179
|
+
private _states;
|
|
1180
|
+
private _anyStateTransitions;
|
|
1181
|
+
private _defaultStateName;
|
|
1182
|
+
private _lastTransition;
|
|
1183
|
+
constructor(name?: string);
|
|
1184
|
+
/** Adds a float parameter */
|
|
1185
|
+
floatParameter(name: string, defaultValue?: number): this;
|
|
1186
|
+
/** Adds an integer parameter */
|
|
1187
|
+
intParameter(name: string, defaultValue?: number): this;
|
|
1188
|
+
/** Adds a boolean parameter */
|
|
1189
|
+
boolParameter(name: string, defaultValue?: boolean): this;
|
|
1190
|
+
/** Adds a trigger parameter */
|
|
1191
|
+
triggerParameter(name: string): this;
|
|
1192
|
+
/**
|
|
1193
|
+
* Adds a state to the controller. The first state added becomes the default state.
|
|
1194
|
+
* @param name - Unique name for the state
|
|
1195
|
+
* @param options - State configuration including clip, loop, speed
|
|
1196
|
+
*/
|
|
1197
|
+
state(name: string, options: StateOptions): this;
|
|
1198
|
+
/**
|
|
1199
|
+
* Adds a transition between two states.
|
|
1200
|
+
* Use `"*"` as the source to create a transition from any state.
|
|
1201
|
+
* Chain `.condition()` calls after this to add conditions.
|
|
1202
|
+
* @param from - Source state name, or `"*"` for any-state transition
|
|
1203
|
+
* @param to - Destination state name
|
|
1204
|
+
* @param options - Transition configuration
|
|
1205
|
+
*/
|
|
1206
|
+
transition(from: string, to: string, options?: TransitionOptions): this;
|
|
1207
|
+
/**
|
|
1208
|
+
* Adds a condition to the most recently added transition.
|
|
1209
|
+
* Multiple conditions on the same transition are AND-ed together.
|
|
1210
|
+
* @param parameter - Name of the parameter to evaluate
|
|
1211
|
+
* @param mode - Condition mode: `"if"`, `"ifNot"`, `"greater"`, `"less"`, `"equals"`, `"notEqual"`
|
|
1212
|
+
* @param threshold - Comparison threshold for numeric conditions (default: 0)
|
|
1213
|
+
*/
|
|
1214
|
+
condition(parameter: string, mode: ConditionMode, threshold?: number): this;
|
|
1215
|
+
/**
|
|
1216
|
+
* Sets which state is the default/entry state.
|
|
1217
|
+
* If not called, the first added state is used.
|
|
1218
|
+
* @param name - Name of the state
|
|
1219
|
+
*/
|
|
1220
|
+
defaultState(name: string): this;
|
|
1221
|
+
/**
|
|
1222
|
+
* Builds and returns the {@link AnimatorController}.
|
|
1223
|
+
* Resolves all state name references to indices.
|
|
1224
|
+
*/
|
|
1225
|
+
build(): AnimatorController;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1119
1228
|
export declare type AnimatorControllerModel = {
|
|
1120
1229
|
name: string;
|
|
1121
1230
|
guid: string;
|
|
@@ -3997,6 +4106,9 @@ export declare type Condition = {
|
|
|
3997
4106
|
threshold: number;
|
|
3998
4107
|
};
|
|
3999
4108
|
|
|
4109
|
+
/** String condition modes for the builder, mapped to {@link AnimatorConditionMode} */
|
|
4110
|
+
export declare type ConditionMode = "if" | "ifNot" | "greater" | "less" | "equals" | "notEqual";
|
|
4111
|
+
|
|
4000
4112
|
/** Events regarding the websocket connection (e.g. when the connection opens) */
|
|
4001
4113
|
export declare enum ConnectionEvents {
|
|
4002
4114
|
ConnectionInfo = "connection-start-info"
|
|
@@ -4306,9 +4418,11 @@ export declare class Context implements IContext {
|
|
|
4306
4418
|
*/
|
|
4307
4419
|
renderer: WebGLRenderer;
|
|
4308
4420
|
/**
|
|
4309
|
-
* The effect composer
|
|
4421
|
+
* The effect composer used for rendering postprocessing effects.
|
|
4422
|
+
* @deprecated Use `context.postprocessing.composer` instead.
|
|
4310
4423
|
*/
|
|
4311
|
-
composer: EffectComposer | EffectComposer_2 | null;
|
|
4424
|
+
get composer(): EffectComposer | EffectComposer_2 | null;
|
|
4425
|
+
set composer(value: EffectComposer | EffectComposer_2 | null);
|
|
4312
4426
|
/* Excluded from this release type: scripts */
|
|
4313
4427
|
/* Excluded from this release type: scripts_pausedChanged */
|
|
4314
4428
|
/* Excluded from this release type: scripts_earlyUpdate */
|
|
@@ -4359,6 +4473,8 @@ export declare class Context implements IContext {
|
|
|
4359
4473
|
input: Input;
|
|
4360
4474
|
/** access physics related methods (e.g. raycasting). To access the phyiscs engine use `context.physics.engine` */
|
|
4361
4475
|
physics: Physics;
|
|
4476
|
+
/** access postprocessing effects stack. Add/remove effects and configure adaptive performance settings */
|
|
4477
|
+
postprocessing: PostProcessing;
|
|
4362
4478
|
/** access networking methods (use it to send or listen to messages or join a networking backend) */
|
|
4363
4479
|
connection: NetworkConnection;
|
|
4364
4480
|
/** @deprecated AssetDatabase is deprecated */
|
|
@@ -6432,7 +6548,7 @@ declare enum FogMode {
|
|
|
6432
6548
|
ExponentialSquared = 3
|
|
6433
6549
|
}
|
|
6434
6550
|
|
|
6435
|
-
declare enum FontStyle {
|
|
6551
|
+
export declare enum FontStyle {
|
|
6436
6552
|
Normal = 0,
|
|
6437
6553
|
Bold = 1,
|
|
6438
6554
|
Italic = 2,
|
|
@@ -7280,7 +7396,8 @@ export declare class Gradient {
|
|
|
7280
7396
|
export declare class Graphic extends BaseUIComponent implements IGraphic, IRectTransformChangedReceiver {
|
|
7281
7397
|
get isGraphic(): boolean;
|
|
7282
7398
|
get color(): RGBAColor;
|
|
7283
|
-
set color(col: RGBAColor);
|
|
7399
|
+
set color(col: RGBAColor | Color);
|
|
7400
|
+
private _color;
|
|
7284
7401
|
private _alphaFactor;
|
|
7285
7402
|
setAlphaFactor(factor: number): void;
|
|
7286
7403
|
get alphaFactor(): number;
|
|
@@ -7289,7 +7406,6 @@ export declare class Graphic extends BaseUIComponent implements IGraphic, IRectT
|
|
|
7289
7406
|
private get m_Color();
|
|
7290
7407
|
raycastTarget: boolean;
|
|
7291
7408
|
protected uiObject: ThreeMeshUI.Block | null;
|
|
7292
|
-
private _color;
|
|
7293
7409
|
private _rect;
|
|
7294
7410
|
private _stateManager;
|
|
7295
7411
|
protected get rectTransform(): RectTransform;
|
|
@@ -7632,7 +7748,7 @@ declare abstract class HorizontalOrVerticalLayoutGroup extends LayoutGroup {
|
|
|
7632
7748
|
protected onCalculateLayout(rect: RectTransform): void;
|
|
7633
7749
|
}
|
|
7634
7750
|
|
|
7635
|
-
declare enum HorizontalWrapMode {
|
|
7751
|
+
export declare enum HorizontalWrapMode {
|
|
7636
7752
|
Wrap = 0,
|
|
7637
7753
|
Overflow = 1
|
|
7638
7754
|
}
|
|
@@ -8041,7 +8157,11 @@ export declare interface IInputEventArgs {
|
|
|
8041
8157
|
stopImmediatePropagation?(): void;
|
|
8042
8158
|
}
|
|
8043
8159
|
|
|
8160
|
+
/**
|
|
8161
|
+
* Options for instantiating a GameObject, used in {@link instantiate} and {@link syncInstantiate}
|
|
8162
|
+
*/
|
|
8044
8163
|
export declare type IInstantiateOptions = {
|
|
8164
|
+
/** The ID provider for generating unique IDs / guids */
|
|
8045
8165
|
idProvider?: UIDProvider;
|
|
8046
8166
|
parent?: string | Object3D;
|
|
8047
8167
|
/** position in local space. Set `keepWorldPosition` to true if this is world space */
|
|
@@ -8285,6 +8405,10 @@ export declare class InheritVelocityModule {
|
|
|
8285
8405
|
applyCurrent(vel: Vector3 | Vector3_2, t01: number, lerpFactor: number): void;
|
|
8286
8406
|
}
|
|
8287
8407
|
|
|
8408
|
+
/** Register the Rapier physics backend. Called from {@link initEngine}
|
|
8409
|
+
* to ensure it runs regardless of tree-shaking. */
|
|
8410
|
+
export declare function initPhysics(): void;
|
|
8411
|
+
|
|
8288
8412
|
/**
|
|
8289
8413
|
* Handles all input events including mouse, touch, keyboard, and XR controllers.
|
|
8290
8414
|
* Access via `this.context.input` from any component.
|
|
@@ -9196,6 +9320,32 @@ export declare interface IPointerUpHandler {
|
|
|
9196
9320
|
onPointerUp?(args: PointerEventData): any;
|
|
9197
9321
|
}
|
|
9198
9322
|
|
|
9323
|
+
/**
|
|
9324
|
+
* Minimal interface for a postprocessing effect as seen by the core stack.
|
|
9325
|
+
* Implemented by `PostProcessingEffect` in engine-components.
|
|
9326
|
+
*/
|
|
9327
|
+
export declare interface IPostProcessingEffect {
|
|
9328
|
+
readonly active: boolean;
|
|
9329
|
+
readonly enabled: boolean;
|
|
9330
|
+
/** When true, this effect is a tonemapping effect. The core stack uses this to detect tonemapping-only scenarios. */
|
|
9331
|
+
readonly isToneMapping?: boolean;
|
|
9332
|
+
}
|
|
9333
|
+
|
|
9334
|
+
/**
|
|
9335
|
+
* Interface for the pipeline builder that manages the EffectComposer.
|
|
9336
|
+
* Implemented by `PostProcessingHandler` in engine-components.
|
|
9337
|
+
*/
|
|
9338
|
+
export declare interface IPostProcessingHandler {
|
|
9339
|
+
readonly composer: EffectComposer | EffectComposer_3 | null;
|
|
9340
|
+
readonly hasSmaaEffect: boolean;
|
|
9341
|
+
multisampling: number;
|
|
9342
|
+
adaptivePixelRatio: boolean;
|
|
9343
|
+
apply(effects: IPostProcessingEffect[]): Promise<void>;
|
|
9344
|
+
unapply(dispose?: boolean): void;
|
|
9345
|
+
updateAdaptivePixelRatio(): void;
|
|
9346
|
+
dispose(): void;
|
|
9347
|
+
}
|
|
9348
|
+
|
|
9199
9349
|
declare type IPostProcessingManager = IComponent & {
|
|
9200
9350
|
get isPostProcessingManager(): boolean;
|
|
9201
9351
|
get dirty(): boolean;
|
|
@@ -9451,6 +9601,19 @@ export declare interface ITimelineAnimationOverride {
|
|
|
9451
9601
|
onTimelinePosition?(director: PlayableDirector, target: Object3D, time: number, position: Vector3): any;
|
|
9452
9602
|
}
|
|
9453
9603
|
|
|
9604
|
+
/**
|
|
9605
|
+
* Extended interface for tonemapping effects.
|
|
9606
|
+
* When ONLY tonemapping effects are in the stack, the core applies tonemapping
|
|
9607
|
+
* directly to the renderer instead of creating a full postprocessing pipeline.
|
|
9608
|
+
*/
|
|
9609
|
+
export declare interface ITonemappingEffect extends IPostProcessingEffect {
|
|
9610
|
+
readonly isToneMapping: true;
|
|
9611
|
+
/** The three.js ToneMapping enum value to apply to the renderer */
|
|
9612
|
+
readonly threeToneMapping: ToneMapping;
|
|
9613
|
+
/** The exposure value to apply to the renderer */
|
|
9614
|
+
readonly toneMappingExposure: number;
|
|
9615
|
+
}
|
|
9616
|
+
|
|
9454
9617
|
declare interface ITypeInformation {
|
|
9455
9618
|
type?: ConstructorConcrete<any>;
|
|
9456
9619
|
}
|
|
@@ -9581,7 +9744,7 @@ declare abstract class LayoutGroup extends Component implements ILayoutGroup {
|
|
|
9581
9744
|
get isDirty(): boolean;
|
|
9582
9745
|
get isLayoutGroup(): boolean;
|
|
9583
9746
|
updateLayout(): void;
|
|
9584
|
-
childAlignment:
|
|
9747
|
+
childAlignment: TextAnchor_2;
|
|
9585
9748
|
reverseArrangement: boolean;
|
|
9586
9749
|
spacing: number;
|
|
9587
9750
|
padding: Padding;
|
|
@@ -11802,6 +11965,7 @@ export declare class NeedleXRSession implements INeedleXRSession {
|
|
|
11802
11965
|
* @returns true if the browser supports the given XRSessionMode
|
|
11803
11966
|
*/
|
|
11804
11967
|
static isSessionSupported(mode: XRSessionMode): Promise<boolean>;
|
|
11968
|
+
private static _sessionSupportedCache;
|
|
11805
11969
|
private static _currentSessionRequest?;
|
|
11806
11970
|
private static _activeSession;
|
|
11807
11971
|
/** Register to listen to XRSession start events. Unsubscribe with `offXRSessionStart` */
|
|
@@ -12844,6 +13008,12 @@ export declare class ObjectUtils {
|
|
|
12844
13008
|
private static applyDefaultObjectOptions;
|
|
12845
13009
|
}
|
|
12846
13010
|
|
|
13011
|
+
/**
|
|
13012
|
+
* Remove a listener for before an XR session is requested
|
|
13013
|
+
* @param fn The function to remove from the listeners
|
|
13014
|
+
*/
|
|
13015
|
+
export declare function offBeforeXRSession(fn: (args: XRSessionRequestEventArgs) => void): void;
|
|
13016
|
+
|
|
12847
13017
|
/* Excluded from this release type: OffscreenCanvasExt */
|
|
12848
13018
|
|
|
12849
13019
|
/**
|
|
@@ -12948,6 +13118,21 @@ export declare function onAfterRender(cb: LifecycleMethod, opts?: LifecycleMetho
|
|
|
12948
13118
|
* */
|
|
12949
13119
|
export declare function onBeforeRender(cb: LifecycleMethod, opts?: LifecycleMethodOptions): () => void;
|
|
12950
13120
|
|
|
13121
|
+
/**
|
|
13122
|
+
* Add a listener that fires before an XR session is requested.
|
|
13123
|
+
* Use this to modify the session init options, e.g. to add optional features like `camera-access`.
|
|
13124
|
+
* @param fn The function to call before the XR session is requested
|
|
13125
|
+
* @example
|
|
13126
|
+
* ```js
|
|
13127
|
+
* onBeforeXRSession((args) => {
|
|
13128
|
+
* args.init.optionalFeatures ??= [];
|
|
13129
|
+
* args.init.optionalFeatures.push("camera-access");
|
|
13130
|
+
* });
|
|
13131
|
+
* ```
|
|
13132
|
+
* @return A function to remove the listener
|
|
13133
|
+
*/
|
|
13134
|
+
export declare function onBeforeXRSession(fn: (args: XRSessionRequestEventArgs) => void): () => void;
|
|
13135
|
+
|
|
12951
13136
|
/**
|
|
12952
13137
|
* Register a callback before the engine context is cleared.
|
|
12953
13138
|
* This happens if e.g. `<needle-engine src>` changes
|
|
@@ -13108,6 +13293,41 @@ export declare type OnRenderCallback = (renderer: WebGLRenderer, scene: Scene, c
|
|
|
13108
13293
|
* */
|
|
13109
13294
|
export declare function onStart(cb: LifecycleMethod, opts?: LifecycleMethodOptions): () => void;
|
|
13110
13295
|
|
|
13296
|
+
/**
|
|
13297
|
+
* Register a callback that fires when a remote `syncDestroy` event is received.
|
|
13298
|
+
* The callback receives the guid and the resolved Object3D (or null if not found in the scene).
|
|
13299
|
+
* The callback fires **before** the object is destroyed, so you can still access its state.
|
|
13300
|
+
* @param callback Called with the guid and the Object3D about to be destroyed
|
|
13301
|
+
* @returns An unsubscribe function
|
|
13302
|
+
* @category Networking
|
|
13303
|
+
* @example
|
|
13304
|
+
* ```ts
|
|
13305
|
+
* const unsub = onSyncDestroy((guid, obj) => {
|
|
13306
|
+
* console.log("Remote object destroyed:", guid, obj?.name);
|
|
13307
|
+
* });
|
|
13308
|
+
* // later: unsub();
|
|
13309
|
+
* ```
|
|
13310
|
+
*/
|
|
13311
|
+
export declare function onSyncDestroy(callback: SyncDestroyCallback): () => void;
|
|
13312
|
+
|
|
13313
|
+
/**
|
|
13314
|
+
* Register a callback that fires when a remote `syncInstantiate` object is created on this client.
|
|
13315
|
+
* Use this to get references to objects spawned by other users.
|
|
13316
|
+
* @param callback Called with the instantiated Object3D, the network model data, and the Needle Engine context in which the instantiate event was received
|
|
13317
|
+
* @returns An unsubscribe function
|
|
13318
|
+
* @category Networking
|
|
13319
|
+
* @example
|
|
13320
|
+
* ```ts
|
|
13321
|
+
* const unsub = onSyncInstantiate((instance, model, context) => {
|
|
13322
|
+
* console.log("Remote object created:", instance.name, model.originalGuid, context);
|
|
13323
|
+
* });
|
|
13324
|
+
* // later: unsub();
|
|
13325
|
+
* ```
|
|
13326
|
+
* @see {@link syncInstantiate} - Instantiate objects across the network
|
|
13327
|
+
* @see {@link syncDestroy} - Destroy objects across the network
|
|
13328
|
+
*/
|
|
13329
|
+
export declare function onSyncInstantiate(callback: SyncInstantiateCallback): () => void;
|
|
13330
|
+
|
|
13111
13331
|
/** Register a callback in the engine update event
|
|
13112
13332
|
* This is called every frame
|
|
13113
13333
|
* @param cb The callback to be called
|
|
@@ -13134,8 +13354,9 @@ export declare function onUpdate(cb: LifecycleMethod, opts?: LifecycleMethodOpti
|
|
|
13134
13354
|
* console.log("XR session ended", evt);
|
|
13135
13355
|
* });
|
|
13136
13356
|
* ```
|
|
13357
|
+
* @returns A function to remove the listener
|
|
13137
13358
|
*/
|
|
13138
|
-
export declare function onXRSessionEnd(fn: (evt: XRSessionEventArgs) => void): void;
|
|
13359
|
+
export declare function onXRSessionEnd(fn: (evt: XRSessionEventArgs) => void): () => void;
|
|
13139
13360
|
|
|
13140
13361
|
/**
|
|
13141
13362
|
* Add a listener for when an XR session starts
|
|
@@ -13147,8 +13368,9 @@ export declare function onXRSessionEnd(fn: (evt: XRSessionEventArgs) => void): v
|
|
|
13147
13368
|
* console.log("XR session started", evt);
|
|
13148
13369
|
* });
|
|
13149
13370
|
* ```
|
|
13371
|
+
* @returns A function to remove the listener
|
|
13150
13372
|
*/
|
|
13151
|
-
export declare function onXRSessionStart(fn: (evt: XRSessionEventArgs) => void): void;
|
|
13373
|
+
export declare function onXRSessionStart(fn: (evt: XRSessionEventArgs) => void): () => void;
|
|
13152
13374
|
|
|
13153
13375
|
/**
|
|
13154
13376
|
* OpenURL behaviour opens a URL in a new tab or window when the object (or any if it's children) is clicked.
|
|
@@ -13630,6 +13852,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
13630
13852
|
private _gainSubscription;
|
|
13631
13853
|
private _lostSubscription;
|
|
13632
13854
|
private _hasOwnerResponse;
|
|
13855
|
+
private _pendingOwnershipResolve;
|
|
13633
13856
|
constructor(connection: NetworkConnection, guid: string);
|
|
13634
13857
|
private _isWaitingForOwnershipResponseCallback;
|
|
13635
13858
|
/**
|
|
@@ -13651,21 +13874,23 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
13651
13874
|
* @throws Rejects with "Timeout" if ownership is not gained within ~1 second
|
|
13652
13875
|
* @example
|
|
13653
13876
|
* ```ts
|
|
13654
|
-
*
|
|
13655
|
-
*
|
|
13877
|
+
* const owned = await ownership.requestOwnership();
|
|
13878
|
+
* if (owned) {
|
|
13656
13879
|
* // Ownership granted, safe to modify object
|
|
13657
|
-
* } catch(e) {
|
|
13658
|
-
* console.warn("Could not gain ownership:", e);
|
|
13659
13880
|
* }
|
|
13660
13881
|
* ```
|
|
13661
13882
|
*/
|
|
13662
|
-
requestOwnershipAsync(): Promise<OwnershipModel>;
|
|
13663
13883
|
/**
|
|
13664
13884
|
* Requests ownership of this object from the networking server.
|
|
13665
|
-
*
|
|
13666
|
-
*
|
|
13885
|
+
* Returns a Promise that resolves with `true` when ownership is granted, or `false` on timeout/failure.
|
|
13886
|
+
* If ownership is already held, resolves immediately with `true`.
|
|
13887
|
+
* @returns Promise that resolves with `true` if ownership was gained, `false` otherwise
|
|
13888
|
+
*/
|
|
13889
|
+
requestOwnership(): Promise<boolean>;
|
|
13890
|
+
/**
|
|
13891
|
+
* @deprecated Use `requestOwnership()` instead for a more reliable way to gain ownership
|
|
13667
13892
|
*/
|
|
13668
|
-
|
|
13893
|
+
requestOwnershipAsync(): Promise<OwnershipModel>;
|
|
13669
13894
|
/**
|
|
13670
13895
|
* Releases ownership of this object, allowing others to take control.
|
|
13671
13896
|
* Call this when you're done modifying an object to allow other users to interact with it.
|
|
@@ -14714,7 +14939,25 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14714
14939
|
* scene.add(res.gameObject);
|
|
14715
14940
|
* ```
|
|
14716
14941
|
*/
|
|
14717
|
-
|
|
14942
|
+
/**
|
|
14943
|
+
* This API is experimental and may change or be removed in the future.
|
|
14944
|
+
* Creates a PlayerSync instance at runtime from a given URL or Object3D and sets it up for networking.
|
|
14945
|
+
* @param urlOrObject Path to the asset that should be instantiated for each player, or a pre-created Object3D to use as the player prefab
|
|
14946
|
+
* @param init Optional initialization parameters for the PlayerSync component
|
|
14947
|
+
* @returns Promise resolving to a PlayerSync instance with a guaranteed asset property
|
|
14948
|
+
* @example
|
|
14949
|
+
* ```typescript
|
|
14950
|
+
* // From a GLB URL:
|
|
14951
|
+
* const res = await PlayerSync.setupFrom("/assets/demo.glb");
|
|
14952
|
+
*
|
|
14953
|
+
* // From a runtime-created Object3D:
|
|
14954
|
+
* const avatar = ObjectUtils.createPrimitive("Sphere");
|
|
14955
|
+
* const res = await PlayerSync.setupFrom(avatar);
|
|
14956
|
+
* ```
|
|
14957
|
+
*/
|
|
14958
|
+
static setupFrom(urlOrObject: string | Object3D, init?: Omit<ComponentInit<PlayerSync>, "asset"> & {
|
|
14959
|
+
guid?: string;
|
|
14960
|
+
}): Promise<PlayerSyncWithAsset>;
|
|
14718
14961
|
/**
|
|
14719
14962
|
* When enabled, PlayerSync will automatically load and instantiate the assigned asset when joining a networked room
|
|
14720
14963
|
*/
|
|
@@ -14724,11 +14967,15 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14724
14967
|
*/
|
|
14725
14968
|
asset?: AssetReference;
|
|
14726
14969
|
/**
|
|
14727
|
-
* Event invoked when
|
|
14970
|
+
* Event invoked when ANY player instance is spawned — both local and remote.
|
|
14971
|
+
* The event argument is a {@link PlayerSpawnedEventArgs} with the player Object3D and whether it's the local player.
|
|
14972
|
+
* For backward compatibility, the first argument is also the Object3D directly.
|
|
14728
14973
|
* @serializable
|
|
14729
14974
|
*/
|
|
14730
|
-
onPlayerSpawned
|
|
14975
|
+
onPlayerSpawned: EventList<Object3D>;
|
|
14731
14976
|
private _localInstance?;
|
|
14977
|
+
private _unsubSyncInstantiate?;
|
|
14978
|
+
constructor();
|
|
14732
14979
|
awake(): void;
|
|
14733
14980
|
onEnable(): void;
|
|
14734
14981
|
onDisable(): void;
|
|
@@ -14932,6 +15179,84 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14932
15179
|
*/
|
|
14933
15180
|
export declare function postprocessFBXMaterials(obj: Mesh, material: Material | Material[], index?: number, array?: Material[]): boolean;
|
|
14934
15181
|
|
|
15182
|
+
/**
|
|
15183
|
+
* Core postprocessing stack accessible via `context.postprocessing`.
|
|
15184
|
+
* Manages the effect pipeline independently of any specific component.
|
|
15185
|
+
*
|
|
15186
|
+
* Volumes and individual PostProcessingEffect components add/remove effects
|
|
15187
|
+
* to this stack. The stack builds the EffectComposer pipeline when dirty.
|
|
15188
|
+
*
|
|
15189
|
+
* @example Add an effect directly
|
|
15190
|
+
* ```ts
|
|
15191
|
+
* const bloom = new BloomEffect({ intensity: 3 });
|
|
15192
|
+
* this.context.postprocessing.addEffect(bloom);
|
|
15193
|
+
* ```
|
|
15194
|
+
*
|
|
15195
|
+
* @example Remove an effect
|
|
15196
|
+
* ```ts
|
|
15197
|
+
* this.context.postprocessing.removeEffect(bloom);
|
|
15198
|
+
* ```
|
|
15199
|
+
*/
|
|
15200
|
+
export declare class PostProcessing {
|
|
15201
|
+
private readonly _context;
|
|
15202
|
+
private _handler;
|
|
15203
|
+
private readonly _effects;
|
|
15204
|
+
private _isDirty;
|
|
15205
|
+
/** Currently active postprocessing effects in the stack */
|
|
15206
|
+
get effects(): readonly IPostProcessingEffect[];
|
|
15207
|
+
get dirty(): boolean;
|
|
15208
|
+
set dirty(value: boolean);
|
|
15209
|
+
/** The internal PostProcessingHandler that manages the EffectComposer pipeline */
|
|
15210
|
+
get handler(): IPostProcessingHandler | null;
|
|
15211
|
+
/**
|
|
15212
|
+
* The effect composer used to render postprocessing effects.
|
|
15213
|
+
* This is set internally by the PostProcessingHandler when effects are applied.
|
|
15214
|
+
*/
|
|
15215
|
+
get composer(): EffectComposer | EffectComposer_3 | null;
|
|
15216
|
+
set composer(value: EffectComposer | EffectComposer_3 | null);
|
|
15217
|
+
private _composer;
|
|
15218
|
+
/**
|
|
15219
|
+
* Set multisampling to "auto" to automatically adjust the multisampling level based on performance.
|
|
15220
|
+
* Set to a number to manually set the multisampling level.
|
|
15221
|
+
* @default "auto"
|
|
15222
|
+
*/
|
|
15223
|
+
multisampling: "auto" | number;
|
|
15224
|
+
/** When enabled, the device pixel ratio will be gradually reduced when FPS is low
|
|
15225
|
+
* and restored when performance recovers.
|
|
15226
|
+
* @default true
|
|
15227
|
+
*/
|
|
15228
|
+
adaptiveResolution: boolean;
|
|
15229
|
+
constructor(context: Context);
|
|
15230
|
+
/**
|
|
15231
|
+
* Add a post processing effect to the stack.
|
|
15232
|
+
* The effect stack will be rebuilt on the next update.
|
|
15233
|
+
*/
|
|
15234
|
+
addEffect(effect: IPostProcessingEffect): void;
|
|
15235
|
+
/**
|
|
15236
|
+
* Remove a post processing effect from the stack.
|
|
15237
|
+
* The effect stack will be rebuilt on the next update.
|
|
15238
|
+
*/
|
|
15239
|
+
removeEffect(effect: IPostProcessingEffect): void;
|
|
15240
|
+
/** Mark the stack as dirty so the effects are rebuilt on the next update */
|
|
15241
|
+
markDirty(): void;
|
|
15242
|
+
private _enabledTime;
|
|
15243
|
+
private _multisampleAutoChangeTime;
|
|
15244
|
+
private _multisampleAutoDecreaseTime;
|
|
15245
|
+
/* Excluded from this release type: update */
|
|
15246
|
+
private _lastApplyTime?;
|
|
15247
|
+
private _rapidApplyCount;
|
|
15248
|
+
/** When true, tonemapping is applied directly to the renderer (no full pipeline) */
|
|
15249
|
+
private _tonemappingOnlyActive;
|
|
15250
|
+
private _previousToneMapping?;
|
|
15251
|
+
private _previousToneMappingExposure?;
|
|
15252
|
+
private apply;
|
|
15253
|
+
/** Restore renderer tonemapping to previous values when leaving tonemapping-only mode */
|
|
15254
|
+
private restoreTonemapping;
|
|
15255
|
+
/** Lazily creates the PostProcessingHandler to avoid loading the postprocessing library until actually needed */
|
|
15256
|
+
private ensureHandler;
|
|
15257
|
+
/* Excluded from this release type: dispose */
|
|
15258
|
+
}
|
|
15259
|
+
|
|
14935
15260
|
/**
|
|
14936
15261
|
* PostProcessingEffect is a base class for post processing effects that can be applied to the scene.
|
|
14937
15262
|
* To create a custom post processing effect, extend this class and override the `onCreateEffect` method and call `registerCustomEffectType` to make it available in the editor.
|
|
@@ -14960,8 +15285,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14960
15285
|
*
|
|
14961
15286
|
* @category Effects
|
|
14962
15287
|
* @group Components
|
|
15288
|
+
* @see {@link PostProcessing} for core Needle Engine postprocessing control, also accessible via `context.postprocessing`
|
|
14963
15289
|
*/
|
|
14964
|
-
export declare abstract class PostProcessingEffect extends Component implements IEffectProvider, IEditorModification {
|
|
15290
|
+
export declare abstract class PostProcessingEffect extends Component implements IPostProcessingEffect, IEffectProvider, IEditorModification {
|
|
14965
15291
|
get isPostProcessingEffect(): boolean;
|
|
14966
15292
|
/**
|
|
14967
15293
|
* The order of this effect. The higher the order the later the effect will be applied in the post processing stack.
|
|
@@ -14988,10 +15314,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14988
15314
|
* @deprecated
|
|
14989
15315
|
*/
|
|
14990
15316
|
active: boolean;
|
|
14991
|
-
private _manager;
|
|
14992
15317
|
onEnable(): void;
|
|
14993
15318
|
onDisable(): void;
|
|
14994
|
-
protected onEffectEnabled(manager?: IPostProcessingManager): void;
|
|
14995
15319
|
/** override to initialize bindings on parameters */
|
|
14996
15320
|
init(): void;
|
|
14997
15321
|
/** previously created effect (if any) */
|
|
@@ -15053,7 +15377,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15053
15377
|
/**
|
|
15054
15378
|
* [PostProcessingHandler](https://engine.needle.tools/docs/api/PostProcessingHandler) Is responsible for applying post processing effects to the scene. It is internally used by the {@link Volume} component
|
|
15055
15379
|
*/
|
|
15056
|
-
export declare class PostProcessingHandler {
|
|
15380
|
+
export declare class PostProcessingHandler implements IPostProcessingHandler {
|
|
15057
15381
|
private _composer;
|
|
15058
15382
|
private _lastVolumeComponents?;
|
|
15059
15383
|
private readonly _effects;
|
|
@@ -15106,8 +15430,65 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15106
15430
|
private _onCreateEffectsDebug;
|
|
15107
15431
|
}
|
|
15108
15432
|
|
|
15433
|
+
/**
|
|
15434
|
+
* Callback type for prefab providers.
|
|
15435
|
+
* @param guid The guid of the prefab to resolve
|
|
15436
|
+
* @returns The prefab Object3D, or null if not found
|
|
15437
|
+
*/
|
|
15109
15438
|
export declare type PrefabProviderCallback = (guid: string) => Promise<Object3D | null>;
|
|
15110
15439
|
|
|
15440
|
+
/**
|
|
15441
|
+
* Prefab registry for networked instantiation.
|
|
15442
|
+
*
|
|
15443
|
+
* When a remote {@link syncInstantiate} event is received, the engine looks up the prefab
|
|
15444
|
+
* by its guid using this registry. Both GLB-loaded objects and runtime-created objects
|
|
15445
|
+
* can be registered here.
|
|
15446
|
+
*
|
|
15447
|
+
* Note: {@link syncInstantiate} auto-registers prefabs if no provider exists for their guid,
|
|
15448
|
+
* so manual registration is only needed for custom resolution logic.
|
|
15449
|
+
*
|
|
15450
|
+
* @example
|
|
15451
|
+
* ```ts
|
|
15452
|
+
* import { Prefabs, ObjectUtils } from "@needle-tools/engine";
|
|
15453
|
+
*
|
|
15454
|
+
* const cookie = ObjectUtils.createPrimitive("Cube", { color: 0xff8c00 });
|
|
15455
|
+
* cookie.guid = "cookie-prefab";
|
|
15456
|
+
* Prefabs.register("cookie-prefab", async () => cookie);
|
|
15457
|
+
*
|
|
15458
|
+
* console.log(Prefabs.list()); // ["cookie-prefab"]
|
|
15459
|
+
* Prefabs.unregister("cookie-prefab");
|
|
15460
|
+
* ```
|
|
15461
|
+
*
|
|
15462
|
+
* @category Networking
|
|
15463
|
+
*/
|
|
15464
|
+
export declare const Prefabs: {
|
|
15465
|
+
/**
|
|
15466
|
+
* Register a prefab provider that resolves objects by guid for networked instantiation.
|
|
15467
|
+
* When a remote `syncInstantiate` event is received, the engine uses this to find the prefab
|
|
15468
|
+
* to clone on the receiving client.
|
|
15469
|
+
*
|
|
15470
|
+
* @param key The guid to register the provider for
|
|
15471
|
+
* @param fn Callback that returns the prefab Object3D for the given guid
|
|
15472
|
+
*/
|
|
15473
|
+
readonly register: (key: string, fn: PrefabProviderCallback) => void;
|
|
15474
|
+
/**
|
|
15475
|
+
* Unregister a previously registered prefab provider.
|
|
15476
|
+
* @param key The guid to unregister
|
|
15477
|
+
*/
|
|
15478
|
+
readonly unregister: (key: string) => void;
|
|
15479
|
+
/**
|
|
15480
|
+
* Returns a list of all registered prefab provider keys (guids).
|
|
15481
|
+
* Useful for debugging to see which prefabs are available for networked instantiation.
|
|
15482
|
+
*/
|
|
15483
|
+
readonly list: () => string[];
|
|
15484
|
+
/**
|
|
15485
|
+
* Check if a prefab provider is registered for the given guid.
|
|
15486
|
+
* @param key The guid to check
|
|
15487
|
+
*/
|
|
15488
|
+
readonly has: (key: string) => boolean;
|
|
15489
|
+
/* Excluded from this release type: resolve */
|
|
15490
|
+
};
|
|
15491
|
+
|
|
15111
15492
|
export declare type Prefix = (...args: any[]) => any;
|
|
15112
15493
|
|
|
15113
15494
|
/** Experimental attribute
|
|
@@ -15823,7 +16204,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15823
16204
|
|
|
15824
16205
|
export declare function registerLoader<T extends INeedleGltfLoader>(loader: ConstructorConcrete<T>): void;
|
|
15825
16206
|
|
|
15826
|
-
|
|
16207
|
+
/**
|
|
16208
|
+
* Register a prefab provider. Forwards to {@link Prefabs.register}.
|
|
16209
|
+
* @category Networking
|
|
16210
|
+
*/
|
|
16211
|
+
export declare function registerPrefabProvider(key: string, fn: (guid: string) => Promise<Object3D | null>): void;
|
|
15827
16212
|
|
|
15828
16213
|
/* Excluded from this release type: registerPrototypeExtensions */
|
|
15829
16214
|
|
|
@@ -17632,7 +18017,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
17632
18017
|
private _needsUpdate;
|
|
17633
18018
|
private _id;
|
|
17634
18019
|
/* Excluded from this release type: onEnable */
|
|
17635
|
-
/* Excluded from this release type: onDisable */
|
|
17636
18020
|
/* Excluded from this release type: update */
|
|
17637
18021
|
private updateDirection;
|
|
17638
18022
|
/**
|
|
@@ -17724,6 +18108,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
17724
18108
|
export declare type SessionRequestedEvent = (args: {
|
|
17725
18109
|
readonly mode: XRSessionMode;
|
|
17726
18110
|
readonly init: XRSessionInit;
|
|
18111
|
+
readonly context: Context;
|
|
17727
18112
|
}) => void;
|
|
17728
18113
|
|
|
17729
18114
|
export declare function setActive(go: Object3D, active: boolean | number): boolean;
|
|
@@ -19361,6 +19746,24 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19361
19746
|
instance?: StateMachineBehaviour;
|
|
19362
19747
|
};
|
|
19363
19748
|
|
|
19749
|
+
/**
|
|
19750
|
+
* Configuration for an animation state in the builder
|
|
19751
|
+
*/
|
|
19752
|
+
export declare type StateOptions = {
|
|
19753
|
+
/** The animation clip for this state */
|
|
19754
|
+
clip: AnimationClip;
|
|
19755
|
+
/** Whether the animation should loop (default: false) */
|
|
19756
|
+
loop?: boolean;
|
|
19757
|
+
/** Base speed multiplier (default: 1) */
|
|
19758
|
+
speed?: number;
|
|
19759
|
+
/** Name of a float parameter to multiply with speed */
|
|
19760
|
+
speedParameter?: string;
|
|
19761
|
+
/** Normalized cycle offset 0-1 (default: 0) */
|
|
19762
|
+
cycleOffset?: number;
|
|
19763
|
+
/** Name of a float parameter to use as cycle offset */
|
|
19764
|
+
cycleOffsetParameter?: string;
|
|
19765
|
+
};
|
|
19766
|
+
|
|
19364
19767
|
declare type StickName = "xr-standard-thumbstick" | "xr-standard-touchpad";
|
|
19365
19768
|
|
|
19366
19769
|
export declare class StreamEndedEvent {
|
|
@@ -19410,6 +19813,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19410
19813
|
*/
|
|
19411
19814
|
export declare function syncDestroy(obj: IGameObject | IComponent, con: INetworkConnection, recursive?: boolean, opts?: SyncDestroyOptions): void;
|
|
19412
19815
|
|
|
19816
|
+
declare type SyncDestroyCallback = (guid: string, object: Object3D) => void;
|
|
19817
|
+
|
|
19413
19818
|
declare type SyncDestroyOptions = {
|
|
19414
19819
|
/** When true the state will be saved in the networking backend */
|
|
19415
19820
|
saveInRoom?: boolean;
|
|
@@ -19526,7 +19931,10 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19526
19931
|
get roomPrefix(): string;
|
|
19527
19932
|
private _roomPrefix;
|
|
19528
19933
|
/* Excluded from this release type: awake */
|
|
19934
|
+
private _hasConnectedBefore;
|
|
19529
19935
|
/* Excluded from this release type: onEnable */
|
|
19936
|
+
/* Excluded from this release type: start */
|
|
19937
|
+
private _connectToRoom;
|
|
19530
19938
|
/* Excluded from this release type: onDisable */
|
|
19531
19939
|
/* Excluded from this release type: onDestroy */
|
|
19532
19940
|
/** Will generate a random room name, set it as an URL parameter and attempt to join the room */
|
|
@@ -19719,13 +20127,67 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19719
20127
|
}) => void;
|
|
19720
20128
|
|
|
19721
20129
|
/**
|
|
19722
|
-
* Instantiate an object across the network.
|
|
20130
|
+
* Instantiate an object across the network. The object is cloned locally and a network message
|
|
20131
|
+
* is sent so all connected clients create the same clone. Late joiners receive the message
|
|
20132
|
+
* via room state replay (unless `deleteOnDisconnect` is set or `save` is false).
|
|
20133
|
+
*
|
|
20134
|
+
* ## How it works internally
|
|
20135
|
+
* 1. The prefab is cloned locally using a seeded {@link InstantiateIdProvider}
|
|
20136
|
+
* 2. The seed ensures all clients generate **identical deterministic guids** for the clone
|
|
20137
|
+
* and all its children — no need to send individual guids over the network
|
|
20138
|
+
* 3. A {@link NewInstanceModel} message is sent containing the prefab's `originalGuid`,
|
|
20139
|
+
* the clone's `guid`, the `seed`, and transform data
|
|
20140
|
+
* 4. On receiving clients, the prefab is resolved via {@link registerPrefabProvider} or
|
|
20141
|
+
* by searching the scene for an object with matching guid, then cloned with the same seed
|
|
20142
|
+
*
|
|
20143
|
+
* ## Runtime-created prefabs (no GLB)
|
|
20144
|
+
* If the object has a `guid` but no prefab provider is registered for it, `syncInstantiate`
|
|
20145
|
+
* will **auto-register** the object as a prefab provider. This means for code-only prefabs
|
|
20146
|
+
* you just need to set a `guid` — no manual `registerPrefabProvider` call needed, as long as
|
|
20147
|
+
* all clients run the same setup code that creates the same prefab with the same guid.
|
|
20148
|
+
*
|
|
20149
|
+
* @param object The object to instantiate. Must have a `guid` property (set one for runtime objects).
|
|
20150
|
+
* @param opts Options for the instantiation, including the network context to send the instantiate event to
|
|
20151
|
+
* @param hostData Optional data about a file to download when this object is instantiated (e.g. when instantiated via file drop)
|
|
20152
|
+
* @param save When false, the state of this instance will not be saved in the networking backend. Default is true.
|
|
20153
|
+
* @returns The instantiated object, or null if instantiation failed (e.g. missing guid or network context)
|
|
20154
|
+
* @see {@link syncDestroy} - Destroy objects across the network
|
|
20155
|
+
* @see {@link onSyncInstantiate} - Register a callback to get references to remotely instantiated objects
|
|
20156
|
+
* @see {@link registerPrefabProvider} - Manually register a prefab provider (auto-registered by syncInstantiate)
|
|
20157
|
+
* @see {@link unregisterPrefabProvider} - Remove a registered prefab provider
|
|
19723
20158
|
* @category Networking
|
|
20159
|
+
*
|
|
20160
|
+
* @example Basic usage with a runtime-created prefab
|
|
20161
|
+
* ```ts
|
|
20162
|
+
* const cookie = ObjectUtils.createPrimitive("Cube", { color: 0xff8c00 });
|
|
20163
|
+
* cookie.guid = "cookie-prefab";
|
|
20164
|
+
* // No need to call registerPrefabProvider — syncInstantiate auto-registers it
|
|
20165
|
+
* syncInstantiate(cookie, { parent: ctx.scene, deleteOnDisconnect: false });
|
|
20166
|
+
* ```
|
|
20167
|
+
*
|
|
20168
|
+
* @example With deterministic seed (advanced)
|
|
20169
|
+
* ```ts
|
|
20170
|
+
* const idProvider = new InstantiateIdProvider("my-seed");
|
|
20171
|
+
* const instance = syncInstantiate(prefab, { context, idProvider });
|
|
20172
|
+
* ```
|
|
20173
|
+
* The seed generates deterministic guids via UUID v5, so all clients produce identical
|
|
20174
|
+
* identifiers for the clone and its children without sending them over the network.
|
|
19724
20175
|
*/
|
|
19725
20176
|
export declare function syncInstantiate(object: IGameObject | Object3D, opts: SyncInstantiateOptions, hostData?: HostData, save?: boolean): IGameObject | null;
|
|
19726
20177
|
|
|
20178
|
+
/**
|
|
20179
|
+
* Callback type for {@link onSyncInstantiate}
|
|
20180
|
+
* @param instance The instantiated object
|
|
20181
|
+
* @param model The network model data sent with the instantiate event
|
|
20182
|
+
* @param context The network context in which the instantiate event was received
|
|
20183
|
+
* @category Networking
|
|
20184
|
+
*/
|
|
20185
|
+
declare type SyncInstantiateCallback = (instance: IGameObject, model: NewInstanceModel, context: IContext) => void;
|
|
20186
|
+
|
|
19727
20187
|
/**
|
|
19728
20188
|
* Instantiation options for {@link syncInstantiate}
|
|
20189
|
+
* @category Networking
|
|
20190
|
+
* @see {@link syncInstantiate} - Instantiate objects across the network
|
|
19729
20191
|
*/
|
|
19730
20192
|
export declare type SyncInstantiateOptions = IInstantiateOptions & Pick<IModel, "deleteOnDisconnect">;
|
|
19731
20193
|
|
|
@@ -19808,19 +20270,75 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19808
20270
|
* @see {@link FontStyle} for bold/italic styles
|
|
19809
20271
|
*/
|
|
19810
20272
|
declare class Text_2 extends Graphic implements IHasAlphaFactor, ICanvasEventReceiver {
|
|
19811
|
-
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
|
|
19817
|
-
|
|
20273
|
+
/**
|
|
20274
|
+
* The alignment of the text within its container. This determines how the text is anchored and positioned relative to its RectTransform. For example, `UpperLeft` will anchor the text to the upper left corner of the container, while `MiddleCenter` will center the text both horizontally and vertically. Changing this property will update the underlying three-mesh-ui options and mark the UI as dirty to trigger a re-render.
|
|
20275
|
+
*/
|
|
20276
|
+
set alignment(val: TextAnchor);
|
|
20277
|
+
get alignment(): TextAnchor;
|
|
20278
|
+
private _alignment;
|
|
20279
|
+
/**
|
|
20280
|
+
* Determines how text that exceeds the vertical bounds of the container is handled. If set to `Truncate`, any text that goes beyond the vertical limits of the container will be cut off and not visible. If set to `Overflow`, the text will continue to render outside the container bounds, which may result in it being partially or fully visible depending on the layout and parent containers.
|
|
20281
|
+
* @default VerticalWrapMode.Truncate
|
|
20282
|
+
*/
|
|
20283
|
+
set verticalOverflow(val: VerticalWrapMode);
|
|
20284
|
+
get verticalOverflow(): VerticalWrapMode;
|
|
20285
|
+
private _verticalOverflow;
|
|
20286
|
+
/**
|
|
20287
|
+
* Determines how text that exceeds the horizontal bounds of the container is handled. If set to `Wrap`, the text will automatically wrap to the next line when it reaches the edge of the container. If set to `Overflow`, the text will continue on a single line and may overflow outside the container bounds.
|
|
20288
|
+
* @default HorizontalWrapMode.Wrap
|
|
20289
|
+
*/
|
|
20290
|
+
set horizontalOverflow(val: HorizontalWrapMode);
|
|
20291
|
+
get horizontalOverflow(): HorizontalWrapMode;
|
|
20292
|
+
private _horizontalOverflow;
|
|
20293
|
+
/**
|
|
20294
|
+
* The line spacing multiplier for the text. A value of 1 means normal spacing, 1.5 means 50% more spacing, and 0.5 means 50% less spacing.
|
|
20295
|
+
* @default 1
|
|
20296
|
+
*/
|
|
20297
|
+
set lineSpacing(val: number);
|
|
20298
|
+
get lineSpacing(): number;
|
|
20299
|
+
private _lineSpacing;
|
|
20300
|
+
/**
|
|
20301
|
+
* The style of the font, which can be normal, bold, italic, or bold and italic.
|
|
20302
|
+
*
|
|
20303
|
+
* This is used to determine the correct font variant to use based on the provided `font` property. For example, if you set `font` to "Arial" and `fontStyle` to `FontStyle.Bold`, it will look for a font variant named "Arial-Bold" (or "arial-bold") in the font library. If such a variant exists, it will be used to render the text with the specified style.
|
|
20304
|
+
*
|
|
20305
|
+
* @default FontStyle.Normal
|
|
20306
|
+
*/
|
|
20307
|
+
set fontStyle(val: FontStyle);
|
|
20308
|
+
get fontStyle(): FontStyle;
|
|
20309
|
+
private _fontStyle;
|
|
20310
|
+
/**
|
|
20311
|
+
* The font to use for the text, specified as a URL to a font file.
|
|
20312
|
+
*
|
|
20313
|
+
* The font file must be in MSDF format. You can generate MSDF fonts using tools like [msdf-bmfont-xml](https://github.com/Chlumsky/msdf-bmfont-xml) or by using Needle Engine for Unity where the Needle Engine integration automatically generates MSDF fonts for used font assets.
|
|
20314
|
+
*
|
|
20315
|
+
* @default "https://cdn.needle.tools/static/fonts/msdf/arial/arial"
|
|
20316
|
+
*/
|
|
20317
|
+
set font(val: string | null);
|
|
20318
|
+
get font(): string | null;
|
|
20319
|
+
private _font;
|
|
20320
|
+
/**
|
|
20321
|
+
* Whether to support basic rich text tags in the `text` property. Supported tags include `<b>`, `<i>`, and `<color=hex>`. For example: `Hello <b>World</b>` or `Score: <color=#ff0000>100</color>`
|
|
20322
|
+
* @default false
|
|
20323
|
+
*/
|
|
20324
|
+
set supportRichText(val: boolean);
|
|
20325
|
+
get supportRichText(): boolean;
|
|
20326
|
+
private _supportRichText;
|
|
20327
|
+
/**
|
|
20328
|
+
* Set the alpha factor for the text, which multiplies with the color's alpha to determine overall transparency.
|
|
20329
|
+
*/
|
|
19818
20330
|
setAlphaFactor(factor: number): void;
|
|
20331
|
+
/**
|
|
20332
|
+
* The text content to display. Supports basic rich text tags like `<b>`, `<i>`, and `<color=hex>` if `supportRichText` is enabled.
|
|
20333
|
+
* @default ""
|
|
20334
|
+
*/
|
|
19819
20335
|
get text(): string;
|
|
19820
20336
|
set text(val: string);
|
|
20337
|
+
private _text;
|
|
19821
20338
|
private set_text;
|
|
19822
20339
|
get fontSize(): number;
|
|
19823
20340
|
set fontSize(val: number);
|
|
20341
|
+
private _fontSize;
|
|
19824
20342
|
private sRGBTextColor;
|
|
19825
20343
|
protected onColorChanged(): void;
|
|
19826
20344
|
onParentRectTransformChanged(): void;
|
|
@@ -19828,8 +20346,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19828
20346
|
private updateOverflow;
|
|
19829
20347
|
protected onCreate(_opts: any): void;
|
|
19830
20348
|
onAfterAddedToScene(): void;
|
|
19831
|
-
private _text;
|
|
19832
|
-
private _fontSize;
|
|
19833
20349
|
private _textMeshUi;
|
|
19834
20350
|
private getTextOpts;
|
|
19835
20351
|
onEnable(): void;
|
|
@@ -19856,7 +20372,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19856
20372
|
}
|
|
19857
20373
|
export { Text_2 as Text }
|
|
19858
20374
|
|
|
19859
|
-
declare enum TextAnchor {
|
|
20375
|
+
export declare enum TextAnchor {
|
|
19860
20376
|
UpperLeft = 0,
|
|
19861
20377
|
UpperCenter = 1,
|
|
19862
20378
|
UpperRight = 2,
|
|
@@ -19865,8 +20381,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19865
20381
|
MiddleRight = 5,
|
|
19866
20382
|
LowerLeft = 6,
|
|
19867
20383
|
LowerCenter = 7,
|
|
19868
|
-
LowerRight = 8
|
|
19869
|
-
Custom = 9
|
|
20384
|
+
LowerRight = 8
|
|
19870
20385
|
}
|
|
19871
20386
|
|
|
19872
20387
|
declare enum TextAnchor_2 {
|
|
@@ -19878,7 +20393,8 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19878
20393
|
MiddleRight = 5,
|
|
19879
20394
|
LowerLeft = 6,
|
|
19880
20395
|
LowerCenter = 7,
|
|
19881
|
-
LowerRight = 8
|
|
20396
|
+
LowerRight = 8,
|
|
20397
|
+
Custom = 9
|
|
19882
20398
|
}
|
|
19883
20399
|
|
|
19884
20400
|
export declare class TextBuilder {
|
|
@@ -20082,10 +20598,12 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
20082
20598
|
/** Set the tonemapping mode to e.g. "agx" */
|
|
20083
20599
|
setMode(mode: NEToneMappingModeNames): this;
|
|
20084
20600
|
get isToneMapping(): boolean;
|
|
20085
|
-
|
|
20601
|
+
/** The three.js ToneMapping enum value resolved from the current mode */
|
|
20602
|
+
get threeToneMapping(): ToneMapping;
|
|
20603
|
+
/** The exposure value to apply */
|
|
20604
|
+
get toneMappingExposure(): number;
|
|
20086
20605
|
private _tonemappingEffect;
|
|
20087
20606
|
onCreateEffect(): EffectProviderResult | undefined;
|
|
20088
|
-
onBeforeRender(): void;
|
|
20089
20607
|
}
|
|
20090
20608
|
|
|
20091
20609
|
export declare function toSourceId(src: string | null): SourceIdentifier | undefined;
|
|
@@ -20344,6 +20862,22 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
20344
20862
|
Animation = 3
|
|
20345
20863
|
}
|
|
20346
20864
|
|
|
20865
|
+
/**
|
|
20866
|
+
* Configuration for a transition in the builder
|
|
20867
|
+
*/
|
|
20868
|
+
export declare type TransitionOptions = {
|
|
20869
|
+
/** Duration of the crossfade in seconds (default: 0) */
|
|
20870
|
+
duration?: number;
|
|
20871
|
+
/** Normalized exit time 0-1 (default: 1). Only used when hasExitTime is true */
|
|
20872
|
+
exitTime?: number;
|
|
20873
|
+
/** Whether the transition waits for exitTime before transitioning (default: false) */
|
|
20874
|
+
hasExitTime?: boolean;
|
|
20875
|
+
/** Normalized offset into the destination state's animation (default: 0) */
|
|
20876
|
+
offset?: number;
|
|
20877
|
+
/** Whether duration is in seconds (true) or normalized (false) (default: false) */
|
|
20878
|
+
hasFixedDuration?: boolean;
|
|
20879
|
+
};
|
|
20880
|
+
|
|
20347
20881
|
export declare class TriggerBuilder {
|
|
20348
20882
|
private static __sceneStartTrigger?;
|
|
20349
20883
|
static sceneStartTrigger(): TriggerModel;
|
|
@@ -20479,6 +21013,12 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
20479
21013
|
|
|
20480
21014
|
/* Excluded from this release type: unregisterHotReloadType */
|
|
20481
21015
|
|
|
21016
|
+
/**
|
|
21017
|
+
* Unregister a prefab provider. Forwards to {@link Prefabs.unregister}.
|
|
21018
|
+
* @category Networking
|
|
21019
|
+
*/
|
|
21020
|
+
export declare function unregisterPrefabProvider(key: string): void;
|
|
21021
|
+
|
|
20482
21022
|
export declare function unwatchWrite(vec: Vector_2, cb: Function): void;
|
|
20483
21023
|
|
|
20484
21024
|
export declare class UriSerializer extends TypeSerializer {
|
|
@@ -20987,7 +21527,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
20987
21527
|
protected get primaryAxis(): Axis;
|
|
20988
21528
|
}
|
|
20989
21529
|
|
|
20990
|
-
declare enum VerticalWrapMode {
|
|
21530
|
+
export declare enum VerticalWrapMode {
|
|
20991
21531
|
Truncate = 0,
|
|
20992
21532
|
Overflow = 1
|
|
20993
21533
|
}
|
|
@@ -21446,6 +21986,47 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21446
21986
|
* When enabled debug messages will be printed to the console. This is useful for debugging audio issues. You can also append ?debugvoip to the URL to enable this.
|
|
21447
21987
|
*/
|
|
21448
21988
|
debug: boolean;
|
|
21989
|
+
private _volume;
|
|
21990
|
+
/**
|
|
21991
|
+
* Volume for incoming audio streams (0 = silent, 1 = full volume).
|
|
21992
|
+
* Changes apply immediately to all active incoming streams.
|
|
21993
|
+
*/
|
|
21994
|
+
get volume(): number;
|
|
21995
|
+
set volume(val: number);
|
|
21996
|
+
/**
|
|
21997
|
+
* Get the incoming audio element for a specific user.
|
|
21998
|
+
* Use this to route audio through the Web Audio API for spatial audio, effects, or analysis.
|
|
21999
|
+
* @param userId The connection ID of the remote user
|
|
22000
|
+
* @returns The HTMLAudioElement for this user's stream, or undefined if not connected
|
|
22001
|
+
* @example
|
|
22002
|
+
* ```ts
|
|
22003
|
+
* const audioEl = voip.getAudioElement(userId);
|
|
22004
|
+
* if (audioEl) {
|
|
22005
|
+
* const audioCtx = new AudioContext();
|
|
22006
|
+
* const source = audioCtx.createMediaElementSource(audioEl);
|
|
22007
|
+
* const panner = audioCtx.createPanner();
|
|
22008
|
+
* source.connect(panner).connect(audioCtx.destination);
|
|
22009
|
+
* }
|
|
22010
|
+
* ```
|
|
22011
|
+
*/
|
|
22012
|
+
getAudioElement(userId: string): HTMLAudioElement | undefined;
|
|
22013
|
+
/**
|
|
22014
|
+
* Get all active incoming audio streams as a Map of userId → HTMLAudioElement.
|
|
22015
|
+
* Useful for iterating over all connected voice users.
|
|
22016
|
+
*/
|
|
22017
|
+
get incomingStreams(): ReadonlyMap<string, HTMLAudioElement>;
|
|
22018
|
+
/**
|
|
22019
|
+
* Threshold for speaking detection (0–255). When a user's audio amplitude exceeds this,
|
|
22020
|
+
* they are considered "speaking". Default is 30.
|
|
22021
|
+
*/
|
|
22022
|
+
speakingThreshold: number;
|
|
22023
|
+
/**
|
|
22024
|
+
* Event fired when a user's speaking state changes.
|
|
22025
|
+
* Passes `{ userId: string, isSpeaking: boolean, volume: number }`.
|
|
22026
|
+
*/
|
|
22027
|
+
onSpeakingChanged: EventList;
|
|
22028
|
+
private _speakingStates;
|
|
22029
|
+
private _analysers;
|
|
21449
22030
|
private _net?;
|
|
21450
22031
|
private _menubutton?;
|
|
21451
22032
|
/* Excluded from this release type: awake */
|
|
@@ -21478,6 +22059,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21478
22059
|
private onJoinedRoom;
|
|
21479
22060
|
private onLeftRoom;
|
|
21480
22061
|
private _incomingStreams;
|
|
22062
|
+
/* Excluded from this release type: update */
|
|
22063
|
+
private setupAnalyser;
|
|
22064
|
+
private cleanupAnalyser;
|
|
21481
22065
|
private onReceiveStream;
|
|
21482
22066
|
private onStreamEnded;
|
|
21483
22067
|
private onEnabledChanged;
|
|
@@ -21487,6 +22071,9 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21487
22071
|
/** [Volume](https://engine.needle.tools/docs/api/Volume) The Volume/PostprocessingManager component is responsible for managing post processing effects.
|
|
21488
22072
|
* Add this component to any object in your scene to enable post processing effects.
|
|
21489
22073
|
*
|
|
22074
|
+
* Effects added to this Volume (via profile or code) are pushed to `context.postprocessing` when the Volume is enabled,
|
|
22075
|
+
* and removed when it is disabled.
|
|
22076
|
+
*
|
|
21490
22077
|
* @example Add bloom
|
|
21491
22078
|
* ```ts
|
|
21492
22079
|
* const volume = new Volume();
|
|
@@ -21512,11 +22099,14 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21512
22099
|
* @summary Manage Post-Processing Effects
|
|
21513
22100
|
* @category Rendering
|
|
21514
22101
|
* @category Effects
|
|
22102
|
+
* @see {@link VolumeProfile} for profile-based effect management
|
|
22103
|
+
* @see {@link PostProcessingEffect} for creating custom effects
|
|
22104
|
+
* @see {@link PostProcessing} for core Needle Engine postprocessing control, also accessible via `context.postprocessing`
|
|
21515
22105
|
* @group Components
|
|
21516
22106
|
*/
|
|
21517
22107
|
declare class Volume extends Component implements IEditorModification, IPostProcessingManager {
|
|
21518
22108
|
get isPostProcessingManager(): boolean;
|
|
21519
|
-
/** Currently active postprocessing effects */
|
|
22109
|
+
/** Currently active postprocessing effects managed by this Volume */
|
|
21520
22110
|
get effects(): PostProcessingEffect[];
|
|
21521
22111
|
get dirty(): boolean;
|
|
21522
22112
|
set dirty(value: boolean);
|
|
@@ -21524,6 +22114,7 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21524
22114
|
/**
|
|
21525
22115
|
* Set multisampling to "auto" to automatically adjust the multisampling level based on performance.
|
|
21526
22116
|
* Set to a number to manually set the multisampling level.
|
|
22117
|
+
* Pushed to `context.postprocessing.multisampling` when this Volume is active.
|
|
21527
22118
|
* @default "auto"
|
|
21528
22119
|
* @min 0
|
|
21529
22120
|
* @max renderer.capabilities.maxSamples
|
|
@@ -21532,21 +22123,21 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21532
22123
|
/** When enabled, the device pixel ratio will be gradually reduced when FPS is low
|
|
21533
22124
|
* and restored when performance recovers. This helps maintain smooth frame rates
|
|
21534
22125
|
* on devices where full retina resolution is too expensive for postprocessing.
|
|
22126
|
+
* Pushed to `context.postprocessing.adaptiveResolution` when this Volume is active.
|
|
21535
22127
|
* Disable this if you need a fixed resolution and prefer consistent quality over frame rate.
|
|
21536
22128
|
* @default true
|
|
21537
22129
|
*/
|
|
21538
22130
|
adaptiveResolution: boolean;
|
|
21539
22131
|
/**
|
|
21540
|
-
* Add a post processing effect to
|
|
22132
|
+
* Add a post processing effect to this Volume and push it to the core postprocessing stack.
|
|
21541
22133
|
*/
|
|
21542
22134
|
addEffect<T extends PostProcessingEffect | Effect>(effect: T & {
|
|
21543
22135
|
order?: number;
|
|
21544
22136
|
}): T;
|
|
21545
22137
|
/**
|
|
21546
|
-
* Remove a post processing effect from
|
|
22138
|
+
* Remove a post processing effect from this Volume and the core postprocessing stack.
|
|
21547
22139
|
*/
|
|
21548
22140
|
removeEffect<T extends PostProcessingEffect | Effect>(effect: T): T;
|
|
21549
|
-
private _postprocessing?;
|
|
21550
22141
|
private readonly _activeEffects;
|
|
21551
22142
|
private readonly _effects;
|
|
21552
22143
|
/**
|
|
@@ -21554,17 +22145,17 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
21554
22145
|
*/
|
|
21555
22146
|
markDirty(): void;
|
|
21556
22147
|
/* Excluded from this release type: awake */
|
|
21557
|
-
private
|
|
21558
|
-
private _multisampleAutoChangeTime;
|
|
21559
|
-
private _multisampleAutoDecreaseTime;
|
|
22148
|
+
private _isDirty;
|
|
21560
22149
|
/* Excluded from this release type: onEnable */
|
|
21561
22150
|
/* Excluded from this release type: onDisable */
|
|
21562
22151
|
/* Excluded from this release type: onBeforeRender */
|
|
21563
22152
|
/* Excluded from this release type: onDestroy */
|
|
21564
|
-
|
|
21565
|
-
private
|
|
21566
|
-
|
|
21567
|
-
private
|
|
22153
|
+
/** Collect active effects from profile + code and push them to context.postprocessing */
|
|
22154
|
+
private pushEffectsToCore;
|
|
22155
|
+
/** Remove all effects this Volume contributed from the core stack */
|
|
22156
|
+
private removeEffectsFromCore;
|
|
22157
|
+
/** Push multisampling and adaptiveResolution config to the core stack */
|
|
22158
|
+
private syncConfigToCore;
|
|
21568
22159
|
private _applyPostQueue;
|
|
21569
22160
|
/** called from needle editor sync package if its active */
|
|
21570
22161
|
onEditorModification(modification: EditorModification): void | boolean | undefined;
|
|
@@ -22806,6 +23397,12 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
22806
23397
|
session: NeedleXRSession;
|
|
22807
23398
|
};
|
|
22808
23399
|
|
|
23400
|
+
export declare type XRSessionRequestEventArgs = {
|
|
23401
|
+
readonly mode: XRSessionMode;
|
|
23402
|
+
readonly init: XRSessionInit;
|
|
23403
|
+
readonly context: Context;
|
|
23404
|
+
};
|
|
23405
|
+
|
|
22809
23406
|
export declare class XRState {
|
|
22810
23407
|
static Global: XRState;
|
|
22811
23408
|
Mask: XRStateFlag;
|