Merge pull request #10167 from german77/motion_preview
yuzu: Add motion preview to controller input
This commit is contained in:
commit
9c9b4616c3
12 changed files with 165 additions and 6 deletions
|
@ -111,6 +111,8 @@ struct AnalogProperties {
|
|||
float offset{};
|
||||
// Invert direction of the sensor data
|
||||
bool inverted{};
|
||||
// Invert the state if it's converted to a button
|
||||
bool inverted_button{};
|
||||
// Press once to activate, press again to release
|
||||
bool toggle{};
|
||||
};
|
||||
|
|
|
@ -259,6 +259,20 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
void RotateFromOrigin(float roll, float pitch, float yaw) {
|
||||
float temp = y;
|
||||
y = std::cos(roll) * y - std::sin(roll) * z;
|
||||
z = std::sin(roll) * temp + std::cos(roll) * z;
|
||||
|
||||
temp = x;
|
||||
x = std::cos(pitch) * x + std::sin(pitch) * z;
|
||||
z = -std::sin(pitch) * temp + std::cos(pitch) * z;
|
||||
|
||||
temp = x;
|
||||
x = std::cos(yaw) * x - std::sin(yaw) * y;
|
||||
y = std::sin(yaw) * temp + std::cos(yaw) * y;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr T Length2() const {
|
||||
return x * x + y * y + z * z;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue