|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Component that handles VR player movement using controller inputs. Writes locomotion to the actor's SceneNode, which the camera reads from. More...
#include <VrMovementComponent.h>
Public Member Functions | |
| VrMovement (Entities::Scene *owningScene, std::shared_ptr< Entities::SceneNode > sceneNode, Rendering::Headset *headset, Input::XrInputHandler *inputHandler) | |
| Constructs the VR movement component. | |
| ~VrMovement () 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 dead zone for thumbstick input (0.0 to 1.0) | |
| float | getDeadZone () const |
| Public Member Functions inherited from Engine::Components::Logic | |
| Logic (Entities::Scene *owningScene) | |
| Logic (const Entities::SpawnContext &context) | |
| virtual | ~Logic ()=default |
| virtual std::string | getComponentName () const |
| Gets the component type name for debugging/UI. | |
| virtual bool | drawImGui () |
| Draws component-specific ImGui inspector controls. | |
| virtual bool | drawImGuiName () |
| Used to alter the name of the entity in the outliner. | |
| bool | hasBegunPlay () const |
| bool | canTick () const |
| Checks if the component is currently set to tick. | |
| void | setCanTick (bool enable) |
| Enables or disables ticking for this component. | |
| Entities::Entity * | getOwningEntity () const |
| Gets the entity this component belongs to. | |
Static Public Attributes | |
| static constexpr bool | IsUnique = true |
| static constexpr const char * | ComponentName = "VrMovement" |
| Static Public Attributes inherited from Engine::Components::Logic | |
| 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. | |
| static constexpr const char * | ComponentName = "Logic" |
| Fallback component type name. Derived classes may override getComponentName() for custom labels. | |
Private Member Functions | |
| glm::vec3 | getHeadsetForwardXZ () const |
Private Attributes | |
| std::shared_ptr< Entities::SceneNode > | sceneNode_ |
| Rendering::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 Engine::Components::Logic | |
| Entities::Scene * | getScene () const |
| Gets the scene this component belongs to. | |
| Core::SceneManager * | getSceneManager () const |
| Helper to get the SceneManager from the owning scene. | |
Component that handles VR player movement using controller inputs. Writes locomotion to the actor's SceneNode, which the camera reads from.
Definition at line 27 of file VrMovementComponent.h.
| Engine::Components::VrMovement::VrMovement | ( | Entities::Scene * | owningScene, |
| std::shared_ptr< Entities::SceneNode > | sceneNode, | ||
| Rendering::Headset * | headset, | ||
| Input::XrInputHandler * | inputHandler ) |
Constructs the VR movement component.
| owningScene | The scene this component belongs to |
| sceneNode | Scene node to write position to (typically actor's node) |
| headset | Pointer to the headset for orientation queries |
| inputHandler | Pointer to the XR input handler |
|
overridedefault |
|
overridevirtual |
Called when the component is added to the scene or the game starts.
Reimplemented from Engine::Components::Logic.
|
overridevirtual |
Called when the component is removed or the game ends.
Reimplemented from Engine::Components::Logic.
|
inlinenodiscard |
Definition at line 68 of file VrMovementComponent.h.
References deadZone_.
|
nodiscardprivate |
|
inlinenodiscard |
Definition at line 56 of file VrMovementComponent.h.
References moveSpeed_.
|
inlinenodiscard |
Definition at line 62 of file VrMovementComponent.h.
References verticalSpeed_.
|
inline |
Sets the dead zone for thumbstick input (0.0 to 1.0)
Definition at line 67 of file VrMovementComponent.h.
References deadZone_.
|
inline |
Sets the horizontal movement speed in units per second.
Definition at line 55 of file VrMovementComponent.h.
References moveSpeed_.
|
inline |
Sets the vertical movement speed in units per second.
Definition at line 61 of file VrMovementComponent.h.
References verticalSpeed_.
|
overridevirtual |
Called every frame if ticking is enabled.
| deltaTime | Time elapsed since last frame. |
Reimplemented from Engine::Components::Logic.
|
staticconstexpr |
Definition at line 30 of file VrMovementComponent.h.
|
private |
Definition at line 79 of file VrMovementComponent.h.
Referenced by getDeadZone(), and setDeadZone().
|
private |
Definition at line 74 of file VrMovementComponent.h.
|
private |
Definition at line 75 of file VrMovementComponent.h.
|
staticconstexpr |
Definition at line 29 of file VrMovementComponent.h.
|
private |
Definition at line 77 of file VrMovementComponent.h.
Referenced by getMoveSpeed(), and setMoveSpeed().
|
private |
Definition at line 73 of file VrMovementComponent.h.
|
private |
Definition at line 78 of file VrMovementComponent.h.
Referenced by getVerticalSpeed(), and setVerticalSpeed().