From d4b40dcf7589bef2bbd0b6b940ee992da9db2343 Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Fri, 21 Jul 2023 00:12:00 -0600 Subject: Working collision system --- src/entity.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/entity.h') diff --git a/src/entity.h b/src/entity.h index 844386c..1ac3422 100644 --- a/src/entity.h +++ b/src/entity.h @@ -63,6 +63,7 @@ typedef struct Entity { EntityType type; Model * model; + float radius; // Used for quick collision detection. Vector3 position; Quaternion rotation; @@ -102,7 +103,8 @@ const extern EntityTypeInfo entityTypeInfo[ENTITY_TYPE_COUNT]; Entity createEntity(EntityType type, Game * game); void closeEntity(Entity * entity); -bool entitiesCollide(Entity entity1, Entity entity2); +void setEntityRadius(Entity * entity); // Uses model to set radius; +bool checkEntityCollision(Entity entity1, Entity entity2); // Helper functions for updating and drawing. void entityDraw(Entity * entity); -- cgit v1.2.3