Skip to content

feat(physics): add Physics Play mechanics demos - #4

Merged
MemerGamer merged 4 commits into
mainfrom
feat/physics
Nov 23, 2026
Merged

MemerGamer merged 4 commits into
mainfrom
feat/physics

Conversation

@MemerGamer

@MemerGamer MemerGamer commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds Physics Play, an ABI 1.1.0 clip source for projectile motion, a nonlinear pendulum, a spring-mass oscillator, elastic and inelastic disk collisions, and a domino chain.
  • Adds the registry entry, usage guide, upstream notices and a released-host CI smoke test.
  • The Rapier 0.36.1 WASM spike trapped on the 30-second contact scenes. The plugin uses a bounded disk and pivot solver that recomputes the state from the same inputs on every render.

Review fixes (fix(physics))

  • Dominoes rest on the stricter of two vertex-face contacts (the next block's corners against the leaning block's right face), so neighbours never overlap; a separating-axis test keeps the overlap below 1 mm for 6 and 12 rows over the whole replay.
  • The domino launcher applies the configured restitution at the impact instead of stopping the ball dead.
  • The default collision scene stays in motion (friction default 0) and its momentum readout is labelled "not conserved" whenever walls or the floor exchange momentum (gravity included).
  • Projectile velocity arrows clip at the ground line and against other bodies; the readout names the highlighted launch angle; angle 0° and speed 0 keep a metre scale and a sensible readout.
  • The unused rapier2d license file is dropped from assets and the bundle (NOTICE records the spike as evaluated, not used); the registry description matches plugin.toml.

Verification

  • 22 native unit tests and the doctest pass: default-scene readout values, domino non-penetration, collision liveness with the defaults, exact restitution at the launcher, deterministic replay, measured solver-work bounds against the README's per-step budget; formatting and Clippy (native and WASM) are clean.
  • Released AniMathIO 2.3.0 rendered all five scenes and the maximum-size contact scenes; repeated 30-second stress frames with 12 bodies matched pixel-for-pixel (slowest render 0.047 s including CLI startup).
  • Every screenshot re-rendered from the fixed scenes and reviewed; scripts/registry.py validate and the README table check pass.

Screenshots

Projectile Pendulum Spring-mass
Projectile trails and velocity vectors Pendulum swing Spring-mass oscillator
Elastic collision Inelastic collision Dominoes
Elastic collision Inelastic collision Domino chain reaction

🤖 Generated with Claude Code

MemerGamer and others added 3 commits November 23, 2026 11:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round on the Physics Play community plugin:

- Dominoes: add the opposite vertex-face contact (the next block's
  bottom-left/top-left corner on the leaning block's right face, whose
  lower endpoint becomes the near end of the top edge once flat) and rest
  each block on the stricter support limit, so neighbours never overlap.
  A separating-axis test keeps overlap below 1 mm for 6 and 12 rows over
  the whole replay.
- Launcher: apply the configured restitution at the domino impact instead
  of stopping the ball dead; it now rebounds at e * v as the impulse math
  says.
- Collision: default friction drops to 0 so the disk demo stays in motion,
  and the momentum readout is labelled "not conserved" whenever walls or
  the floor exchange momentum (gravity included). The README recipe stays
  exact: restitution 1 preserves 12.5 J, restitution 0 leaves 2.5 m/s and
  6.25 J.
- Projectile: velocity arrows clip at the ground line and against other
  bodies (swept-disk clearance), the readout names the launch angle of the
  highlighted body, and angle 0 or speed 0 keep a metre scale with a
  sensible readout.
- Packaging: drop the unused rapier2d license file from assets and the
  bundle; NOTICE records the spike as evaluated, not used. Restore the
  molecule registry fields lost in the rebase and keep the registry
  description in sync with plugin.toml.
- Tests: default-scene readout values, domino non-penetration, collision
  liveness with the defaults, and measured solver-work bounds matching the
  README's per-step budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MemerGamer
MemerGamer merged commit e7c4bb3 into main Nov 23, 2026
2 checks passed
@MemerGamer
MemerGamer deleted the feat/physics branch November 23, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants