mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
Improve performance and tune ramp/planter collision behavior
This commit is contained in:
parent
f43e6bf834
commit
f00d13bfc0
12 changed files with 310 additions and 164 deletions
|
|
@ -94,8 +94,8 @@ private:
|
|||
static constexpr float PIVOT_HEIGHT = 1.8f; // Pivot at head height
|
||||
static constexpr float CAM_SPHERE_RADIUS = 0.32f; // Keep camera farther from geometry to avoid clipping-through surfaces
|
||||
static constexpr float CAM_EPSILON = 0.22f; // Extra wall offset to avoid near-plane clipping artifacts
|
||||
static constexpr float COLLISION_FOCUS_RADIUS_THIRD_PERSON = 90.0f;
|
||||
static constexpr float COLLISION_FOCUS_RADIUS_FREE_FLY = 70.0f;
|
||||
static constexpr float COLLISION_FOCUS_RADIUS_THIRD_PERSON = 42.0f;
|
||||
static constexpr float COLLISION_FOCUS_RADIUS_FREE_FLY = 34.0f;
|
||||
static constexpr float MIN_PITCH = -88.0f; // Look almost straight down
|
||||
static constexpr float MAX_PITCH = 35.0f; // Limited upward look
|
||||
glm::vec3* followTarget = nullptr;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ struct M2ModelGPU {
|
|||
float boundRadius = 0.0f;
|
||||
bool collisionSteppedFountain = false;
|
||||
bool collisionSteppedLowPlatform = false;
|
||||
bool collisionPlanter = false;
|
||||
bool collisionNoBlock = false;
|
||||
|
||||
std::string name;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <GL/glew.h>
|
||||
#include <glm/glm.hpp>
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
||||
namespace wowee {
|
||||
|
|
@ -48,6 +49,11 @@ private:
|
|||
int mapSize = 200;
|
||||
float viewRadius = 500.0f;
|
||||
bool enabled = false;
|
||||
float updateIntervalSec = 0.25f;
|
||||
float updateDistance = 6.0f;
|
||||
std::chrono::steady_clock::time_point lastUpdateTime = std::chrono::steady_clock::time_point{};
|
||||
glm::vec3 lastUpdatePos = glm::vec3(0.0f);
|
||||
bool hasCachedFrame = false;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include <mutex>
|
||||
#include <atomic>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
#include <condition_variable>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
|
@ -246,8 +247,8 @@ private:
|
|||
|
||||
// Streaming parameters
|
||||
bool streamingEnabled = true;
|
||||
int loadRadius = 2; // Load tiles within this radius (5x5 grid for performance)
|
||||
int unloadRadius = 3; // Unload tiles beyond this radius
|
||||
int loadRadius = 1; // Load tiles within this radius (3x3 grid for better CPU/GPU perf)
|
||||
int unloadRadius = 2; // Unload tiles beyond this radius
|
||||
float updateInterval = 0.1f; // Check streaming every 0.1 seconds
|
||||
float timeSinceLastUpdate = 0.0f;
|
||||
|
||||
|
|
@ -257,8 +258,9 @@ private:
|
|||
static constexpr float TILE_SIZE = 533.33333f; // One tile = 533.33 units
|
||||
static constexpr float CHUNK_SIZE = 33.33333f; // One chunk = 33.33 units
|
||||
|
||||
// Background loading thread
|
||||
std::thread workerThread;
|
||||
// Background loading worker pool
|
||||
std::vector<std::thread> workerThreads;
|
||||
int workerCount = 0;
|
||||
std::mutex queueMutex;
|
||||
std::condition_variable queueCV;
|
||||
std::queue<TileCoord> loadQueue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue