@woosh/meep-engine 2.43.29 → 2.43.31

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.
@@ -41,6 +41,8 @@ export default class Quaternion {
41
41
 
42
42
  lookRotation(v3: Vector3Like, up?: Vector3Like): void
43
43
 
44
+ rotateTowards(other: Quaternion, max_angle: number): void
45
+
44
46
  toEulerAnglesXYZ(v3: { set(x: number, y: number, z: number): any }): void
45
47
 
46
48
  fromEulerAnglesXYZ(x: number, y: number, z: number): void
@@ -55,5 +57,9 @@ export default class Quaternion {
55
57
 
56
58
  fromJSON(j: any): void
57
59
 
60
+ readFromArray(array: ArrayLike<number>, offset: number): void
61
+
62
+ writeToArray(array: ArrayLike<number>, offset: number): void
63
+
58
64
  asArray(): number[]
59
65
  }
@@ -521,6 +521,15 @@ class Quaternion {
521
521
  return Math.sqrt(x * x + y * y + z * z + w * w);
522
522
  }
523
523
 
524
+ /**
525
+ *
526
+ * @param {Quaternion} other
527
+ * @param {number} max_delta
528
+ */
529
+ rotateTowards(other, max_delta) {
530
+ Quaternion.rotateTowards(this, this, other, max_delta);
531
+ }
532
+
524
533
  /**
525
534
  *
526
535
  * @param {Vector3} direction
@@ -1273,6 +1282,8 @@ class Quaternion {
1273
1282
  * @param {number} t
1274
1283
  */
1275
1284
  slerp(other, t) {
1285
+ assert.isNumber(t, 't');
1286
+
1276
1287
  const ax = this.x,
1277
1288
  ay = this.y,
1278
1289
  az = this.z,
@@ -1609,6 +1620,32 @@ class Quaternion {
1609
1620
  return result;
1610
1621
  }
1611
1622
 
1623
+ /**
1624
+ *
1625
+ * @param {number[]} array
1626
+ * @param {number} offset
1627
+ */
1628
+ readFromArray(array, offset) {
1629
+ this.set(
1630
+ array[offset],
1631
+ array[offset + 1],
1632
+ array[offset + 2],
1633
+ array[offset + 3]
1634
+ );
1635
+ }
1636
+
1637
+ /**
1638
+ *
1639
+ * @param {number[]} array
1640
+ * @param {number} offset
1641
+ */
1642
+ writeToArray(array, offset) {
1643
+ array[offset] = this.x;
1644
+ array[offset + 1] = this.y;
1645
+ array[offset + 2] = this.z;
1646
+ array[offset + 3] = this.w;
1647
+ }
1648
+
1612
1649
  asArray() {
1613
1650
  return [this.x, this.y, this.z, this.w];
1614
1651
  }
@@ -1676,7 +1713,7 @@ class Quaternion {
1676
1713
 
1677
1714
  /**
1678
1715
  * Based on http://planning.cs.uiuc.edu/node198.html
1679
- * @param random
1716
+ * @param {function():number} [random]
1680
1717
  * @return {Quaternion}
1681
1718
  */
1682
1719
  random(random = Math.random) {
@@ -1733,6 +1770,8 @@ class Quaternion {
1733
1770
  * @param {number} max_delta
1734
1771
  */
1735
1772
  static rotateTowards(result, from, to, max_delta) {
1773
+ assert.isNumber(max_delta, 'max_delta');
1774
+
1736
1775
  const angle = from.angleTo(to);
1737
1776
 
1738
1777
  if (angle === 0) {
@@ -85,7 +85,7 @@ export class Transform {
85
85
  unsubscribeAllChanges(handler, thisArg) {
86
86
  this.position.onChanged.remove(handler, thisArg);
87
87
  this.rotation.onChanged.remove(handler, thisArg);
88
- this.scale.onChanged.scale(handler, thisArg);
88
+ this.scale.onChanged.remove(handler, thisArg);
89
89
  }
90
90
 
91
91
  /**
@@ -21,6 +21,8 @@ export class AmbientOcclusionPostProcessEffect extends EnginePlugin {
21
21
  constructor() {
22
22
  super();
23
23
 
24
+ this.id = "ambient-occlusion-post-process";
25
+
24
26
  const defines = Object.assign({}, SAOShader.defines);
25
27
 
26
28
  this.__material = new ShaderMaterial({
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.43.29",
8
+ "version": "2.43.31",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",