summary refs log tree commit diff
path: root/src/Entities/Player.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities/Player.hpp')
-rw-r--r--src/Entities/Player.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Entities/Player.hpp b/src/Entities/Player.hpp
index f6c1f9a..c8a1c1f 100644
--- a/src/Entities/Player.hpp
+++ b/src/Entities/Player.hpp
@@ -29,6 +29,8 @@ private:
         Bool positive, negative;
     };
 
+    Bool can_collide() const;
+
     struct ProcessCollisionsResult {
         Position::World position;
         Vector<3, BlockedAxis> blocked_axes;
@@ -39,6 +41,7 @@ private:
     Position::World movement(GFX::Window& window, const Time& time, Vec3 input_direction);
     Vec3 walking_velocity(GFX::Window& window, const Time& time, Vec3 input_direction);
     Vec3 flying_velocity(GFX::Window& window, const Time& time, Vec3 input_direction);
+    Vec3 noclip_velocity(GFX::Window& window, const Time& time, Vec3 input_direction);
 
     void actions(GFX::Window& window, World::World& world);
 
@@ -53,8 +56,17 @@ private:
     // Returns position of the center of the bottom face of `box`.
     static Position::World position_for_bounding_box(AABB box);
 
+    enum class MovementMode {
+        // Gravity, collision, and normal movement
+        Walking,
+        // Collisions, but no gravity, and normal movement
+        Flying,
+        // No collisions, no gravity, movement in the facing direction
+        NoClip,
+    };
+
+    MovementMode m_movement = MovementMode::Walking;
     Bool m_on_ground = false;
-    Bool m_flying = false;
 
     Vec3 m_velocity{};
     Transform m_transform;