Skip to content

Skills: say which adapters actually collide a rotated body - #1678

Merged
obiot merged 1 commit into
masterfrom
docs/physics-skill-rotation
Sep 17, 2026
Merged

obiot merged 1 commit into
masterfrom
docs/physics-skill-rotation

Conversation

@obiot

@obiot obiot commented Sep 17, 2026

Copy link
Copy Markdown
Member

Follow-up to #1677.

The physics skill had this as half a sentence inside a bullet about applyForce"Note the rotation is visual: SAT collisions stay axis-aligned" — which buries the sharpest behaviour difference between the adapters, and one that is completely silent at runtime.

Now a section of its own:

adapter a rotating body
builtin rotates visually only — a spinning sprite collides as if upright
planck / matter rotates for real

The builtin claim is verified, not quoted: Body._syncAngleTransform() writes ancestor.currentTransform and nothing else, so body.angle, setAngle() and angular integration never touch the collision shapes. Which also means getBodyShapes() returning unrotated shapes there is correct — they genuinely are unrotated, and the overlay is telling the truth.

Includes the workaround, since the limitation isn't obviously escapable: body.rotate(angle) does rotate the shapes, unlike setAngle().

Also records what getBodyShapes() reports after matter-adapter 1.2.1 / planck-adapter 1.3.1, and adds two symptom-table rows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NGvtaUNATVCVxD2qcbiY4t

The physics skill had this as half a sentence inside a bullet about
`applyForce` — "Note the rotation is visual: SAT collisions stay axis-aligned"
— which buries the sharpest behaviour difference between the adapters, and one
that is completely silent at runtime.

It is now a section of its own, with the table:

- **builtin** rotates VISUALLY ONLY. Verified rather than taken from the doc
  comment: `Body._syncAngleTransform()` writes `ancestor.currentTransform` and
  nothing else, so `body.angle`, `setAngle()` and angular integration never
  touch the collision shapes. A spinning sprite collides as if upright
- **planck / matter** rotate for real — the solver owns the transform and
  collision follows it

Plus the workaround, since the limitation is not obviously escapable:
`body.rotate(angle)` DOES rotate the shapes, unlike `setAngle()`.

Also records what `getBodyShapes()` now reports after matter-adapter 1.2.1 and
planck-adapter 1.3.1 — rotated shapes where the body genuinely rotates,
unrotated where it does not — which is what makes "the hitbox you see is the
hitbox that collides" true of the debug overlay again.

Two symptom-table rows: a rotated sprite colliding upright, and a debug hitbox
that does not follow a spinning body on the older adapter versions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGvtaUNATVCVxD2qcbiY4t
Copilot AI lite review requested due to automatic review settings September 17, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@obiot
obiot merged commit 0d30f40 into master Sep 17, 2026
6 checks passed
@obiot
obiot deleted the docs/physics-skill-rotation branch September 17, 2026 15:19
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