natiny_physics_plane

C
NatinyBody natiny_physics_plane(float w, float d);

Creates a static, flat rectangle in the XZ plane: the ground.

Parameters

Name Type Description
w float Width, the full size along X
d float Depth, the full size along Z

Returns

Type Description
NatinyBody Body handle, also usable as a NatinyEntity; 0 on failure

Example

C
NatinyBody ground = natiny_physics_plane(50.0f, 50.0f);

Notes

  • The rectangle lies in the XZ plane, faces +Y, and is centred on the body's origin.
  • Not infinite: whatever goes over the edge keeps falling.
  • The body is static. Making it dynamic gives it no mass, because a flat surface has no volume; use natiny_physics_cube for a moving floor.
  • Returns 0 when physics is not running or the body cannot be made.