Gama C Library
Gama C API Documentation
gmBody Struct Reference

Structure representing a physics body with properties for collision and movement. More...

#include <body.h>

Data Fields

uint8_t is_active
uint8_t is_static
gmColliderType collider_type
gmPos position
gmPos velocity
gmPos acceleration
double width
double height
double radius
double mass
double restitution
double friction

Detailed Description

Structure representing a physics body with properties for collision and movement.

Field Documentation

◆ acceleration

gmPos gmBody::acceleration

Current acceleration of the body.

◆ collider_type

gmColliderType gmBody::collider_type

Type of collider (rectangle or circle).

◆ friction

double gmBody::friction

Friction coefficient (not currently used in the code).

◆ height

double gmBody::height

◆ is_active

uint8_t gmBody::is_active

Whether the body is active in the physics simulation. Set to 0 to disable.

◆ is_static

uint8_t gmBody::is_static

Whether the body is static (immovable). Static bodies do not move or respond to forces.

◆ mass

double gmBody::mass

Mass of the body. Set to 0 for infinite mass (similar to static but can move).

◆ position

gmPos gmBody::position

Current position of the body.

◆ radius

double gmBody::radius

Dimensions of the body (width/height for rectangles, radius for circles). For circles, width and height are typically set to 2*radius.

◆ restitution

double gmBody::restitution

Bounciness of the body (0.0 = no bounce, 1.0+ = more bounce).

◆ velocity

gmPos gmBody::velocity

Current velocity of the body.

◆ width

double gmBody::width

The documentation for this struct was generated from the following file: