mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-05 04:33:51 +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
|
|
@ -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