From c5989ca9bcc1758f4d772d20b8bd4ae7762bc75e Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 6 Aug 2025 03:55:04 -0600 Subject: Working on utility poles --- src/entity.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/entity.c') diff --git a/src/entity.c b/src/entity.c index 97af95e..f9f7989 100644 --- a/src/entity.c +++ b/src/entity.c @@ -39,6 +39,15 @@ Entity createEntity(EntityId id, Vector3 position) .max = (Vector3){POND_SIZE, POND_HEIGHT, POND_SIZE} }; + break; + case UTILITY_POLE: + entity.box = (BoundingBox){ + .min = (Vector3){-UTILITY_POLE_RADIUS, -UTILITY_POLE_HEIGHT, + -UTILITY_POLE_RADIUS}, + .max = (Vector3){UTILITY_POLE_RADIUS, UTILITY_POLE_HEIGHT, + UTILITY_POLE_RADIUS}, + }; + break; default: break; @@ -49,8 +58,11 @@ Entity createEntity(EntityId id, Vector3 position) return entity; } +// TODO: Mesh instance the utility poles and make a 3d model void updateEntity(Entity* entity, Game* game) { + DrawBoundingBox(entity->box, RED); + switch (entity->id) { case OLD_MINT: @@ -78,6 +90,12 @@ void updateEntity(Entity* entity, Game* game) Vector3Add(entity->position, (Vector3){0.0, POND_HEIGHT * 2.0, 0.0}), (Vector2){POND_SIZE * 2.5, POND_SIZE * 2.5}, BLUE); break; + case UTILITY_POLE: + DrawCylinder(Vector3Subtract(entity->position, + (Vector3){0.0, UTILITY_POLE_HEIGHT}), + UTILITY_POLE_RADIUS, UTILITY_POLE_RADIUS, + UTILITY_POLE_HEIGHT * 2.0, 6, BROWN); + break; default: break; } -- cgit v1.2.3