Add configuration option for ghost reset distance. Improve documentation.

This commit is contained in:
2025-12-20 17:12:58 -05:00
parent faf3f239d8
commit 7a3705d342
25 changed files with 132 additions and 28 deletions

View File

@@ -8,6 +8,7 @@
#include "collisions.h"
#include "ghost.h"
// Flashlight smoothing and locomotion constants tuned for the maze scale.
const float lightoffsetmax = 15.0;
const float light_persist_factor = 0.99;
const float light_offset_factor = 0.01;
@@ -16,6 +17,8 @@ const float jumpvelocity = 8.104849;
const float vacceleration = -13.4058;
const float hvelocity = 10.0;
// Player glues together camera orientation, flashlight pose, and collision-aware
// movement inside the maze geometry.
class Player {
public:
@@ -52,8 +55,8 @@ class Player {
float prevy;
bool first_mouse;
bool first_frame;
float light_xpersist;
float light_ypersist;
float light_xpersist; // smoothed horizontal flashlight offset
float light_ypersist; // smoothed vertical flashlight offset
float armlength;
float prev_move_time;
float mouse_xoffset;
@@ -64,14 +67,14 @@ class Player {
glm::vec3 camera_up;
glm::vec3 light_pos;
glm::vec3 light_front;
glm::vec3 velocity;
glm::vec3 camera_offset;
glm::vec3 velocity; // accumulated velocity, including gravity
glm::vec3 camera_offset; // camera lift above feet
void set_light_offset(float xoffset, float yoffset);
glm::vec3 get_normal_from_index(int ix);
glm::vec3 get_vec3_from_indices(int ix, int jx);
glm::vec3 check_intersection(glm::vec3 movement);
glm::vec3 check_intersection(glm::vec3 movement); // clamp movement vector by wall hits
};