66 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
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
37414c7dad v1.4.0 2025-05-26 19:43:18 +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
e5048fe80d
v1.1.0-alpha: vite build migration 2024-11-23 16:08:24 +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
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
Ali Shakiba
6b3113eb57 build v1.0.0-beta.15 2023-08-26 16:42:08 -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
d43d2c1919 update api doc 2023-08-22 12:40:19 -07:00
Ali Shakiba
edd5883795 set v1-beta to umd, with es option 2023-08-16 19:43:31 -07:00
Ali Shakiba
2b297519d9 update build v1-beta.8 2023-08-11 09:54:13 -07:00
Ali Shakiba
277f60eb13 update build v1-beta.7 2023-08-11 08:15:49 -07:00
Oliver Zell
652eb41563
test: switch to vitest (#252)
* test: switch to vitest

* docs: exclude tests from typedocs

* chore: remove ts-node dependency

* test: remove chai dependency
2023-08-07 13:32:29 -07:00
Ali Shakiba
2ca89b0ad2 update stage.js version 2023-08-06 19:55:25 -07:00
Ali Shakiba
39a983b7c5
make build backward compatible (#245) 2023-08-01 14:30:08 -07:00
Ali Shakiba
cbfba8ccc8
typescript testbed and vite build (#244) 2023-07-31 21:47:06 -07:00
Ali Shakiba
499075d715
refactor exports and add esm export (#243) 2023-07-31 19:35:10 -07:00
Ali Shakiba
04e9f70561 remove babel 2023-06-09 08:19:20 -07:00
Oliver Zell
22549b433a remove nodemon dependency 2022-02-19 16:44:17 +01:00
Oliver Zell
f305373809 migrate to @rollup/plugin-babel 2022-02-19 16:00:02 +01:00
Oliver Zell
cb32abaff6 fix typedoc 2021-11-20 16:16:20 +01:00