TwinStickInputSystem.ixx File
Input component for twin-stick gamepad controls. More...
Included Headers
#include <memory>
#include <helios.engine.common.tags.SystemRole>
#include <helios.engine.modules.physics.motion.commands.SteeringCommand>
#include <helios.engine.modules.physics.motion.commands.Move2DCommand>
#include <helios.engine.mechanics.lifecycle.components.DeadTagComponent>
#include <helios.engine.mechanics.combat.commands.Aim2DCommand>
#include <helios.engine.runtime.messaging.command.EngineCommandBuffer>
#include <helios.engine.mechanics.combat.commands.ShootCommand>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.engine.state.Bindings>
#include <helios.engine.ecs.GameObject>
#include <helios.math.utils>
#include <helios.math.types>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | mechanics |
|
High-level gameplay systems and components for game logic. More... | |
| namespace | input |
|
Input handling systems for game entities. More... | |
| namespace | systems |
|
Input processing systems that translate device input into game commands. More... | |
Classes Index
| class | TwinStickInputSystem |
|
Input component for twin-stick gamepad control schemes. More... | |
Description
Input component for twin-stick gamepad controls.
File Listing
The file content with the documentation metadata removed is:
27using namespace helios::engine::mechanics::lifecycle::components;
31export namespace helios::engine::mechanics::input::systems {
47 class TwinStickInputSystem {
60 helios::engine::ecs::GameObject gameObject_;
71 explicit TwinStickInputSystem(helios::engine::ecs::GameObject gameObject) :
79 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept {
87 auto ldir = helios::math::vec2f{0.0f, 0.0f};
93 auto rdir = helios::math::vec2f{0.0f, 0.0f};
95 if (gameObject_.has<DeadTagComponent>()) {
96 updateContext.queueCommand<helios::engine::modules::physics::motion::commands::Move2DCommand>(
99 updateContext.queueCommand<helios::engine::mechanics::combat::commands::Aim2DCommand>(
105 if (speed > helios::math::EPSILON_LENGTH) {
113 updateContext.queueCommand<helios::engine::modules::physics::motion::commands::Move2DCommand>(
117 updateContext.queueCommand<helios::engine::modules::physics::motion::commands::SteeringCommand>(
121 if (freq > helios::math::EPSILON_LENGTH) {
126 updateContext.queueCommand<helios::engine::mechanics::combat::commands::Aim2DCommand>(
134 updateContext.queueCommand<helios::engine::mechanics::combat::commands::ShootCommand>(
140 updateContext.queueCommand<helios::engine::mechanics::combat::commands::ShootCommand>(
156 void setUseDedicatedShootInput(bool useDedicatedInput) noexcept {
165 [[nodiscard]] bool useDedicatedShootInput() const noexcept {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.