Skip to main content

DeadzoneStrategy.ixx File

Abstract base class for gamepad axis deadzone normalization strategies. More...

Included Headers

#include <algorithm>

Namespaces Index

namespacehelios
namespaceengine
namespaceinput
namespacegamepad

Classes Index

classDeadzoneStrategy

Abstract strategy interface for normalizing gamepad stick input with deadzone handling. More...

Description

Abstract base class for gamepad axis deadzone normalization strategies.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7#include <algorithm>
8
9export module helios.engine.input.gamepad.DeadzoneStrategy;
10
11
13
24
25 protected:
26
37
38 public:
39
43 static constexpr float DEFAULT_STICK_NOISE_THRESHOLD = 0.002f;
44
48 virtual ~DeadzoneStrategy() = default;
49
53 DeadzoneStrategy() = default;
54
66
78 virtual void normalize(float deadzone, float& x, float& y) const noexcept = 0;
79
80
92 }
93
103 void setStickNoiseThreshold(float threshold) noexcept {
104 stickNoiseThreshold_ = std::clamp(threshold, 0.0f, 0.9f);
105 }
106 };
107
108}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.