Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
RenderingHelper.cpp
Go to the documentation of this file.
1#include "RenderingHelper.hpp"
2
3Vector3 RenderingHelper::tileToWorld(int tileX, int tileY, int worldWidth, int worldHeight,
4 float tileSize)
5{
6 float worldX = (tileX - worldWidth / 2.0f) * tileSize + tileSize / 2.0f;
7 float worldZ = (tileY - worldHeight / 2.0f) * tileSize + tileSize / 2.0f;
8 return {worldX, 0.0f, worldZ};
9}
static Vector3 tileToWorld(int tileX, int tileY, int worldWidth, int worldHeight, float tileSize)
Converts tile coordinates to world coordinates (centered on tile).