mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Unify coordinate systems with canonical WoW world coordinates
Centralizes all coordinate conversions in core/coordinates.hpp with proper canonical WoW coords (+X=North, +Y=West, +Z=Up). Fixes critical tile calculation bug that was loading wrong surrounding tiles during terrain streaming, and fixes position sync sending ADT-raw format instead of canonical coordinates to the server.
This commit is contained in:
parent
ee9efa3478
commit
6690910712
11 changed files with 367 additions and 93 deletions
|
|
@ -31,6 +31,11 @@ public:
|
|||
|
||||
void processMouseWheel(float delta);
|
||||
void setFollowTarget(glm::vec3* target);
|
||||
void setDefaultSpawn(const glm::vec3& position, float yawDeg, float pitchDeg) {
|
||||
defaultPosition = position;
|
||||
defaultYaw = yawDeg;
|
||||
defaultPitch = pitchDeg;
|
||||
}
|
||||
|
||||
void reset();
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ public:
|
|||
|
||||
void setTerrainRenderer(TerrainRenderer* tr) { terrainRenderer = tr; }
|
||||
|
||||
void render(const Camera& playerCamera, int screenWidth, int screenHeight);
|
||||
void render(const Camera& playerCamera, const glm::vec3& centerWorldPos,
|
||||
int screenWidth, int screenHeight);
|
||||
|
||||
void setEnabled(bool enabled) { this->enabled = enabled; }
|
||||
bool isEnabled() const { return enabled; }
|
||||
|
|
@ -31,7 +32,7 @@ public:
|
|||
void setViewRadius(float radius) { viewRadius = radius; }
|
||||
|
||||
private:
|
||||
void renderTerrainToFBO(const Camera& playerCamera);
|
||||
void renderTerrainToFBO(const Camera& playerCamera, const glm::vec3& centerWorldPos);
|
||||
void renderQuad(int screenWidth, int screenHeight);
|
||||
|
||||
TerrainRenderer* terrainRenderer = nullptr;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
|
||||
private:
|
||||
/**
|
||||
* Get tile coordinates from world position
|
||||
* Get tile coordinates from GL world position
|
||||
*/
|
||||
TileCoord worldToTile(float worldX, float worldY) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue