@wandelbots/wandelbots-js-react-components 2.26.0-pr.feature-update-to-react-19.361.c3fd41e → 2.26.0-pr.feature-update-to-react-19.361.fbd0985
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/dist/components/utils/interpolation.d.ts +30 -10
- package/dist/components/utils/interpolation.d.ts.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/robots/RobotAnimator.tsx +4 -4
- package/src/components/utils/interpolation.ts +49 -28
|
@@ -62,29 +62,42 @@ export declare class ValueInterpolator {
|
|
|
62
62
|
private velocities;
|
|
63
63
|
constructor(initialValues?: number[], options?: InterpolationOptions);
|
|
64
64
|
/**
|
|
65
|
-
* Update interpolation using spring physics
|
|
66
|
-
*
|
|
65
|
+
* Update interpolation using spring physics
|
|
66
|
+
*
|
|
67
|
+
* Call this method every frame for smooth animation. In React Three Fiber,
|
|
68
|
+
* call from within useFrame callback with the provided delta time.
|
|
69
|
+
*
|
|
70
|
+
* @param delta - Time elapsed since last update in seconds (e.g., 1/60 ≈ 0.0167 for 60fps)
|
|
71
|
+
* @returns true when interpolation is complete (all values reached their targets)
|
|
67
72
|
*/
|
|
68
73
|
update(delta?: number): boolean;
|
|
69
74
|
/**
|
|
70
|
-
* Set new target values to
|
|
71
|
-
*
|
|
75
|
+
* Set new target values for the interpolation to move towards
|
|
76
|
+
*
|
|
77
|
+
* Includes smart blending for very rapid target updates (faster than 120fps)
|
|
78
|
+
* to prevent jarring movements when targets change frequently.
|
|
72
79
|
*/
|
|
73
80
|
setTarget(newValues: number[]): void;
|
|
74
81
|
/**
|
|
75
|
-
* Get
|
|
82
|
+
* Get a copy of all current interpolated values
|
|
76
83
|
*/
|
|
77
84
|
getCurrentValues(): number[];
|
|
78
85
|
/**
|
|
79
|
-
* Get a
|
|
86
|
+
* Get a single interpolated value by its array index
|
|
80
87
|
*/
|
|
81
88
|
getValue(index: number): number;
|
|
82
89
|
/**
|
|
83
|
-
* Check if interpolation is currently
|
|
90
|
+
* Check if automatic interpolation is currently running
|
|
91
|
+
*
|
|
92
|
+
* This only tracks auto-interpolation started with startAutoInterpolation().
|
|
93
|
+
* Manual update() calls are not tracked by this method.
|
|
84
94
|
*/
|
|
85
95
|
isInterpolating(): boolean;
|
|
86
96
|
/**
|
|
87
|
-
* Stop
|
|
97
|
+
* Stop automatic interpolation if it's running
|
|
98
|
+
*
|
|
99
|
+
* This cancels the internal animation frame loop but does not affect
|
|
100
|
+
* manual update() calls.
|
|
88
101
|
*/
|
|
89
102
|
stop(): void;
|
|
90
103
|
/**
|
|
@@ -96,11 +109,18 @@ export declare class ValueInterpolator {
|
|
|
96
109
|
*/
|
|
97
110
|
updateOptions(newOptions: Partial<InterpolationOptions>): void;
|
|
98
111
|
/**
|
|
99
|
-
* Start automatic interpolation
|
|
112
|
+
* Start automatic interpolation with an animation loop
|
|
113
|
+
*
|
|
114
|
+
* This begins a requestAnimationFrame loop that calls update() automatically.
|
|
115
|
+
* For React Three Fiber components, prefer using manual update() calls
|
|
116
|
+
* within useFrame hooks instead.
|
|
100
117
|
*/
|
|
101
118
|
startAutoInterpolation(): void;
|
|
102
119
|
/**
|
|
103
|
-
*
|
|
120
|
+
* Clean up all resources and stop any running animations
|
|
121
|
+
*
|
|
122
|
+
* This cancels any active animation frames and resets internal state.
|
|
123
|
+
* Call this when the component unmounts or is no longer needed.
|
|
104
124
|
*/
|
|
105
125
|
destroy(): void;
|
|
106
126
|
private startInterpolation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../../src/components/utils/interpolation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8E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