|
Gama C Library
Gama C API Documentation
|
Go to the source code of this file.
Data Structures | |
| struct | gmBody |
| Structure representing a physics body with properties for collision and movement. More... | |
Macros | |
| #define | gnothing NULL |
Enumerations | |
| enum | gmColliderType { GM_COLLIDER_CIRCLE , GM_COLLIDER_RECT } |
| Enum to define the type of collider for a physics body. More... | |
Functions | |
| gmBody | gm_body_create (double mass, double x, double y, double w, double h, gmColliderType c) |
| Creates a new physics body with specified properties. | |
| void | gm_max_speed (gmBody *body, double max_speed) |
| Limits the maximum speed of a body. | |
| void | gm_min_speed (gmBody *body, double min_speed) |
| Sets the minimum speed of a body. | |
| void | gm_speed (gmBody *body, double speed) |
| Sets the speed of a body while preserving its direction. | |
| void | gm_max_speed_anim (gmBody *body, double max_speed, void animator(double *value, double target, double dt, double t), double dt, double t) |
| Limits the maximum speed of a body using an animation function. | |
| void | gm_min_speed_anim (gmBody *body, double min_speed, void animator(double *value, double target, double dt, double t), double dt, double t) |
| Sets the minimum speed of a body using an animation function. | |
| void | gm_speed_anim (gmBody *body, double speed, void animator(double *value, double target, double dt, double t), double dt, double t) |
| Sets the speed of a body using an animation function. | |
| gmBody | gm_rectangle_body (double m, double x, double y, double w, double h) |
| Creates a rectangular physics body. | |
| gmBody | gm_circle_body (double m, double x, double y, double r) |
| Creates a circular physics body. | |
| int | gm_body_contains (gmBody *body, double x, double y) |
| Checks if a point is contained within a body's collider. | |
| #define gnothing NULL |
| enum gmColliderType |
| int gm_body_contains | ( | gmBody * | body, |
| double | x, | ||
| double | y ) |
Checks if a point is contained within a body's collider.
| body | Pointer to the body to check. |
| x | The x-coordinate of the point. |
| y | The y-coordinate of the point. |
| gmBody gm_body_create | ( | double | mass, |
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h, | ||
| gmColliderType | c ) |
Creates a new physics body with specified properties.
| mass | The mass of the body. |
| x | The x-coordinate of the body's position. |
| y | The y-coordinate of the body's position. |
| w | The width of the body. |
| h | The height of the body. |
| c | The type of collider for the body. |
| gmBody gm_circle_body | ( | double | m, |
| double | x, | ||
| double | y, | ||
| double | r ) |
Creates a circular physics body.
| m | The mass of the body. |
| x | The x-coordinate of the body's position. |
| y | The y-coordinate of the body's position. |
| r | The radius of the body. |
| void gm_max_speed | ( | gmBody * | body, |
| double | max_speed ) |
Limits the maximum speed of a body.
| body | Pointer to the body to modify. |
| max_speed | The maximum allowed speed. |
| void gm_max_speed_anim | ( | gmBody * | body, |
| double | max_speed, | ||
| void | animatordouble *value, double target, double dt, double t, | ||
| double | dt, | ||
| double | t ) |
Limits the maximum speed of a body using an animation function.
| body | Pointer to the body to modify. |
| max_speed | The maximum allowed speed. |
| animator | Function pointer to animate the velocity change. |
| dt | Delta time for animation. |
| t | Time parameter for animation. |
| void gm_min_speed | ( | gmBody * | body, |
| double | min_speed ) |
Sets the minimum speed of a body.
| body | Pointer to the body to modify. |
| min_speed | The minimum allowed speed. |
| void gm_min_speed_anim | ( | gmBody * | body, |
| double | min_speed, | ||
| void | animatordouble *value, double target, double dt, double t, | ||
| double | dt, | ||
| double | t ) |
Sets the minimum speed of a body using an animation function.
| body | Pointer to the body to modify. |
| min_speed | The minimum allowed speed. |
| animator | Function pointer to animate the velocity change. |
| dt | Delta time for animation. |
| t | Time parameter for animation. |
| gmBody gm_rectangle_body | ( | double | m, |
| double | x, | ||
| double | y, | ||
| double | w, | ||
| double | h ) |
Creates a rectangular physics body.
| m | The mass of the body. |
| x | The x-coordinate of the body's position. |
| y | The y-coordinate of the body's position. |
| w | The width of the body. |
| h | The height of the body. |
| void gm_speed | ( | gmBody * | body, |
| double | speed ) |
Sets the speed of a body while preserving its direction.
| body | Pointer to the body to modify. |
| speed | The speed to set. |
| void gm_speed_anim | ( | gmBody * | body, |
| double | speed, | ||
| void | animatordouble *value, double target, double dt, double t, | ||
| double | dt, | ||
| double | t ) |
Sets the speed of a body using an animation function.
| body | Pointer to the body to modify. |
| speed | The speed to set. |
| animator | Function pointer to animate the velocity change. |
| dt | Delta time for animation. |
| t | Time parameter for animation. |