mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Improve rendering distances, camera collision, and spawn point
- Increase WMO render distance from 1500 to 3000 units for better city loading - Increase M2 render distance from 500 to 1000 units - Increase terrain load radius from 4 to 6 tiles (~3200 units) - Add raycast-based camera collision that zooms in when obstructed by walls/objects - Move spawn point outside chapel to road near Stormwind gate - Add ground height smoothing to prevent stumbling on uneven terrain
This commit is contained in:
parent
76a16a214e
commit
a8cf17e7e5
7 changed files with 142 additions and 12 deletions
|
|
@ -126,9 +126,9 @@ private:
|
|||
static constexpr float WOW_GRAVITY = -19.29f;
|
||||
static constexpr float WOW_JUMP_VELOCITY = 7.96f;
|
||||
|
||||
// Default spawn position (in front of Stormwind gate)
|
||||
glm::vec3 defaultPosition = glm::vec3(-8900.0f, -170.0f, 150.0f);
|
||||
float defaultYaw = 0.0f; // Look north toward Stormwind gate
|
||||
// Default spawn position (on the road outside Stormwind)
|
||||
glm::vec3 defaultPosition = glm::vec3(-8830.0f, -150.0f, 82.0f);
|
||||
float defaultYaw = 180.0f; // Look south toward Stormwind gate
|
||||
float defaultPitch = -5.0f;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -144,6 +144,15 @@ public:
|
|||
bool checkCollision(const glm::vec3& from, const glm::vec3& to,
|
||||
glm::vec3& adjustedPos, float playerRadius = 0.5f) const;
|
||||
|
||||
/**
|
||||
* Raycast against M2 bounding boxes for camera collision
|
||||
* @param origin Ray origin (e.g., character head position)
|
||||
* @param direction Ray direction (normalized)
|
||||
* @param maxDistance Maximum ray distance to check
|
||||
* @return Distance to first intersection, or maxDistance if no hit
|
||||
*/
|
||||
float raycastBoundingBoxes(const glm::vec3& origin, const glm::vec3& direction, float maxDistance) const;
|
||||
|
||||
// Stats
|
||||
uint32_t getModelCount() const { return static_cast<uint32_t>(models.size()); }
|
||||
uint32_t getInstanceCount() const { return static_cast<uint32_t>(instances.size()); }
|
||||
|
|
|
|||
|
|
@ -240,8 +240,8 @@ private:
|
|||
|
||||
// Streaming parameters
|
||||
bool streamingEnabled = true;
|
||||
int loadRadius = 4; // Load tiles within this radius (9x9 grid, ~2133 units)
|
||||
int unloadRadius = 6; // Unload tiles beyond this radius (~3200 units, past far clip)
|
||||
int loadRadius = 6; // Load tiles within this radius (13x13 grid, ~3200 units)
|
||||
int unloadRadius = 8; // Unload tiles beyond this radius (~4266 units)
|
||||
float updateInterval = 0.1f; // Check streaming every 0.1 seconds
|
||||
float timeSinceLastUpdate = 0.0f;
|
||||
|
||||
|
|
|
|||
|
|
@ -149,6 +149,15 @@ public:
|
|||
*/
|
||||
bool isInsideWMO(float glX, float glY, float glZ, uint32_t* outModelId = nullptr) const;
|
||||
|
||||
/**
|
||||
* Raycast against WMO bounding boxes for camera collision
|
||||
* @param origin Ray origin (e.g., character head position)
|
||||
* @param direction Ray direction (normalized)
|
||||
* @param maxDistance Maximum ray distance to check
|
||||
* @return Distance to first intersection, or maxDistance if no hit
|
||||
*/
|
||||
float raycastBoundingBoxes(const glm::vec3& origin, const glm::vec3& direction, float maxDistance) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
* WMO group GPU resources
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue