1#ifndef _FIRSTPERSONCONTROLLER_HPP_
2#define _FIRSTPERSONCONTROLLER_HPP_
73 void Update(
float deltaTime)
override;
92 void SetFlying(
bool flying);
111 void UpdateInput(
float deltaTime)
override;
113 void UpdateCamera(
float deltaTime)
override;
116 float m_maxWalkSpeed = 2.5f;
117 float m_sprintMultiplier = 2.0f;
118 bool m_sprinting =
false;
119 float m_maxAcceleration = 10.0f;
120 float m_brakingDeceleration = 12.0f;
121 float m_groundFriction = 8.0f;
122 float m_airControl = 0.05f;
126 float m_jumpZVelocity = 3.0f;
129 bool m_flying =
false;
130 float m_maxFlySpeed = 10.0f;
131 float m_flySprintMultiplier = 2.5f;
132 float m_flyVerticalInput = 0.0f;
133 float m_flyVerticalVelocity = 0.0f;
136 float m_pitch = 0.0f;
144 bool m_firstFrame =
true;
148 std::string m_keyPressedHandlerId;
149 std::string m_keyReleasedHandlerId;
CameraController(GameObject *object)
void SetGroundFriction(float friction)
float GetMaxFlySpeed() const
void SetBrakingDeceleration(float decel)
float GetMaxWalkSpeed() const
float GetSprintSpeedMultiplier() const
void SetSprintSpeedMultiplier(float mult)
void SetJumpZVelocity(float vel)
FirstPersonController(GameObject *object)
void SetAirControl(float airControl)
void SetMaxWalkSpeed(float speed)
float GetJumpZVelocity() const
void Update(float deltaTime) override
bool Initialize() override
Grabs the sibling RigidbodyComponent and derives initial yaw/pitch from the camera's facing.
void SetEnabled(bool enabled) override
Toggles relative mouse mode and, when re-enabling, resets velocity and re-syncs yaw/pitch.
void SetMaxFlySpeed(float speed)
void SetMaxAcceleration(float accel)
void SetVerticalFlyInput(float v)
void ToggleCursor(bool enable) override
Shows or hides the OS cursor and, typically, toggles relative mouse mode.
void SetFlySprintMultiplier(float mult)
void SetPitch(float pitch)
Root namespace for everything the engine exposes.