2.7 KiB
Collider Authoring And Diagnostics
ColliderDesc is the saved collision shape. RigidBodyDesc independently controls authored body
motion, while Avian Collider and RigidBody components are hydrated runtime state. Collider
health compares both sides of that boundary so editor tools do not treat authored-but-unavailable
collision as ready.
Inspector Workflow
The Collider component card reports its shape, health, and hydration state. Box, sphere, capsule,
and static mesh shapes can be switched from the Shape menu. Primitive conversions retain the
previous shape's useful extents; each completed switch uses SetCollider history and is one undo
operation. Invalid shapes expose a reset action. Static mesh sources can be selected or replaced
with the actor's renderer meshes.
Dimensions are clamped to positive values in normal inspector editing. Project validation still rejects hand-edited or migrated non-finite/zero dimensions and empty mesh source lists.
Viewport Contract
Collider view hides render meshes and emphasizes authored collision using semantic status colors:
| Color | State |
|---|---|
| Green | Valid hydrated solid collider |
| Cyan | Valid hydrated trigger |
| Gray | Disabled or inactive collider |
| Amber | Stale hydration or oversized collider |
| Red | Missing or invalid collider |
Box, sphere/ellipsoid, and capsule wireframes include actor world scale. Static mesh collision uses the cooked runtime collider bounds when available. A rigid body with no collider receives a red spatial marker, so missing collision remains discoverable with meshes hidden. The lower-left HUD summarizes scene health and identifies the selected collider's shape and hydration state.
Diagnostics
The shared health service reports:
- missing/inactive/disabled collider authoring;
- non-positive or non-finite primitive dimensions;
- empty, unresolved, or registry-stale static mesh references;
- valid authoring that has not produced a runtime collider;
- primitive colliders exceeding 1,000 meters on any world-space axis.
The 1,000-meter warning is conservative rather than a save blocker. Large worlds should split collision into spatially bounded actors to keep broad-phase behavior predictable. Diagnostics can select the affected actor; static mesh fields retain their asset-browser locate action.
Physics Placement consumes the same errors plus its stricter non-trigger and hydrated rigid-body requirements. See physics-placement.md.
assets/levels/collider_diagnostics_showcase.scn.ron contains valid box, scaled sphere, capsule,
trigger, disabled, and missing-collider states for visual acceptance. Invalid, oversized, and stale
asset cases live in unit fixtures so the committed project remains release-valid.