bigger commits
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
|
||||
const glm::vec3 worldUp = { 0.0f, 1.0f, 0.0f };
|
||||
|
||||
// Mouse sensitivity asked at startup (see main.cpp). 0 = keep the camera's built-in default.
|
||||
inline float StartupCmPer360 = 0.0f;
|
||||
inline float StartupMouseDpi = 800.0f;
|
||||
|
||||
class Camera {
|
||||
public:
|
||||
bool lockedcursor = true;
|
||||
@@ -28,7 +32,15 @@ public:
|
||||
float FOV = 110.0f;
|
||||
float screenshake = 0.0f;
|
||||
|
||||
Camera() {}
|
||||
Camera() {
|
||||
if (StartupCmPer360 > 0.0f) SetSensitivityCm(StartupCmPer360, StartupMouseDpi);
|
||||
}
|
||||
|
||||
// Turn sensitivity into "this many cm of mouse travel per full 360 degree turn" for a mouse
|
||||
// of the given DPI (mouse counts per inch).
|
||||
void SetSensitivityCm(float cmPer360, float dpi) {
|
||||
sensitivity = 6.2831853f / (cmPer360 / 2.54f * dpi);
|
||||
}
|
||||
|
||||
void AddScreenshake(float amount) {
|
||||
screenshake += amount;
|
||||
|
||||
Reference in New Issue
Block a user