Fix bounds for inserting into spatial grid

This commit is contained in:
2024-01-08 16:41:54 +01:00
parent 88cbfe4a37
commit 5486c3189f
3 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ ecs_entity_t entityCreateWorker(const Position position, Game *game) {
ecs_set_ptr(ECS, e, Position, &position);
ecs_set_ptr(ECS, e, Size, &size);
BzSpatialGridID spatialID = bzSpatialGridInsert(game->entityGrid, &e,
position.x, position.y,
position.x - size.x * 0.5f, position.y - size.y * 0.5f,
size.x, size.y);
ecs_set(ECS, e, SpatialGridID, { spatialID });
ecs_set(ECS, e, Rotation, { 0.0f });