|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Component that handles VR player movement using controller inputs. More...
#include <VrMovementComponent.h>
Public Member Functions | |
| VrMovementComponent (Scene *owningScene, Headset *headset, Input::XrInputHandler *inputHandler) | |
| Constructs the VR movement component. | |
| ~VrMovementComponent () override=default | |
| void | beginPlay () override |
| Called when the component is added to the scene or the game starts. | |
| void | tick (double deltaTime) override |
| Called every frame if ticking is enabled. | |
| void | endPlay () override |
| Called when the component is removed or the game ends. | |
| void | setMoveSpeed (float speed) |
| Sets the horizontal movement speed in units per second. | |
| float | getMoveSpeed () const |
| void | setVerticalSpeed (float speed) |
| Sets the vertical movement speed in units per second. | |
| float | getVerticalSpeed () const |
| void | setDeadzone (float deadzone) |
| Sets the deadzone for thumbstick input (0.0 to 1.0) | |
| float | getDeadzone () const |
| Public Member Functions inherited from EngineCore::LogicComponent | |
| LogicComponent (Scene *owningScene) | |
| virtual | ~LogicComponent ()=default |
| bool | canTick () const |
| Checks if the component is currently set to tick. | |
| void | setCanTick (bool enable) |
| Enables or disables ticking for this component. | |
| Entity * | getOwningEntity () const |
| Gets the entity this component belongs to. | |
Static Public Attributes | |
| static constexpr bool | IsUnique = true |
| Static Public Attributes inherited from EngineCore::LogicComponent | |
| static constexpr bool | IsUnique = false |
| Defines whether multiple instances of this component can exist on the same entity. Defaults to false (multiple allowed). Override in derived classes with static constexpr bool IsUnique = true; if needed. | |
Private Member Functions | |
| glm::vec3 | getHeadsetForwardXZ () const |
Private Attributes | |
| Headset * | headset_ = nullptr |
| Input::XrInputHandler * | inputHandler_ = nullptr |
| float | moveSpeed_ = 3.0f |
| float | verticalSpeed_ = 2.0f |
| float | deadzone_ = 0.15f |
Additional Inherited Members | |
| Protected Member Functions inherited from EngineCore::LogicComponent | |
| Scene * | getScene () const |
| Gets the scene this component belongs to. | |
| SceneManager * | getSceneManager () const |
| Helper to get the SceneManager from the owning scene. | |
Component that handles VR player movement using controller inputs.
Definition at line 21 of file VrMovementComponent.h.
| EngineCore::VrMovementComponent::VrMovementComponent | ( | Scene * | owningScene, |
| Headset * | headset, | ||
| Input::XrInputHandler * | inputHandler ) |
Constructs the VR movement component.
| owningScene | The scene this component belongs to |
| headset | Pointer to the headset for updating player position |
| inputHandler | Pointer to the XR input handler |
Definition at line 9 of file VrMovementComponent.cpp.
References headset_, inputHandler_, EngineCore::LogicComponent::LogicComponent(), and EngineCore::LogicComponent::setCanTick().
|
overridedefault |
|
overridevirtual |
Called when the component is added to the scene or the game starts.
Reimplemented from EngineCore::LogicComponent.
Definition at line 17 of file VrMovementComponent.cpp.
References EngineCore::LogicComponent::beginPlay().
|
overridevirtual |
Called when the component is removed or the game ends.
Reimplemented from EngineCore::LogicComponent.
Definition at line 64 of file VrMovementComponent.cpp.
References EngineCore::LogicComponent::endPlay().
|
inlinenodiscard |
Definition at line 55 of file VrMovementComponent.h.
References deadzone_.
|
private |
Definition at line 69 of file VrMovementComponent.cpp.
References headset_.
Referenced by tick().
|
inlinenodiscard |
Definition at line 43 of file VrMovementComponent.h.
References moveSpeed_.
|
inlinenodiscard |
Definition at line 49 of file VrMovementComponent.h.
References verticalSpeed_.
|
inline |
Sets the deadzone for thumbstick input (0.0 to 1.0)
Definition at line 54 of file VrMovementComponent.h.
References deadzone_.
|
inline |
Sets the horizontal movement speed in units per second.
Definition at line 42 of file VrMovementComponent.h.
References moveSpeed_.
|
inline |
Sets the vertical movement speed in units per second.
Definition at line 48 of file VrMovementComponent.h.
References verticalSpeed_.
|
overridevirtual |
Called every frame if ticking is enabled.
| deltaTime | Time elapsed since last frame. |
Reimplemented from EngineCore::LogicComponent.
Definition at line 23 of file VrMovementComponent.cpp.
References deadzone_, getHeadsetForwardXZ(), headset_, inputHandler_, Input::LEFT, moveSpeed_, Input::RIGHT, and verticalSpeed_.
|
private |
Definition at line 65 of file VrMovementComponent.h.
Referenced by getDeadzone(), setDeadzone(), and tick().
|
private |
Definition at line 60 of file VrMovementComponent.h.
Referenced by getHeadsetForwardXZ(), tick(), and VrMovementComponent().
|
private |
Definition at line 61 of file VrMovementComponent.h.
Referenced by tick(), and VrMovementComponent().
|
staticconstexpr |
Definition at line 23 of file VrMovementComponent.h.
|
private |
Definition at line 63 of file VrMovementComponent.h.
Referenced by getMoveSpeed(), setMoveSpeed(), and tick().
|
private |
Definition at line 64 of file VrMovementComponent.h.
Referenced by getVerticalSpeed(), setVerticalSpeed(), and tick().