Skills: say which adapters actually collide a rotated body - #1678
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
The builtin claim is verified, not quoted:
Body._syncAngleTransform()writesancestor.currentTransformand nothing else, sobody.angle,setAngle()and angular integration never touch the collision shapes. Which also meansgetBodyShapes()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, unlikesetAngle().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