@woosh/meep-engine 2.134.3 → 2.134.4
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/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.134.
|
|
8
|
+
"version": "2.134.4",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -136,12 +136,15 @@ export class AnimationCurve implements Iterable<Keyframe> {
|
|
|
136
136
|
*/
|
|
137
137
|
alignTangents(index: number): void;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* @deprecated
|
|
140
140
|
* @param {number} index Index of keyframe to be affected
|
|
141
141
|
* @param {number} weight How much smoothing to apply, 1 will be fully smoothed out and 0 will have no effect at all. Value between 0 and 1
|
|
142
142
|
*/
|
|
143
143
|
smoothTangents(index: number, weight: number): void;
|
|
144
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Smooth out the curve
|
|
146
|
+
*/
|
|
147
|
+
alignAllTangents(): void;
|
|
145
148
|
/**
|
|
146
149
|
* The copy is deep
|
|
147
150
|
* @param {AnimationCurve} other
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationCurve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/AnimationCurve.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationCurve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/AnimationCurve.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,gDANwB,QAAQ;IAqZ5B;;;;OAIG;IACH,kBAHW,QAAQ,EAAE,GACR,cAAc,CAQ1B;IAED;;;;;;;;;OASG;IACH,6BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAUzB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,YACN,MAAM,UACN,MAAM,GACL,cAAc,CAOzB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAezB;IAldD;;;;;OAKG;IACH,eAFU,QAAQ,EAAE,CAEV;IAEV;;;;;OAKG;IACH,SAHW,QAAQ,GACN,MAAM,CAuClB;IAED;;;OAGG;IACH,cAFW,QAAQ,EAAE,QAUpB;IAED;;;;OAIG;IACH,YAHW,QAAQ,GACN,OAAO,CAYnB;IAED;;OAEG;IACH,cAEC;IAGD;;;OAGG;IACH,WAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,qBAEC;IAED;;;;OAIG;IACH,yBAUC;IAED;;;;OAIG;IACH,uBAUC;IAED;;;;OAIG;IACH,uBAcC;IAED;;;;;;OAMG;IACH,qBAHW,MAAM,GACJ,MAAM,CAmDlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACL,MAAM,CAoCjB;IAED;;;;OAIG;IACH,qBAFW,MAAM,QAmChB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;IAED;;OAEG;IACH,yBAQC;IAGD;;;OAGG;IACH,YAFW,cAAc,QAIxB;IAED;;;OAGG;IACH,SAFY,cAAc,CAQzB;IAED;;;;OAIG;IACH,cAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;MAIC;IAED;;aAkBC;IAoFL;;;;OAIG;IACH,2BAFU,OAAO,CAEwB;IAGzC;;OAEG;IACH,0BA1Te,MAAM,KACJ,MAAM,CAyTmB;IA7FtC,wDAQC;CAuEJ;yBA/ewB,eAAe"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { computeHashArray } from "../../../core/collection/array/computeHashArray.js";
|
|
3
3
|
import { isArrayEqual } from "../../../core/collection/array/isArrayEqual.js";
|
|
4
|
-
import { lerp } from "../../../core/math/lerp.js";
|
|
5
4
|
import { invokeObjectClone } from "../../../core/model/object/invokeObjectClone.js";
|
|
6
5
|
import { invokeObjectHash } from "../../../core/model/object/invokeObjectHash.js";
|
|
7
6
|
import { invokeObjectToJSON } from "../../../core/model/object/invokeObjectToJSON.js";
|
|
@@ -337,25 +336,24 @@ export class AnimationCurve {
|
|
|
337
336
|
}
|
|
338
337
|
|
|
339
338
|
/**
|
|
340
|
-
*
|
|
339
|
+
* @deprecated
|
|
341
340
|
* @param {number} index Index of keyframe to be affected
|
|
342
341
|
* @param {number} weight How much smoothing to apply, 1 will be fully smoothed out and 0 will have no effect at all. Value between 0 and 1
|
|
343
342
|
*/
|
|
344
343
|
smoothTangents(index, weight) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
const key = keys[index];
|
|
348
|
-
|
|
349
|
-
const average = lerp(key.inTangent, key.outTangent, 0.5);
|
|
350
|
-
|
|
351
|
-
key.inTangent = lerp(key.inTangent, average, weight);
|
|
352
|
-
key.outTangent = lerp(key.outTangent, average, weight);
|
|
344
|
+
throw new Error('Deprecated, use alignTagents() instead');
|
|
353
345
|
}
|
|
354
346
|
|
|
355
|
-
|
|
347
|
+
/**
|
|
348
|
+
* Smooth out the curve
|
|
349
|
+
*/
|
|
350
|
+
alignAllTangents() {
|
|
356
351
|
const n = this.length;
|
|
352
|
+
|
|
353
|
+
// TODO add support for looping curves
|
|
354
|
+
|
|
357
355
|
for (let i = 0; i < n; i++) {
|
|
358
|
-
this.
|
|
356
|
+
this.alignTangents(i);
|
|
359
357
|
}
|
|
360
358
|
}
|
|
361
359
|
|