physics: implement HOVER movement flag physics in CameraController

When the server sets MovementFlags::HOVER (SMSG_MOVE_SET_HOVER), the
player now floats 4 yards above the nearest ground surface instead of
standing on it. Uses the existing floor-snap path with a HOVER_HEIGHT
offset applied to the snap target.

- game_handler.hpp: add isHovering() accessor (reads HOVER flag from
  movementInfo.flags, which is already set by handleForceMoveFlagChange)
- camera_controller.hpp: add hoverActive_ field and setHoverActive()
- camera_controller.cpp: apply HOVER_HEIGHT = 4.0f offset at floor snap
- application.cpp: sync hover state each frame alongside other movement
  states (gravity, feather fall, water walk, flying)
This commit is contained in:
Kelsi 2026-03-10 13:39:23 -07:00
parent 56ec49f837
commit 23293d6453
4 changed files with 11 additions and 1 deletions

View file

@ -1018,6 +1018,7 @@ void Application::update(float deltaTime) {
renderer->getCameraController()->setFeatherFallActive(gameHandler->isFeatherFalling());
renderer->getCameraController()->setWaterWalkActive(gameHandler->isWaterWalking());
renderer->getCameraController()->setFlyingActive(gameHandler->isPlayerFlying());
renderer->getCameraController()->setHoverActive(gameHandler->isHovering());
}
bool onTaxi = gameHandler &&

View file

@ -1249,7 +1249,10 @@ void CameraController::update(float deltaTime) {
dz >= -0.25f && dz <= stepUp * 1.5f);
if (dz >= -fallCatch && (nearGround || airFalling || slopeGrace)) {
targetPos.z = *groundH;
// HOVER: float at fixed height above ground instead of standing on it
static constexpr float HOVER_HEIGHT = 4.0f; // ~4 yards above ground
const float snapH = hoverActive_ ? (*groundH + HOVER_HEIGHT) : *groundH;
targetPos.z = snapH;
verticalVelocity = 0.0f;
grounded = true;
lastGroundZ = *groundH;