docs(physics): document how sleeping affects forces, joints and contacts #926
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.48) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 517 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 91% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #926"
general
weight: 0.35
claude[bot]
Summary
Most of what #834 asks for landed with its dependency PRs:
physics/sleeping.md,createSleepEcsSystemin the physics index's registration example, and the "Sleep state" section inrigid-bodies.md. This PR fills in what was still missing and fixes two inaccurate sentences:forces.md: one paragraph explains thatapplyImpulse,applyTorqueandapplyExplosiveForceact on sleeping bodies and wake their islands. A torque on a body with locked rotation changes nothing, so that body stays asleep. The Gravity section now says gravity isn't applied to a sleeping body. It also used to say a gravity change wakes "every body it rests on or against", which is wrong: only the body's island wakes, and a static floor doesn't.joints.md: a new "Sleeping jointed bodies" section covers these points:- Two dynamic bodies a joint connects share an island.
- A static, kinematic or collider-only end is recorded as a partner. The sleeping body wakes when that partner is moved, turned, removed or given a new collider, or when a kinematic end has a velocity.
- A joint links its bodies only while both have a position and a rotation.
- Adding or removing a joint, or changing
entityA/entityB, wakes the bodies. Any other field change needswakeRequested.collisions.md: a sleeping body's contacts keeptouchingwith nothing instarted/ended. A new solid contact is listed instartedand wakes the body. A sensor still lists a sleeping body it overlaps, and never wakes it.sleeping.md: removed the Box2D comparison and some figurative wording, which thedocument-featureskill doesn't allow, and added the sensortouchingbehavior.Where the sleep system is registered (differs from the issue): the issue asks for
createSleepEcsSystem"directly aftercreateTransformEcsSystem" inphysics/index.md. The sleep system reads this step'scollisionManifolds, and its JSDoc says to register it aftercreateNarrowPhaseEcsSystem. Placing it right after the transform system would make it read the previous step's collisions. The index already registers it after the narrow phase and explains why (item 3 of the order list), so I left that unchanged.The JSDoc of
RigidBodyEcsComponent,createSleepEcsSystem,SleepOptionsandisBodyAwakealready covers every option, default and throw that the guide leaves to the API reference. No/srcchanges.solution-reviewer: REVISE on the first plan. It caught the false torque statement for locked-rotation bodies and the wrong gravity sentence, and asked for the partner and position+rotation details in the joints section. APPROVE on the revised diff. I also applied its three optional wording fixes.
No demo pages need a manual check, since no demo code or engine code changed. The pages to read in the browser are Physics → Sleeping Bodies, Applying Forces, Joints and Collisions.
Related issue(s)
Closes #834
Verification checklist
npm run check-typespasses with 0 errorsnpm testpasses (not run: the run's tool permissions didn't allow it. This PR changes only Markdown underdocumentation-site/docs)npm run lintpasses with 0 errorsnpm run cspellpasses with 0 errorsnpm run check-exportspassesindex.ts(and
/src/index.ts/package.jsonexportsif it's a new module) (no API changes)/documentation-site/docs/docsis updated if thischange affects documented behavior
/documentation-site/src/pages/demos, the demo has been updated andverified (see AGENTS.md's "Documentation Site Demos" section) (no
/srcor demo changes)I also ran
npm run build, and fromdocumentation-site/,npm run typecheckandnpm run build. All passed, with no broken links.Changelog
## [Unreleased]inCHANGELOG.md(not required: this is adocschange)🤖 Generated with Claude Code