natiny_physics_capsule

C
NatinyBody natiny_physics_capsule(float radius, float height);

Creates a dynamic body with a capsule collider standing upright along Y and centred on its origin. Requires an initialised physics world.

Parameters

Name Type Description
radius float Radius of the side and of both hemispheres, in metres; must be greater than 0
height float Total height end to end, hemispheres included, in metres

Returns

Type Description
NatinyBody Body handle, or 0 on failure

Example

C
NatinyBody player = natiny_physics_capsule(0.4f, 1.8f);
natiny_physics_set_fixed_rotation(player, true);
natiny_model_set_mesh(avatar, natiny_mesh_capsule(0.4f, 1.8f, 32, 8));
natiny_entity_set_parent(avatar, player);