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

Closed
opened 2026-09-05 09:37:00 +00:00 by crowmaki · 0 comments
Owner

Parent

Part of #67.

What to build

The Physics Interface answers queries and the Components survive a document round trip. set_gravity and gravity read and write the world's gravity. ray_cast takes an origin, direction and maximum distance and reports the nearest hit's Rigidbody Component Handle (Null for an Implicit Static Body), point, normal and distance. A Scene Document saved after adding Rigidbody and Box_Collider holds their authored fields and no body or shape id, and loading it into a fresh Engine with the physics Plugin recreates the bodies and simulates.

Acceptance criteria

  • Setting gravity to zero stops a dynamic cube from falling; reading it back reports the value set.
  • A ray cast straight down onto the plane reports a Null Handle and a point at the plane's top; with a cube in the way it reports the cube's Rigidbody Handle and a shorter distance.
  • A ray that hits nothing reports no hit.
  • A saved Scene Document contains the authored fields and no transient ids; a load into a fresh Engine produces a cube that falls.
  • Every test runs Headless in the core suite.

Blocked by

  • #71 A cube falls onto a plane
## Parent Part of #67. ## What to build The Physics Interface answers queries and the Components survive a document round trip. `set_gravity` and `gravity` read and write the world's gravity. `ray_cast` takes an origin, direction and maximum distance and reports the nearest hit's `Rigidbody` Component Handle (Null for an Implicit Static Body), point, normal and distance. A Scene Document saved after adding `Rigidbody` and `Box_Collider` holds their authored fields and no body or shape id, and loading it into a fresh Engine with the physics Plugin recreates the bodies and simulates. ## Acceptance criteria - [ ] Setting gravity to zero stops a dynamic cube from falling; reading it back reports the value set. - [ ] A ray cast straight down onto the plane reports a Null Handle and a point at the plane's top; with a cube in the way it reports the cube's `Rigidbody` Handle and a shorter distance. - [ ] A ray that hits nothing reports no hit. - [ ] A saved Scene Document contains the authored fields and no transient ids; a load into a fresh Engine produces a cube that falls. - [ ] Every test runs Headless in the core suite. ## Blocked by - #71 A cube falls onto a plane
Sign in to join this conversation.
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#73
No description provided.