Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
PlayerControllerComponent.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "core/EngineAPI.hpp"
5
6
11// [ReflectClass]
14 // [ReflectField]
15 float speed = 5.0f;
17 // [ReflectField]
18 float jumpForce = 6.0f;
20 // [ReflectField]
21 float interactRange = 3.0f;
22
24 // [ReflectField]
25 bool orientToMovement = true;
26
28 bool wasJumpPressed = false;
30 bool wasInteractPressed = false;
31
35 glm::vec3 debugRbVelocity{0.0f};
37 float debugMoveDirLength = 0.0f;
38};
39
40
41REGISTER_COMPONENT(PlayerControllerComponent, "Gameplay/Player Controller");
42
43
44
45
46
47
48
#define REGISTER_COMPONENT(Type, MenuPath)
Definition ComponentReflection.hpp:156
#define ENGINE_API
Definition EngineAPI.hpp:10
Component to mark and control player movement and interaction.
Definition PlayerControllerComponent.hpp:12
float debugMoveDirLength
Debug movement input magnitude.
Definition PlayerControllerComponent.hpp:37
int debugRunningCount
Debug frame count diagnostic.
Definition PlayerControllerComponent.hpp:33
float interactRange
Maximum interaction distance for objects.
Definition PlayerControllerComponent.hpp:21
bool orientToMovement
Whether character rotates to face the direction of movement.
Definition PlayerControllerComponent.hpp:25
float speed
Movement speed multiplier (units/sec).
Definition PlayerControllerComponent.hpp:15
bool wasInteractPressed
Transient flag set when interact key is pressed.
Definition PlayerControllerComponent.hpp:30
glm::vec3 debugRbVelocity
Debug rigid body velocity diagnostic vector.
Definition PlayerControllerComponent.hpp:35
bool wasJumpPressed
Transient flag set when jump key is pressed.
Definition PlayerControllerComponent.hpp:28
float jumpForce
Vertical impulse force applied when jumping.
Definition PlayerControllerComponent.hpp:18