mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix jump collision and WMO doodad rotation bugs
Prevent character from being yanked down during upward jump movement, and correct quaternion rotation for holiday decorations.
This commit is contained in:
parent
28330adfb0
commit
af0a3a4daf
2 changed files with 6 additions and 3 deletions
|
|
@ -964,8 +964,8 @@ void CameraController::update(float deltaTime) {
|
|||
float fallCatch = 3.0f;
|
||||
float dz = *groundH - feetZ;
|
||||
|
||||
if (dz <= stepUp && dz >= -fallCatch &&
|
||||
(verticalVelocity <= 0.0f || *groundH > feetZ)) {
|
||||
// Only snap to ground when falling/landing (not when jumping up)
|
||||
if (dz <= stepUp && dz >= -fallCatch && verticalVelocity <= 0.0f) {
|
||||
newPos.z = *groundH + eyeHeight;
|
||||
verticalVelocity = 0.0f;
|
||||
grounded = true;
|
||||
|
|
|
|||
|
|
@ -451,9 +451,12 @@ std::shared_ptr<PendingTile> TerrainManager::prepareTile(int x, int y) {
|
|||
|
||||
// Build doodad's local transform (WoW coordinates)
|
||||
// WMO doodads use quaternion rotation
|
||||
// Fix: WoW quaternions need X/Y swap for correct orientation
|
||||
glm::quat fixedRotation(doodad.rotation.w, doodad.rotation.y, doodad.rotation.x, doodad.rotation.z);
|
||||
|
||||
glm::mat4 doodadLocal(1.0f);
|
||||
doodadLocal = glm::translate(doodadLocal, doodad.position);
|
||||
doodadLocal *= glm::mat4_cast(doodad.rotation);
|
||||
doodadLocal *= glm::mat4_cast(fixedRotation);
|
||||
doodadLocal = glm::scale(doodadLocal, glm::vec3(doodad.scale));
|
||||
|
||||
// Full world transform = WMO world transform * doodad local transform
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue