@aethervtt/shard-mesh 0.0.1 → 0.2.0

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/trig.js ADDED
@@ -0,0 +1,36 @@
1
+ const TWO_OVER_PI = 0.6366197723675814;
2
+ const HALF_PI_HI = 1.5707963267341256;
3
+ const HALF_PI_LO = 6077100506506192e-26;
4
+ function sinPoly(r) {
5
+ const r2 = r * r;
6
+ return r * (1 + r2 * (-1 / 6 + r2 * (1 / 120 + r2 * (-1 / 5040 + r2 * (1 / 362880 + r2 * (-1 / 39916800 + r2 * (1 / 6227020800)))))));
7
+ }
8
+ function cosPoly(r) {
9
+ const r2 = r * r;
10
+ return 1 + r2 * (-1 / 2 + r2 * (1 / 24 + r2 * (-1 / 720 + r2 * (1 / 40320 + r2 * (-1 / 3628800 + r2 * (1 / 479001600 + r2 / -87178291200))))));
11
+ }
12
+ function sinCos(t, out, o = 0) {
13
+ const k = Math.round(t * TWO_OVER_PI);
14
+ const r = t - k * HALF_PI_HI - k * HALF_PI_LO;
15
+ const s = sinPoly(r);
16
+ const c = cosPoly(r);
17
+ const q = (k % 4 + 4) % 4;
18
+ out[o] = q === 0 ? s : q === 1 ? c : q === 2 ? -s : -c;
19
+ out[o + 1] = q === 0 ? c : q === 1 ? -s : q === 2 ? -c : s;
20
+ }
21
+ const sc = new Float64Array(2);
22
+ function dsin(t) {
23
+ sinCos(t, sc);
24
+ return sc[0];
25
+ }
26
+ function dcos(t) {
27
+ sinCos(t, sc);
28
+ return sc[1];
29
+ }
30
+ const DEG = Math.PI / 180;
31
+ export {
32
+ DEG,
33
+ dcos,
34
+ dsin,
35
+ sinCos
36
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aethervtt/shard-mesh",
3
- "version": "0.0.1",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -16,7 +16,8 @@
16
16
  "README.md"
17
17
  ],
18
18
  "dependencies": {
19
- "@aethervtt/shard-core": "0.0.1"
19
+ "@aethervtt/shard-core": "0.2.0",
20
+ "meshoptimizer": "1.3.0"
20
21
  },
21
22
  "repository": {
22
23
  "type": "git",
@@ -28,6 +29,6 @@
28
29
  "provenance": true
29
30
  },
30
31
  "shard": {
31
- "buildSha": "d6c5c6aef4675575c878b02cf2c8f738b4190229"
32
+ "buildSha": "32c22a3944ed23f5d1baa90bf7cc9fae724f5fd8"
32
33
  }
33
34
  }