176 Commits

Author SHA1 Message Date
4c82aabc5d feat: deterministic cross-platform math kernel
Replaces every host-libm call in the physics source with a kernel built from
IEEE-754-exact operations only, so simulation results are bit-identical on
ARM64/JavaScriptCore and x86-64/V8.

ECMAScript permits Math.sin/cos/atan2 to be implementation-dependent
approximations, and Rot.setAngle and Sweep.getTransform call them for every
rotating body on every step. Without this, a replay recorded on mobile does
not reproduce on desktop, which breaks replay verification and leaderboards.

- add src/common/DeterministicMath.ts (fdlibm-derived polynomials and
  Cody-Waite range reduction, plus a seeded mulberry32 PRNG)
- rewire the nine hoisted aliases in Math, Matrix, Rot, Sweep and
  dynamics/Position; no host libm call remains in src/
- export DeterministicMath and seedRandom for consumers
- add determinism tests, incl. a free fall matching the analytic solution

All 14 upstream tests still pass (22 total).
2026-09-15 00:52:19 +03:00
Ali Shakiba
93dd64df0f v1.5.0 2026-04-07 15:59:37 +03:30
Ali Shakiba
c96feaccea v1.4.3 2026-02-10 15:31:37 +03:30
Ali Shakiba
f6d90c2703 Cleanup eslint, upgrade dev deps 2026-02-08 23:08:31 +03:30
Ali Shakiba
18a00bdcf6 use vitepress 2026-02-08 20:00:27 +03:30
Ali Shakiba
cbec05b7e8 v1.4.2 2025-06-01 21:33:59 +03:30
Ali Shakiba
23e89ec1f7 v1.4.1 2025-05-30 16:16:08 +03:30
Ali Shakiba
37414c7dad v1.4.0 2025-05-26 19:43:18 +03:30
Ali Shakiba
97e4fcd011 change changesets scripts 2025-05-26 19:41:16 +03:30
Ali Shakiba
02600898af update docs 2025-04-14 21:28:32 +03:30
Ali Shakiba
1c50a3f381 build v1.3.0 2024-12-28 02:03:06 +03:30
Ali Shakiba
bb9bb873fc Testbed rendering rewrite 2024-12-27 22:41:01 +03:30
Ali Shakiba
7c400fa896 build v1.2.0 2024-12-24 20:11:59 +03:30
Ali Shakiba
0b31620212 build v1.1.6 2024-12-23 18:30:56 +03:30
Ali Shakiba
97b1a8387d v1.1.5 2024-12-19 23:15:21 +03:30
Ali Shakiba
50ce8a971a add changesets 2024-12-19 23:12:55 +03:30
Ali Shakiba
a1753d5a1d build v1.1.4 2024-12-18 15:24:45 +03:30
Ali Shakiba
c11f0493f6 build v1.1.3 2024-12-18 14:17:43 +03:30
Ali Shakiba
7d09b35cea update eslint 2024-12-18 13:02:16 +03:30
Ali Shakiba
92ce0d1080 examples: use vite-alias planck, and lint pretty 2024-12-15 13:30:32 +03:30
Ali Shakiba
71f4e5c286 v1.1.2: add body.setTransform(xf) signature 2024-12-03 22:19:17 +03:30
Ali Shakiba
0e58a85d1a v1.1.1: fix serializing chain with loop 2024-11-30 23:31:39 +03:30
Ali Shakiba
b4d7ffa0ee v1.1.0 2024-11-24 09:31:10 +03:30
Ali Shakiba
e5048fe80d
v1.1.0-alpha: vite build migration 2024-11-23 16:08:24 +03:30
Ali Shakiba
9930e2174d lint testbed 2024-11-22 13:24:52 +03:30
Ali Shakiba
733e30b659 v1.0.9: fix exported internal.Settings and hide internal, stats 2024-11-19 12:57:40 +03:30
Ali Shakiba
0e0bef9c1e v1.0.8: lint 2024-11-18 11:29:36 +03:30
Ali Shakiba
55a9b170d2 Build v1.0.7: testbed minor update 2024-11-17 23:03:44 +03:30
Ali Shakiba
9e20146bc5 Build v1.0.6: use es5 stage.js 2024-09-30 23:38:39 +03:30
Ali Shakiba
363f566ce3 mv stage-js to peerDependencies 2024-08-17 01:40:15 +03:30
Wojciech Maj
8ef74eca53 Remove unnecessary dependency on is-core-module 2024-08-09 22:41:03 +03:30
Ali Shakiba
0d2efe6ae0 replace vec2 with vec2value in the api, update docs 2024-05-23 23:07:21 +03:30
Ali Shakiba
f089bb0c66 use new stage version 2024-04-24 23:38:42 +03:30
Ali Shakiba
2b0dd3d0e9 build 1.0.2 2024-03-13 16:49:16 +03:30
Ali Shakiba
6de9126f75 build 1.0.1 2024-01-01 20:01:49 -08:00
Ali Shakiba
282c3fac45 build v1.0.0 2023-12-30 16:09:06 -08:00
Ali Shakiba
041726a83f build v1.0-beta.20 2023-12-26 19:39:48 -08:00
Ali Shakiba
0a2556722b build beta.18 2023-12-25 19:04:39 -08:00
Ali Shakiba
eade1934a0 build v1.0.0-beta.18 2023-12-24 23:22:20 -08:00
Ali Shakiba
4de71d9038 build v1.0.0-beta.17 2023-12-24 22:33:09 -08:00
Ali Shakiba
820f6105d7 fix setMassData 2023-09-09 11:54:00 -07:00
Oliver Zell
3efc9234ff
feat: set sideEffects to false for planck.js (#262) 2023-08-28 18:58:54 +02:00
Ali Shakiba
6b3113eb57 build v1.0.0-beta.15 2023-08-26 16:42:08 -07:00
Ali Shakiba
83e71a3339 add npm preflight 2023-08-26 15:43:36 -07:00
Ali Shakiba
4a54360b54 build v1-beta.14 2023-08-26 11:56:32 -07:00
Ali Shakiba
ee8785ff30 build v1-beta.13 2023-08-24 12:29:59 -07:00
Ali Shakiba
33eabb680c build v1-beta.12 2023-08-23 21:58:00 -07:00
Ali Shakiba
9d86ecc65b convert MassData to interface 2023-08-23 02:34:55 -07:00
Ali Shakiba
a971fb7908 refactor testbed api 2023-08-20 09:23:47 -07:00
Ali Shakiba
edd5883795 set v1-beta to umd, with es option 2023-08-16 19:43:31 -07:00