@needle-tools/engine 4.3.0-alpha → 4.3.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 +3 -0
- package/dist/needle-engine.bundle.js +1467 -222
- package/dist/needle-engine.bundle.light.js +1467 -222
- package/dist/needle-engine.bundle.light.min.js +32 -32
- package/dist/needle-engine.bundle.light.umd.cjs +3 -3
- package/dist/needle-engine.bundle.min.js +3 -3
- package/dist/needle-engine.bundle.umd.cjs +3 -3
- package/dist/needle-engine.light.d.ts +9 -9
- package/lib/engine/engine_types.d.ts +162 -17
- package/lib/engine-components/Animator.d.ts +129 -21
- package/lib/engine-components/Animator.js +115 -21
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/AnimatorController.d.ts +161 -32
- package/lib/engine-components/AnimatorController.js +176 -29
- package/lib/engine-components/AnimatorController.js.map +1 -1
- package/lib/engine-components/AudioListener.d.ts +16 -5
- package/lib/engine-components/AudioListener.js +16 -5
- package/lib/engine-components/AudioListener.js.map +1 -1
- package/lib/engine-components/AudioSource.d.ts +120 -28
- package/lib/engine-components/AudioSource.js +120 -37
- package/lib/engine-components/AudioSource.js.map +1 -1
- package/lib/engine-components/AvatarLoader.d.ts +61 -0
- package/lib/engine-components/AvatarLoader.js +61 -1
- package/lib/engine-components/AvatarLoader.js.map +1 -1
- package/lib/engine-components/AxesHelper.d.ts +19 -1
- package/lib/engine-components/AxesHelper.js +19 -1
- package/lib/engine-components/AxesHelper.js.map +1 -1
- package/lib/engine-components/BoxHelperComponent.d.ts +26 -0
- package/lib/engine-components/BoxHelperComponent.js +26 -0
- package/lib/engine-components/BoxHelperComponent.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +126 -37
- package/lib/engine-components/Camera.js +139 -37
- package/lib/engine-components/Camera.js.map +1 -1
- package/lib/engine-components/CameraUtils.js +20 -0
- package/lib/engine-components/CameraUtils.js.map +1 -1
- package/lib/engine-components/Collider.d.ts +95 -21
- package/lib/engine-components/Collider.js +100 -23
- package/lib/engine-components/Collider.js.map +1 -1
- package/lib/engine-components/Component.d.ts +554 -106
- package/lib/engine-components/Component.js +352 -81
- package/lib/engine-components/Component.js.map +1 -1
- package/lib/engine-components/DragControls.d.ts +95 -21
- package/lib/engine-components/DragControls.js +126 -32
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/DropListener.d.ts +99 -16
- package/lib/engine-components/DropListener.js +119 -14
- package/lib/engine-components/DropListener.js.map +1 -1
- package/lib/engine-components/Light.d.ts +102 -5
- package/lib/engine-components/Light.js +102 -44
- package/lib/engine-components/Light.js.map +1 -1
- package/lib/engine-components/NeedleMenu.d.ts +28 -11
- package/lib/engine-components/NeedleMenu.js +28 -11
- package/lib/engine-components/NeedleMenu.js.map +1 -1
- package/lib/engine-components/Networking.d.ts +37 -5
- package/lib/engine-components/Networking.js +37 -5
- package/lib/engine-components/Networking.js.map +1 -1
- package/lib/engine-components/SceneSwitcher.js +44 -0
- package/lib/engine-components/SceneSwitcher.js.map +1 -1
- package/lib/engine-components/SpatialTrigger.d.ts +66 -1
- package/lib/engine-components/SpatialTrigger.js +74 -2
- package/lib/engine-components/SpatialTrigger.js.map +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +66 -4
- package/lib/engine-components/SpectatorCamera.js +132 -6
- package/lib/engine-components/SpectatorCamera.js.map +1 -1
- package/lib/engine-components/SyncedTransform.d.ts +45 -6
- package/lib/engine-components/SyncedTransform.js +45 -6
- package/lib/engine-components/SyncedTransform.js.map +1 -1
- package/lib/engine-components/TransformGizmo.d.ts +49 -3
- package/lib/engine-components/TransformGizmo.js +49 -3
- package/lib/engine-components/TransformGizmo.js.map +1 -1
- package/lib/engine-components/webxr/WebXR.d.ts +131 -22
- package/lib/engine-components/webxr/WebXR.js +132 -23
- package/lib/engine-components/webxr/WebXR.js.map +1 -1
- package/lib/engine-components-experimental/networking/PlayerSync.d.ts +82 -9
- package/lib/engine-components-experimental/networking/PlayerSync.js +76 -11
- package/lib/engine-components-experimental/networking/PlayerSync.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_types.ts +179 -18
- package/src/engine-components/Animator.ts +142 -22
- package/src/engine-components/AnimatorController.ts +184 -34
- package/src/engine-components/AudioListener.ts +16 -5
- package/src/engine-components/AudioSource.ts +126 -37
- package/src/engine-components/AvatarLoader.ts +61 -2
- package/src/engine-components/AxesHelper.ts +21 -1
- package/src/engine-components/BoxHelperComponent.ts +26 -0
- package/src/engine-components/Camera.ts +147 -41
- package/src/engine-components/CameraUtils.ts +20 -0
- package/src/engine-components/Collider.ts +102 -27
- package/src/engine-components/Component.ts +605 -129
- package/src/engine-components/DragControls.ts +134 -38
- package/src/engine-components/DropListener.ts +143 -23
- package/src/engine-components/Light.ts +105 -44
- package/src/engine-components/NeedleMenu.ts +29 -11
- package/src/engine-components/Networking.ts +37 -6
- package/src/engine-components/SceneSwitcher.ts +48 -1
- package/src/engine-components/SpatialTrigger.ts +80 -3
- package/src/engine-components/SpectatorCamera.ts +136 -18
- package/src/engine-components/SyncedTransform.ts +50 -7
- package/src/engine-components/TransformGizmo.ts +49 -4
- package/src/engine-components/webxr/WebXR.ts +144 -27
- package/src/engine-components-experimental/networking/PlayerSync.ts +85 -13
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
export { }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
declare global {
|
|
5
|
-
interface NavigatorUAData {
|
|
6
|
-
platform: string;
|
|
7
|
-
}
|
|
8
|
-
interface Navigator {
|
|
9
|
-
userAgentData?: NavigatorUAData;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
4
|
declare module 'three' {
|
|
14
5
|
interface SkinnedMesh {
|
|
15
6
|
staticGenerator?: StaticGeometryGenerator;
|
|
@@ -25,6 +16,15 @@ declare module 'three' {
|
|
|
25
16
|
}
|
|
26
17
|
}
|
|
27
18
|
|
|
19
|
+
declare global {
|
|
20
|
+
interface NavigatorUAData {
|
|
21
|
+
platform: string;
|
|
22
|
+
}
|
|
23
|
+
interface Navigator {
|
|
24
|
+
userAgentData?: NavigatorUAData;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
28
|
declare module 'three' {
|
|
29
29
|
interface Object3D {
|
|
30
30
|
get guid(): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="webxr" />
|
|
2
|
-
import type { QueryFilterFlags } from "@dimforge/rapier3d-compat";
|
|
2
|
+
import type { QueryFilterFlags, World } from "@dimforge/rapier3d-compat";
|
|
3
3
|
import { AnimationClip, Color, Material, Mesh, Object3D, Quaternion } from "three";
|
|
4
4
|
import { Vector3 } from "three";
|
|
5
5
|
import { type GLTF as THREE_GLTF } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
@@ -335,69 +335,214 @@ export declare class SphereOverlapResult {
|
|
|
335
335
|
constructor(object: Object3D, collider: ICollider);
|
|
336
336
|
}
|
|
337
337
|
export interface IPhysicsEngine {
|
|
338
|
+
/** Initializes the physics engine */
|
|
338
339
|
initialize(): Promise<boolean>;
|
|
340
|
+
/** Indicates whether the physics engine has been initialized */
|
|
339
341
|
get isInitialized(): boolean;
|
|
342
|
+
/** Advances physics simulation by the given time step */
|
|
340
343
|
step(dt: number): void;
|
|
341
344
|
postStep(): any;
|
|
345
|
+
/** Indicates whether the physics engine is currently updating */
|
|
342
346
|
get isUpdating(): boolean;
|
|
343
|
-
/**
|
|
347
|
+
/** Clears all cached data (e.g., mesh data when creating scaled mesh colliders) */
|
|
344
348
|
clearCaches(): any;
|
|
349
|
+
/** Enables or disables the physics engine */
|
|
345
350
|
enabled: boolean;
|
|
346
|
-
|
|
351
|
+
/** Returns the underlying physics world object */
|
|
352
|
+
get world(): World | undefined;
|
|
353
|
+
/** Sets the gravity vector for the physics simulation */
|
|
347
354
|
set gravity(vec3: Vec3);
|
|
355
|
+
/** Gets the current gravity vector */
|
|
348
356
|
get gravity(): Vec3;
|
|
349
|
-
/**
|
|
357
|
+
/**
|
|
358
|
+
* Gets the rapier physics body for a Needle component
|
|
359
|
+
* @param obj The collider or rigidbody component
|
|
360
|
+
* @returns The underlying physics body or null if not found
|
|
361
|
+
*/
|
|
350
362
|
getBody(obj: ICollider | IRigidbody): null | any;
|
|
351
|
-
/**
|
|
363
|
+
/**
|
|
364
|
+
* Gets the Needle Engine component for a rapier physics object
|
|
365
|
+
* @param rapierObject The rapier physics object
|
|
366
|
+
* @returns The associated component or null if not found
|
|
367
|
+
*/
|
|
352
368
|
getComponent(rapierObject: object): IComponent | null;
|
|
353
|
-
/**
|
|
354
|
-
*
|
|
355
|
-
* @param
|
|
356
|
-
* @param
|
|
369
|
+
/**
|
|
370
|
+
* Performs a fast raycast against physics colliders
|
|
371
|
+
* @param origin Ray origin in screen or worldspace
|
|
372
|
+
* @param direction Ray direction in worldspace
|
|
373
|
+
* @param options Additional raycast configuration options
|
|
374
|
+
* @returns Raycast result containing hit point and collider, or null if no hit
|
|
357
375
|
*/
|
|
358
376
|
raycast(origin?: Vec2 | Vec3, direction?: Vec3, options?: {
|
|
359
377
|
maxDistance?: number;
|
|
360
378
|
/** True if you want to also hit objects when the raycast starts from inside a collider */
|
|
361
379
|
solid?: boolean;
|
|
362
380
|
queryFilterFlags?: QueryFilterFlags;
|
|
363
|
-
/**
|
|
364
|
-
*
|
|
381
|
+
/**
|
|
382
|
+
* Raycast filter groups. Groups are used to apply the collision group rules for the scene query.
|
|
383
|
+
* The scene query will only consider hits with colliders with collision groups compatible with
|
|
384
|
+
* this collision group (using the bitwise test described in the collision groups section).
|
|
385
|
+
* For example membership 0x0001 and filter 0x0002 should be 0x00010002
|
|
386
|
+
* @see https://rapier.rs/docs/user_guides/javascript/colliders#collision-groups-and-solver-groups
|
|
387
|
+
*/
|
|
365
388
|
filterGroups?: number;
|
|
366
|
-
/**
|
|
389
|
+
/**
|
|
390
|
+
* Predicate to filter colliders in raycast results
|
|
391
|
+
* @param collider The collider being tested
|
|
392
|
+
* @returns False to ignore this collider, true to include it
|
|
393
|
+
*/
|
|
367
394
|
filterPredicate?: (collider: ICollider) => boolean;
|
|
368
395
|
}): RaycastResult;
|
|
369
|
-
/**
|
|
396
|
+
/**
|
|
397
|
+
* Performs a raycast that also returns the normal vector at the hit point
|
|
398
|
+
* @param origin Ray origin in screen or worldspace
|
|
399
|
+
* @param direction Ray direction in worldspace
|
|
400
|
+
* @param options Additional raycast configuration options
|
|
401
|
+
* @returns Raycast result containing hit point, normal, and collider, or null if no hit
|
|
402
|
+
*/
|
|
370
403
|
raycastAndGetNormal(origin?: Vec2 | Vec3, direction?: Vec3, options?: {
|
|
371
404
|
maxDistance?: number;
|
|
372
405
|
/** True if you want to also hit objects when the raycast starts from inside a collider */
|
|
373
406
|
solid?: boolean;
|
|
374
407
|
queryFilterFlags?: QueryFilterFlags;
|
|
375
|
-
/**
|
|
376
|
-
*
|
|
408
|
+
/**
|
|
409
|
+
* Raycast filter groups. Groups are used to apply the collision group rules for the scene query.
|
|
410
|
+
* The scene query will only consider hits with colliders with collision groups compatible with
|
|
411
|
+
* this collision group (using the bitwise test described in the collision groups section).
|
|
412
|
+
* For example membership 0x0001 and filter 0x0002 should be 0x00010002
|
|
413
|
+
* @see https://rapier.rs/docs/user_guides/javascript/colliders#collision-groups-and-solver-groups
|
|
414
|
+
*/
|
|
377
415
|
filterGroups?: number;
|
|
378
|
-
/**
|
|
416
|
+
/**
|
|
417
|
+
* Predicate to filter colliders in raycast results
|
|
418
|
+
* @param collider The collider being tested
|
|
419
|
+
* @returns False to ignore this collider, true to include it
|
|
420
|
+
*/
|
|
379
421
|
filterPredicate?: (collider: ICollider) => boolean;
|
|
380
422
|
}): RaycastResult;
|
|
423
|
+
/**
|
|
424
|
+
* Finds all colliders within a sphere
|
|
425
|
+
* @param point The center point of the sphere
|
|
426
|
+
* @param radius The radius of the sphere
|
|
427
|
+
* @returns Array of objects that overlap with the sphere
|
|
428
|
+
*/
|
|
381
429
|
sphereOverlap(point: Vector3, radius: number): Array<SphereOverlapResult>;
|
|
430
|
+
/**
|
|
431
|
+
* Adds a sphere collider to the physics world
|
|
432
|
+
* @param collider The collider component to add
|
|
433
|
+
*/
|
|
382
434
|
addSphereCollider(collider: ICollider): any;
|
|
435
|
+
/**
|
|
436
|
+
* Adds a box collider to the physics world
|
|
437
|
+
* @param collider The collider component to add
|
|
438
|
+
* @param size The size of the box
|
|
439
|
+
*/
|
|
383
440
|
addBoxCollider(collider: ICollider, size: Vector3): any;
|
|
441
|
+
/**
|
|
442
|
+
* Adds a capsule collider to the physics world
|
|
443
|
+
* @param collider The collider component to add
|
|
444
|
+
* @param radius The radius of the capsule
|
|
445
|
+
* @param height The height of the capsule
|
|
446
|
+
*/
|
|
384
447
|
addCapsuleCollider(collider: ICollider, radius: number, height: number): any;
|
|
448
|
+
/**
|
|
449
|
+
* Adds a mesh collider to the physics world
|
|
450
|
+
* @param collider The collider component to add
|
|
451
|
+
* @param mesh The mesh to use for collision
|
|
452
|
+
* @param convex Whether the collision mesh should be treated as convex
|
|
453
|
+
* @param scale Optional scale to apply to the mesh
|
|
454
|
+
*/
|
|
385
455
|
addMeshCollider(collider: ICollider, mesh: Mesh, convex: boolean, scale?: Vector3 | undefined): any;
|
|
456
|
+
/**
|
|
457
|
+
* Updates the physics material properties of a collider
|
|
458
|
+
* @param collider The collider to update
|
|
459
|
+
*/
|
|
386
460
|
updatePhysicsMaterial(collider: ICollider): any;
|
|
461
|
+
/**
|
|
462
|
+
* Wakes up a sleeping rigidbody
|
|
463
|
+
* @param rb The rigidbody to wake up
|
|
464
|
+
*/
|
|
387
465
|
wakeup(rb: IRigidbody): any;
|
|
466
|
+
/**
|
|
467
|
+
* Checks if a rigidbody is currently sleeping
|
|
468
|
+
* @param rb The rigidbody to check
|
|
469
|
+
* @returns Whether the rigidbody is sleeping or undefined if cannot be determined
|
|
470
|
+
*/
|
|
388
471
|
isSleeping(rb: IRigidbody): boolean | undefined;
|
|
472
|
+
/**
|
|
473
|
+
* Updates the physical properties of a rigidbody or collider
|
|
474
|
+
* @param rb The rigidbody or collider to update
|
|
475
|
+
*/
|
|
389
476
|
updateProperties(rb: IRigidbody | ICollider): any;
|
|
477
|
+
/**
|
|
478
|
+
* Resets all forces acting on a rigidbody
|
|
479
|
+
* @param rb The rigidbody to reset forces on
|
|
480
|
+
* @param wakeup Whether to wake up the rigidbody
|
|
481
|
+
*/
|
|
390
482
|
resetForces(rb: IRigidbody, wakeup: boolean): any;
|
|
483
|
+
/**
|
|
484
|
+
* Resets all torques acting on a rigidbody
|
|
485
|
+
* @param rb The rigidbody to reset torques on
|
|
486
|
+
* @param wakeup Whether to wake up the rigidbody
|
|
487
|
+
*/
|
|
391
488
|
resetTorques(rb: IRigidbody, wakeup: boolean): any;
|
|
489
|
+
/**
|
|
490
|
+
* Adds a continuous force to a rigidbody
|
|
491
|
+
* @param rb The rigidbody to add force to
|
|
492
|
+
* @param vec The force vector to add
|
|
493
|
+
* @param wakeup Whether to wake up the rigidbody
|
|
494
|
+
*/
|
|
392
495
|
addForce(rb: IRigidbody, vec: Vec3, wakeup: boolean): any;
|
|
496
|
+
/**
|
|
497
|
+
* Applies an instantaneous impulse to a rigidbody
|
|
498
|
+
* @param rb The rigidbody to apply impulse to
|
|
499
|
+
* @param vec The impulse vector to apply
|
|
500
|
+
* @param wakeup Whether to wake up the rigidbody
|
|
501
|
+
*/
|
|
393
502
|
applyImpulse(rb: IRigidbody, vec: Vec3, wakeup: boolean): any;
|
|
394
|
-
/**
|
|
503
|
+
/**
|
|
504
|
+
* Gets the linear velocity of a rigidbody or the rigidbody attached to a collider
|
|
505
|
+
* @param rb The rigidbody or collider to get velocity from
|
|
506
|
+
* @returns The linear velocity vector or null if not available
|
|
507
|
+
*/
|
|
395
508
|
getLinearVelocity(rb: IRigidbody | ICollider): Vec3 | null;
|
|
509
|
+
/**
|
|
510
|
+
* Gets the angular velocity of a rigidbody
|
|
511
|
+
* @param rb The rigidbody to get angular velocity from
|
|
512
|
+
* @returns The angular velocity vector or null if not available
|
|
513
|
+
*/
|
|
396
514
|
getAngularVelocity(rb: IRigidbody): Vec3 | null;
|
|
515
|
+
/**
|
|
516
|
+
* Sets the angular velocity of a rigidbody
|
|
517
|
+
* @param rb The rigidbody to set angular velocity for
|
|
518
|
+
* @param vec The angular velocity vector to set
|
|
519
|
+
* @param wakeup Whether to wake up the rigidbody
|
|
520
|
+
*/
|
|
397
521
|
setAngularVelocity(rb: IRigidbody, vec: Vec3, wakeup: boolean): any;
|
|
522
|
+
/**
|
|
523
|
+
* Sets the linear velocity of a rigidbody
|
|
524
|
+
* @param rb The rigidbody to set linear velocity for
|
|
525
|
+
* @param vec The linear velocity vector to set
|
|
526
|
+
* @param wakeup Whether to wake up the rigidbody
|
|
527
|
+
*/
|
|
398
528
|
setLinearVelocity(rb: IRigidbody, vec: Vec3, wakeup: boolean): any;
|
|
529
|
+
/**
|
|
530
|
+
* Updates the position and/or rotation of a physics body
|
|
531
|
+
* @param comp The collider or rigidbody component to update
|
|
532
|
+
* @param translation Whether to update the position
|
|
533
|
+
* @param rotation Whether to update the rotation
|
|
534
|
+
*/
|
|
399
535
|
updateBody(comp: ICollider | IRigidbody, translation: boolean, rotation: boolean): any;
|
|
536
|
+
/**
|
|
537
|
+
* Removes a physics body from the simulation
|
|
538
|
+
* @param body The component whose physics body should be removed
|
|
539
|
+
*/
|
|
400
540
|
removeBody(body: IComponent): any;
|
|
541
|
+
/**
|
|
542
|
+
* Gets the physics body for a component
|
|
543
|
+
* @param obj The collider or rigidbody component
|
|
544
|
+
* @returns The underlying physics body or null if not found
|
|
545
|
+
*/
|
|
401
546
|
getBody(obj: ICollider | IRigidbody): null | any;
|
|
402
547
|
addFixedJoint(body1: IRigidbody, body2: IRigidbody): any;
|
|
403
548
|
addHingeJoint(body1: IRigidbody, body2: IRigidbody, anchor: Vec3, axis: Vec3): any;
|
|
@@ -3,97 +3,205 @@ import { IAnimationComponent } from "../engine/engine_types.js";
|
|
|
3
3
|
import type { AnimatorControllerModel } from "../engine/extensions/NEEDLE_animator_controller_model.js";
|
|
4
4
|
import { AnimatorController } from "./AnimatorController.js";
|
|
5
5
|
import { Behaviour } from "./Component.js";
|
|
6
|
+
/**
|
|
7
|
+
* Represents an event emitted by an animation mixer
|
|
8
|
+
* @category Animation and Sequencing
|
|
9
|
+
*/
|
|
6
10
|
export declare class MixerEvent {
|
|
11
|
+
/** The type of event that occurred */
|
|
7
12
|
type: string;
|
|
13
|
+
/** The animation action that triggered this event */
|
|
8
14
|
action: AnimationAction;
|
|
15
|
+
/** Number of loops completed in this cycle */
|
|
9
16
|
loopDelta: number;
|
|
17
|
+
/** The animation mixer that emitted this event */
|
|
10
18
|
target: AnimationMixer;
|
|
11
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Configuration options for playing animations
|
|
22
|
+
* @category Animation and Sequencing
|
|
23
|
+
*/
|
|
12
24
|
export declare class PlayOptions {
|
|
25
|
+
/** Whether the animation should loop, and if so, which loop style to use */
|
|
13
26
|
loop?: boolean | AnimationActionLoopStyles;
|
|
27
|
+
/** Whether the final animation state should be maintained after playback completes */
|
|
14
28
|
clampWhenFinished?: boolean;
|
|
15
29
|
}
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
30
|
+
/**
|
|
31
|
+
* The Animator component plays and manages animations on a GameObject.
|
|
32
|
+
* It works with an AnimatorController to handle state transitions and animation blending.
|
|
33
|
+
* A new AnimatorController can be created from code via `AnimatorController.createFromClips`.
|
|
18
34
|
* @category Animation and Sequencing
|
|
19
35
|
* @group Components
|
|
20
36
|
*/
|
|
21
37
|
export declare class Animator extends Behaviour implements IAnimationComponent {
|
|
38
|
+
/**
|
|
39
|
+
* Identifies this component as an animation component in the engine
|
|
40
|
+
*/
|
|
22
41
|
get isAnimationComponent(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* When enabled, animation will affect the root transform position and rotation
|
|
44
|
+
*/
|
|
23
45
|
applyRootMotion: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Indicates whether this animator contains root motion data
|
|
48
|
+
*/
|
|
24
49
|
hasRootMotion: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* When enabled, the animator will maintain its state when the component is disabled
|
|
52
|
+
*/
|
|
25
53
|
keepAnimatorControllerStateOnDisable: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Sets or replaces the animator controller for this component.
|
|
56
|
+
* Handles binding the controller to this animator instance and ensures
|
|
57
|
+
* proper initialization when the controller changes.
|
|
58
|
+
* @param val The animator controller model or instance to use
|
|
59
|
+
*/
|
|
26
60
|
set runtimeAnimatorController(val: AnimatorControllerModel | AnimatorController | undefined | null);
|
|
61
|
+
/**
|
|
62
|
+
* Gets the current animator controller instance
|
|
63
|
+
* @returns The current animator controller or null if none is assigned
|
|
64
|
+
*/
|
|
27
65
|
get runtimeAnimatorController(): AnimatorController | undefined | null;
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @returns
|
|
31
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves information about the current animation state
|
|
68
|
+
* @returns The current state information, or undefined if no state is playing
|
|
69
|
+
*/
|
|
32
70
|
getCurrentStateInfo(): import("../engine/extensions/NEEDLE_animator_controller_model.js").AnimatorStateInfo | null | undefined;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
|
|
71
|
+
/**
|
|
72
|
+
* The currently playing animation action that can be used to modify animation properties
|
|
73
|
+
* @returns The current animation action, or null if no animation is playing
|
|
74
|
+
*/
|
|
36
75
|
get currentAction(): AnimationAction | null;
|
|
37
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Indicates whether animation parameters have been modified since the last update
|
|
78
|
+
* @returns True if parameters have been changed
|
|
79
|
+
*/
|
|
38
80
|
get parametersAreDirty(): boolean;
|
|
39
81
|
private _parametersAreDirty;
|
|
40
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Indicates whether the animator state has changed since the last update
|
|
84
|
+
* @returns True if the animator has been changed
|
|
85
|
+
*/
|
|
41
86
|
get isDirty(): boolean;
|
|
42
87
|
private _isDirty;
|
|
43
88
|
/**@deprecated use play() */
|
|
44
89
|
Play(name: string | number, layer?: number, normalizedTime?: number, transitionDurationInSec?: number): void;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @
|
|
51
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Plays an animation on the animator
|
|
92
|
+
* @param name The name or hash of the animation to play
|
|
93
|
+
* @param layer The layer to play the animation on (-1 for default layer)
|
|
94
|
+
* @param normalizedTime The time position to start playing (0-1 range, NEGATIVE_INFINITY for current position)
|
|
95
|
+
* @param transitionDurationInSec The duration of the blend transition in seconds
|
|
96
|
+
*/
|
|
52
97
|
play(name: string | number, layer?: number, normalizedTime?: number, transitionDurationInSec?: number): void;
|
|
53
98
|
/**@deprecated use reset */
|
|
54
99
|
Reset(): void;
|
|
55
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Resets the animator controller to its initial state
|
|
102
|
+
*/
|
|
56
103
|
reset(): void;
|
|
57
104
|
/**@deprecated use setBool */
|
|
58
105
|
SetBool(name: string | number, val: boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* Sets a boolean parameter in the animator
|
|
108
|
+
* @param name The name or hash of the parameter
|
|
109
|
+
* @param value The boolean value to set
|
|
110
|
+
*/
|
|
59
111
|
setBool(name: string | number, value: boolean): void;
|
|
60
112
|
/**@deprecated use getBool */
|
|
61
113
|
GetBool(name: string | number): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Gets a boolean parameter from the animator
|
|
116
|
+
* @param name The name or hash of the parameter
|
|
117
|
+
* @returns The value of the boolean parameter, or false if not found
|
|
118
|
+
*/
|
|
62
119
|
getBool(name: string | number): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Toggles a boolean parameter between true and false
|
|
122
|
+
* @param name The name or hash of the parameter
|
|
123
|
+
*/
|
|
63
124
|
toggleBool(name: string | number): void;
|
|
64
125
|
/**@deprecated use setFloat */
|
|
65
126
|
SetFloat(name: string | number, val: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Sets a float parameter in the animator
|
|
129
|
+
* @param name The name or hash of the parameter
|
|
130
|
+
* @param val The float value to set
|
|
131
|
+
*/
|
|
66
132
|
setFloat(name: string | number, val: number): void;
|
|
67
133
|
/**@deprecated use getFloat */
|
|
68
134
|
GetFloat(name: string | number): number;
|
|
135
|
+
/**
|
|
136
|
+
* Gets a float parameter from the animator
|
|
137
|
+
* @param name The name or hash of the parameter
|
|
138
|
+
* @returns The value of the float parameter, or -1 if not found
|
|
139
|
+
*/
|
|
69
140
|
getFloat(name: string | number): number;
|
|
70
141
|
/**@deprecated use setInteger */
|
|
71
142
|
SetInteger(name: string | number, val: number): void;
|
|
143
|
+
/**
|
|
144
|
+
* Sets an integer parameter in the animator
|
|
145
|
+
* @param name The name or hash of the parameter
|
|
146
|
+
* @param val The integer value to set
|
|
147
|
+
*/
|
|
72
148
|
setInteger(name: string | number, val: number): void;
|
|
73
149
|
/**@deprecated use getInteger */
|
|
74
150
|
GetInteger(name: string | number): number;
|
|
151
|
+
/**
|
|
152
|
+
* Gets an integer parameter from the animator
|
|
153
|
+
* @param name The name or hash of the parameter
|
|
154
|
+
* @returns The value of the integer parameter, or -1 if not found
|
|
155
|
+
*/
|
|
75
156
|
getInteger(name: string | number): number;
|
|
76
157
|
/**@deprecated use setTrigger */
|
|
77
158
|
SetTrigger(name: string | number): void;
|
|
159
|
+
/**
|
|
160
|
+
* Activates a trigger parameter in the animator
|
|
161
|
+
* @param name The name or hash of the trigger parameter
|
|
162
|
+
*/
|
|
78
163
|
setTrigger(name: string | number): void;
|
|
79
164
|
/**@deprecated use resetTrigger */
|
|
80
165
|
ResetTrigger(name: string | number): void;
|
|
166
|
+
/**
|
|
167
|
+
* Resets a trigger parameter in the animator
|
|
168
|
+
* @param name The name or hash of the trigger parameter
|
|
169
|
+
*/
|
|
81
170
|
resetTrigger(name: string | number): void;
|
|
82
171
|
/**@deprecated use getTrigger */
|
|
83
172
|
GetTrigger(name: string | number): void;
|
|
173
|
+
/**
|
|
174
|
+
* Gets the state of a trigger parameter from the animator
|
|
175
|
+
* @param name The name or hash of the trigger parameter
|
|
176
|
+
* @returns The state of the trigger parameter
|
|
177
|
+
*/
|
|
84
178
|
getTrigger(name: string | number): boolean | undefined;
|
|
85
179
|
/**@deprecated use isInTransition */
|
|
86
180
|
IsInTransition(): boolean;
|
|
87
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Checks if the animator is currently in a transition between states
|
|
183
|
+
* @returns True if the animator is currently blending between animations
|
|
184
|
+
*/
|
|
88
185
|
isInTransition(): boolean;
|
|
89
186
|
/**@deprecated use setSpeed */
|
|
90
187
|
SetSpeed(speed: number): void;
|
|
188
|
+
/**
|
|
189
|
+
* Sets the playback speed of the animator
|
|
190
|
+
* @param speed The new playback speed multiplier
|
|
191
|
+
*/
|
|
91
192
|
setSpeed(speed: number): void;
|
|
92
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* Sets a random playback speed between the min and max values
|
|
195
|
+
* @param minMax Object with x (minimum) and y (maximum) speed values
|
|
196
|
+
*/
|
|
93
197
|
set minMaxSpeed(minMax: {
|
|
94
198
|
x: number;
|
|
95
199
|
y: number;
|
|
96
200
|
});
|
|
201
|
+
/**
|
|
202
|
+
* Sets a random normalized time offset for animations between min (x) and max (y) values
|
|
203
|
+
* @param minMax Object with x (min) and y (max) values for the offset range
|
|
204
|
+
*/
|
|
97
205
|
set minMaxOffsetNormalized(minMax: {
|
|
98
206
|
x: number;
|
|
99
207
|
y: number;
|