mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Fix heightmap loading detection and widen wall collision radius
- Use explicit loaded flag for heightmap instead of checking height values - Increase player collision radius from 0.50 to 0.55 for better wall collision
This commit is contained in:
parent
8f4935a450
commit
f7e2d52faf
3 changed files with 4 additions and 2 deletions
|
|
@ -21,9 +21,10 @@ struct ADTCoord {
|
||||||
*/
|
*/
|
||||||
struct HeightMap {
|
struct HeightMap {
|
||||||
std::array<float, 145> heights; // 9x9 outer + 8x8 inner vertices
|
std::array<float, 145> heights; // 9x9 outer + 8x8 inner vertices
|
||||||
|
bool loaded = false;
|
||||||
|
|
||||||
float getHeight(int x, int y) const;
|
float getHeight(int x, int y) const;
|
||||||
bool isLoaded() const { return heights[0] != 0.0f || heights[1] != 0.0f; }
|
bool isLoaded() const { return loaded; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -377,6 +377,7 @@ void ADTLoader::parseMCVT(const uint8_t* data, size_t size, MapChunk& chunk) {
|
||||||
if (height < minHeight) minHeight = height;
|
if (height < minHeight) minHeight = height;
|
||||||
if (height > maxHeight) maxHeight = height;
|
if (height > maxHeight) maxHeight = height;
|
||||||
}
|
}
|
||||||
|
chunk.heightMap.loaded = true;
|
||||||
|
|
||||||
// Log height range for first chunk only
|
// Log height range for first chunk only
|
||||||
static bool logged = false;
|
static bool logged = false;
|
||||||
|
|
|
||||||
|
|
@ -1515,7 +1515,7 @@ bool WMORenderer::checkWallCollision(const glm::vec3& from, const glm::vec3& to,
|
||||||
if (moveDistXY < 0.001f) return false;
|
if (moveDistXY < 0.001f) return false;
|
||||||
|
|
||||||
// Player collision parameters
|
// Player collision parameters
|
||||||
const float PLAYER_RADIUS = 0.50f; // Slightly narrower to pass tight doorways/interiors
|
const float PLAYER_RADIUS = 0.55f; // Slightly wider for better wall collision
|
||||||
const float PLAYER_HEIGHT = 2.0f; // Player height for wall checks
|
const float PLAYER_HEIGHT = 2.0f; // Player height for wall checks
|
||||||
const float MAX_STEP_HEIGHT = 0.85f; // Balanced step-up without wall pass-through
|
const float MAX_STEP_HEIGHT = 0.85f; // Balanced step-up without wall pass-through
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue