mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix yaw conversions for online movement/entities
This commit is contained in:
parent
275914b4db
commit
3dac9ae657
3 changed files with 65 additions and 29 deletions
|
|
@ -685,8 +685,12 @@ void Application::update(float deltaTime) {
|
|||
|
||||
// Sync orientation: camera yaw (degrees) → WoW orientation (radians)
|
||||
float yawDeg = renderer->getCharacterYaw();
|
||||
float wowOrientation = glm::radians(yawDeg - 90.0f);
|
||||
gameHandler->setOrientation(wowOrientation);
|
||||
// Keep all game-side orientation in canonical space.
|
||||
// We historically sent serverYaw = radians(yawDeg - 90). With the new
|
||||
// canonical<->server mapping (serverYaw = PI/2 - canonicalYaw), the
|
||||
// equivalent canonical yaw is radians(180 - yawDeg).
|
||||
float canonicalYaw = core::coords::normalizeAngleRad(glm::radians(180.0f - yawDeg));
|
||||
gameHandler->setOrientation(canonicalYaw);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue