mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
physics: sync camera pitch to movement packets and mount tilt during flight
- Add setMovementPitch() and isSwimming() to GameHandler - In the per-frame sync block, derive the pitch angle from the camera's forward vector (asin of the Z component) and write it to movementInfo.pitch whenever FLYING or SWIMMING flags are set — the server includes the pitch field in those packets, so sending 0 made other players see the character flying perfectly flat even when the camera was pitched - Also tilt the mount model (setMountPitchRoll) to match the flight direction during player-controlled flight, and reset to 0 when not flying
This commit is contained in:
parent
132598fc88
commit
920d6ac120
2 changed files with 29 additions and 0 deletions
|
|
@ -1179,6 +1179,12 @@ public:
|
|||
bool isHovering() const {
|
||||
return (movementInfo.flags & static_cast<uint32_t>(MovementFlags::HOVER)) != 0;
|
||||
}
|
||||
bool isSwimming() const {
|
||||
return (movementInfo.flags & static_cast<uint32_t>(MovementFlags::SWIMMING)) != 0;
|
||||
}
|
||||
// Set the character pitch angle (radians) for movement packets (flight / swimming).
|
||||
// Positive = nose up, negative = nose down.
|
||||
void setMovementPitch(float radians) { movementInfo.pitch = radians; }
|
||||
void dismount();
|
||||
|
||||
// Taxi / Flight Paths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue