7#ifndef LUX_COMFORT_CAM_H
8#define LUX_COMFORT_CAM_H
19 return afComfortFovDeg * 3.14159265f / 180.0f;
26 if(afCapDeg <= 0)
return 1.0f;
27 float fLen = std::sqrt(afSpeedX * afSpeedX + afSpeedY * afSpeedY);
28 if(fLen <= 0)
return 1.0f;
31 return fLimited / fLen;
39 if(fCapDeg <= 0)
return 0;
40 return fCapDeg / 52.5f;
46 if(afTimeStep <= 0)
return 0;
47 const float kPi = 3.14159265f;
48 float fDYaw = std::fmod(afYaw - afPrevYaw, 2 * kPi);
49 if(fDYaw > kPi) fDYaw -= 2 * kPi;
50 if(fDYaw < -kPi) fDYaw += 2 * kPi;
51 float fDPitch = afPitch - afPrevPitch;
52 return std::sqrt(fDYaw * fDYaw + fDPitch * fDPitch) / afTimeStep * 180.0f / kPi;
the comfort pass (PLAN.md "Comfort pass").
static const float kLuxVanillaFov
float LuxComfortLimitStep(float afStepRad, float afTimeStep, float afCapDeg)
Limit one frame's angle step (radians) to the cap; 0 cap = untouched.
float LuxComfortTurnCapDeg(float afTurnSpeed)
Forced turn cap in degrees per second, or 0 for no cap (vanilla).
float LuxComfortAngularSpeedDeg(float afPrevPitch, float afPrevYaw, float afPitch, float afYaw, float afTimeStep)
Wrapped yaw / pitch change between two frames, in deg/s (for the dev bridge trace).
static const float kLuxCueFullFovMul
static const float kLuxCueFullRollRad
float LuxComfortHeadMoveCap(float afTurnSpeed)
Scripted head moves (MovePlayerHeadPos) in m/s, proportional to the turn cap: Comfort (52....
float LuxComfortBaseFovRad(float afStockFovRad, float afComfortFovDeg)
Base vertical FOV in radians.
float LuxComfortTurnSpeedScale(float afSpeedX, float afSpeedY, float afCapDeg)
Factor (<= 1) that brings a 2D angular speed (rad/s, pitch and yaw) under the forced turn cap.