mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix taxi mount orientation and eliminate tile loading hitches
Fixes two critical taxi flight issues: 1. Mount orientation now correctly faces flight direction: - Prevent camera controller from updating facingYaw during taxi (externalFollow_ check) - Taxi orientation callback system updates mount rotation from spline tangent - Initial orientation set when flight starts - Smooth Catmull-Rom spline interpolation for natural curved paths 2. Eliminate frame hitches from tile loading during flight: - New taxiFlightStartCallback uploads ALL precached tiles to GPU before flight begins - Previously tiles loaded async during 3s mount delay but uploaded 1/frame during flight - Now processAllReadyTiles() blocks briefly after mount delay to batch upload everything - Combined with 2.0s terrain update interval and aggressive culling for smooth flight Additional optimizations: - Aggressive taxi culling: skip models <15 units, all foliage/trees, underwater objects - Max render distance reduced to 150 units during taxi - Movement heartbeat packets disabled during taxi (server controls position) - Reduced taxi speed from 32 to 18 units/sec to prevent streaming overload
This commit is contained in:
parent
536b3cea48
commit
2e0a7e0039
7 changed files with 119 additions and 21 deletions
|
|
@ -420,10 +420,9 @@ void Application::update(float deltaTime) {
|
|||
}
|
||||
if (renderer && renderer->getTerrainManager()) {
|
||||
renderer->getTerrainManager()->setStreamingEnabled(true);
|
||||
// With 8GB tile cache, keep streaming active during taxi at moderate rate.
|
||||
// Increase load radius to pre-cache tiles ahead of flight path.
|
||||
// With 8GB tile cache and precaching, minimize streaming during taxi
|
||||
if (onTaxi) {
|
||||
renderer->getTerrainManager()->setUpdateInterval(0.3f);
|
||||
renderer->getTerrainManager()->setUpdateInterval(2.0f); // Very infrequent updates - already precached
|
||||
renderer->getTerrainManager()->setLoadRadius(2); // 5x5 grid for taxi (each tile ~533 yards)
|
||||
} else {
|
||||
// Ramp streaming back in after taxi to avoid end-of-flight hitches.
|
||||
|
|
@ -466,7 +465,8 @@ void Application::update(float deltaTime) {
|
|||
}
|
||||
|
||||
// Send movement heartbeat every 500ms (keeps server position in sync)
|
||||
if (gameHandler && renderer) {
|
||||
// Skip during taxi flights - server controls position
|
||||
if (gameHandler && renderer && !onTaxi) {
|
||||
movementHeartbeatTimer += deltaTime;
|
||||
if (movementHeartbeatTimer >= 0.5f) {
|
||||
movementHeartbeatTimer = 0.0f;
|
||||
|
|
@ -718,6 +718,23 @@ void Application::setupUICallbacks() {
|
|||
renderer->getTerrainManager()->precacheTiles(tilesToLoad);
|
||||
});
|
||||
|
||||
// Taxi orientation callback - update mount rotation during flight
|
||||
gameHandler->setTaxiOrientationCallback([this](float orientationRadians) {
|
||||
if (renderer && renderer->getCameraController()) {
|
||||
// Convert radians to degrees for camera controller
|
||||
float yawDegrees = glm::degrees(orientationRadians);
|
||||
renderer->getCameraController()->setFacingYaw(yawDegrees);
|
||||
}
|
||||
});
|
||||
|
||||
// Taxi flight start callback - upload all precached tiles to GPU before flight begins
|
||||
gameHandler->setTaxiFlightStartCallback([this]() {
|
||||
if (renderer && renderer->getTerrainManager()) {
|
||||
LOG_INFO("Uploading all precached tiles to GPU before taxi flight...");
|
||||
renderer->getTerrainManager()->processAllReadyTiles();
|
||||
}
|
||||
});
|
||||
|
||||
// Creature move callback (online mode) - update creature positions
|
||||
gameHandler->setCreatureMoveCallback([this](uint64_t guid, float x, float y, float z, uint32_t durationMs) {
|
||||
auto it = creatureInstances_.find(guid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue