early-access version 3561

This commit is contained in:
pineappleEA
2023-05-07 06:43:19 +02:00
parent 9f7d9cd3f1
commit 4fa09f2af9
25 changed files with 203 additions and 58 deletions

View File

@@ -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{};
};

View File

@@ -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;
}