From b40d44202ed0c79cbb769edba8de57412d07501a Mon Sep 17 00:00:00 2001 From: kotorifan Date: Tue, 21 Apr 2026 23:57:34 +0200 Subject: Enough for today --- src/physics.h | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/physics.h') diff --git a/src/physics.h b/src/physics.h index 10148c1..a5168cd 100644 --- a/src/physics.h +++ b/src/physics.h @@ -6,32 +6,11 @@ #include #include "common.h" -typedef enum { - SHAPE_CIRCLE, - SHAPE_SQUARE, - SHAPE_RECTANGLE -} shape_t; - -typedef struct { - Color color; - Vector2 elast; -// Vector2 force; - Vector2 frict; - Vector2 pos; - Vector2 pos_prev; - Vector2 vel; - bool grabbed; - bool registered; - float mass; - float size_x; - float size_y; - shape_t obj_type; -} object_t; void init_physics(object_t* world, uint32_t max_objs); -void update_physics(object_t* world, uint32_t objs_count, float gravity, float damping); +void update_physics(object_t* world, uint32_t objs_count, float gravity, float dt); void apply_force(object_t* obj, Vector2 force); -void add_object(object_t* world, uint32_t* count, object_type_t type, Vector2 pos); +void add_object(object_t* world, uint32_t* count, shape_t type, Vector2 pos); void clear_all_physics(object_t* world, uint32_t* count); void push_pos(object_t* world, uint32_t count, Vector2 pos, float radius, float strength); -- cgit v1.3