natiny_physics_sphere
C
NatinyBody natiny_physics_sphere(float radius);
Creates a dynamic sphere-shaped body at the world origin.
Parameters
| Name |
Type |
Description |
radius |
float |
Radius in metres |
Returns
| Type |
Description |
NatinyBody |
Body handle, also usable as a NatinyEntity; 0 on failure |
Example
C
NatinyBody ball = natiny_physics_sphere(0.5f);
Notes
- Centred on the body's origin, and the body starts at the world origin.
- The body is dynamic;
natiny_physics_set_type changes that.
- Scaling the entity does not scale the collider.
- Returns
0 when physics is not running or the body cannot be made.