wgge 0.1.15 → 0.1.16

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.
@@ -0,0 +1,45 @@
1
+ import AnimationController from "./AnimationController";
2
+ import {EASING_FLAT} from "../animation/ProgressValue";
3
+ import AnimatedRotation from "../animation/AnimatedRotation";
4
+
5
+ export default class AnimationRotationVector2Controller extends AnimationController {
6
+
7
+ /**
8
+ * @type Vector2
9
+ */
10
+ model;
11
+
12
+ /**
13
+ * @type AnimatedRotation
14
+ */
15
+ animatedX;
16
+
17
+ /**
18
+ * @type AnimatedRotation
19
+ */
20
+ animatedY;
21
+
22
+ /**
23
+ *
24
+ * @param game GameModel
25
+ * @param model Vector2
26
+ * @param target Vector2
27
+ * @param duration Number
28
+ * @param easing (float) => float
29
+ * @param elapsed Number
30
+ */
31
+ constructor(game, model, target, duration, easing = EASING_FLAT, elapsed = 0) {
32
+ super(game, model);
33
+ this.model = model;
34
+ this.animatedX = new AnimatedRotation(model.x, target.x, duration, easing, elapsed);
35
+ this.animatedY = new AnimatedRotation(model.y, target.y, duration, easing, elapsed);
36
+ }
37
+
38
+ updateInternal(delta) {
39
+ this.model.set(this.animatedX.get(delta), this.animatedY.get(delta));
40
+ if (this.animatedX.isFinished() && this.animatedY.isFinished()) {
41
+ this.finished();
42
+ }
43
+ }
44
+
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgge",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Web GL Game Engine",
5
5
  "main": "index.js",
6
6
  "dependencies": {