Add hitboxes

This commit is contained in:
2024-01-28 11:00:32 +01:00
parent 0a4c1fd154
commit a61768e912
15 changed files with 494 additions and 200 deletions

View File

@@ -91,7 +91,7 @@ void entityUnConsumePopCapacity(ecs_iter_t *it);
/*
* 0: Game (singleton) for entity map
* 1: Position
* 2: Size
* 2: HitBox
* 3: Velocity (only entities with velocity change position)
* 4: SpatialGridID
*/
@@ -132,7 +132,7 @@ void entityUpdateArms(ecs_iter_t *it);
/*
* 1: Position
* 2: Size
* 2: HitBox
*/
void renderColliders(ecs_iter_t *it);
@@ -199,8 +199,7 @@ void drawSettingsUI(Game *game, f32 dt);
* Utils
**********************************/
Rectangle calculateEntityBounds(Position pos, Size size);
bool getEntityBounds(ecs_entity_t entity, Position *outPos, Size *outSize, Rectangle *outBounds);
bool getEntityHitBox(ecs_entity_t entity, Position *outPos, Rectangle *outHitBox);
/**********************************
* MISC