Add in floating-point support for collision boxes. Remove ceil() calls for transformed view DrawRectDecal and FillRectDecal functions (why are they there?)

This commit is contained in:
2024-01-11 01:26:58 -06:00
parent 6d11eb5048
commit 20928b6867
11 changed files with 54 additions and 35 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ void Pathfinding::Initialize(){
sNode&node=nodes[{x,y}];
node.x = x; // ...because we give each node its own coordinates
node.y = y; // ...because we give each node its own coordinates
geom2d::rect<int>tile=game->GetTileCollision(game->GetCurrentLevel(),{float(x*gridSpacing.x),float(y*gridSpacing.y)});
geom2d::rect<float>tile=game->GetTileCollision(game->GetCurrentLevel(),{float(x*gridSpacing.x),float(y*gridSpacing.y)});
node.bObstacle = tile.pos!=game->NO_COLLISION.pos||tile.size!=game->NO_COLLISION.size;
tile=game->GetTileCollision(game->GetCurrentLevel(),{float(x*gridSpacing.x),float(y*gridSpacing.y)},true);
node.bObstacleUpper = tile.pos!=game->NO_COLLISION.pos||tile.size!=game->NO_COLLISION.size;