Gravity, ray cast, and Scene Document round trip for physics Components (#73) #105

Merged
crowmaki merged 2 commits from issue-73-gravity-raycast-roundtrip into main 2026-09-07 00:50:21 +00:00
Owner

Closes #73.

The box3d Plugin publishes set_gravity, gravity and ray_cast on the Physics Interface. The ray cast normalises the direction, asks Box3D for the closest hit, and reads the Rigidbody Handle from the body's user tag; an Implicit Static Body sets its tag to null explicitly so its hit reports a Null Handle.

Five Headless tests in tests/core/box3d_plugin_test.odin, one per acceptance criterion:

  • zero gravity holds a dynamic cube still and reads back
  • a ray straight down onto the plane reports a Null Handle at the plane's top
  • a ray through a cube reports its Rigidbody Handle and a shorter distance
  • a ray that hits nothing reports no hit, both pointing away and too short
  • a saved Scene Document holds the authored fields and no transient ids, and loads into a fresh Engine whose cube falls

The document round trip needed no Plugin change: Core's transient flag already keeps body, static_body and shape out of the document.

Closes #73. The box3d Plugin publishes `set_gravity`, `gravity` and `ray_cast` on the Physics Interface. The ray cast normalises the direction, asks Box3D for the closest hit, and reads the Rigidbody Handle from the body's user tag; an Implicit Static Body sets its tag to null explicitly so its hit reports a Null Handle. Five Headless tests in `tests/core/box3d_plugin_test.odin`, one per acceptance criterion: - zero gravity holds a dynamic cube still and reads back - a ray straight down onto the plane reports a Null Handle at the plane's top - a ray through a cube reports its Rigidbody Handle and a shorter distance - a ray that hits nothing reports no hit, both pointing away and too short - a saved Scene Document holds the authored fields and no transient ids, and loads into a fresh Engine whose cube falls The document round trip needed no Plugin change: Core's transient flag already keeps `body`, `static_body` and `shape` out of the document.
crowmaki deleted branch issue-73-gravity-raycast-roundtrip 2026-09-07 00:50:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
crowmaki/cinnabar!105
No description provided.