7 #include <serine/Serializable.hpp>
22 struct Vector4f :
public serine::Serializable {
37 :
x(0),
y(0),
z(0),
w(0) {}
39 : x(x), y(y), z(z), w(w) {}
41 :
x(v),
y(v),
z(v),
d(v) {}
55 x *= v.
x;
y *= v.
y;
z *= v.
z;
w *= v.
w;
71 x /= v.
x;
y /= v.
y;
z /= v.
z;
w /= v.
w;
87 x += v.
x;
y += v.
y;
z += v.
z;
w += v.
w;
95 x -= v.
x;
y -= v.
y;
z -= v.
z;
w -= v.
w;
102 return (std::string(
"Vec4f{x=") + std::to_string(
x) +
103 ", y=" + std::to_string(
y) +
104 ", z=" + std::to_string(
z) +
105 ", w=" + std::to_string(
w) +
"}");
108 operator btVector4()
const;
112 operator btQuaternion()
const;
148 return (std::string(
"Quat{x=") + std::to_string(
x) +
149 ", y=" + std::to_string(
y) +
150 ", z=" + std::to_string(
z) +
151 ", w=" + std::to_string(
w) +
"}");
154 using Vector4f::operator=;
155 using Vector4f::operator btVector4;
156 using Vector4f::operator btQuaternion;
160 return v.
x*v.
x + v.
y*v.
y + v.
z*v.
z + v.
d*v.
d;
164 return std::sqrt(v.
x*v.
x + v.
y*v.
y + v.
z*v.
z + v.
d*v.
d);
168 return v.
x*w.
x + v.
y*w.
y + v.
z*w.
z + v.
w*w.
w;
176 const float l =
length(q);
float s
Definition: Vector4f.hpp:24
float yaw
Definition: Vector4f.hpp:24
Quaternion & operator*=(const Quaternion &)
Definition: Vector4f.cpp:72
constexpr Vector4f(float x, float y, float z, float w)
Definition: Vector4f.hpp:38
Definition: GameController.hpp:7
float w
Definition: Vector4f.hpp:33
float g
Definition: Vector4f.hpp:27
std::string toString() const
Definition: Vector4f.hpp:101
float u
Definition: Vector4f.hpp:30
float psi
Definition: Vector4f.hpp:30
float heading
Definition: Vector4f.hpp:24
constexpr Vector4f(float v)
Definition: Vector4f.hpp:40
constexpr Vector4f()
Definition: Vector4f.hpp:36
float attitude
Definition: Vector4f.hpp:27
Definition: Vector4f.hpp:117
Quaternion operator/(const Quaternion &) const =delete
Vector4f & operator-=(const Vector4f &v)
Definition: Vector4f.hpp:94
float tilt
Definition: Vector4f.hpp:30
bool fuzzyEqual(const Vector4f &, float threshold=.01f) const
Definition: Vector4f.cpp:32
float x
Definition: Vector4f.hpp:24
float r
Definition: Vector4f.hpp:24
constexpr Vector4f operator-(const Vector4f &v) const
Definition: Vector4f.hpp:91
4-dimensional float-based vector/point storage and manipulation struct
Definition: Vector4f.hpp:22
Quaternion & operator/=(const Quaternion &)=delete
constexpr float dot(const Vector2f &v1, const Vector2f &v2)
Definition: Vector2f.hpp:115
Vector4f toAxAngle() const
Definition: Vector4f.cpp:106
Quaternion & fromAero(float tetha, float phi, float psi)
Definition: Vector4f.cpp:117
float bank
Definition: Vector4f.hpp:30
Vector4f & operator+=(const Vector4f &v)
Definition: Vector4f.hpp:86
constexpr Quaternion()
Definition: Vector4f.hpp:119
float phi
Definition: Vector4f.hpp:27
float z
Definition: Vector4f.hpp:30
float azimuth
Definition: Vector4f.hpp:24
Vector4f & operator*=(float v)
Definition: Vector4f.hpp:62
Quaternion & fromAxAngle(float x, float y, float z, float r)
Definition: Vector4f.cpp:98
2-dimensional float-based vector/point storage and manipulation struct
Definition: Vector2f.hpp:23
constexpr Quaternion conjugate(const Quaternion &q)
Definition: Vector4f.hpp:180
float t
Definition: Vector4f.hpp:27
float d
Definition: Vector4f.hpp:33
float y
Definition: Vector4f.hpp:27
float b
Definition: Vector4f.hpp:30
std::string toString() const
Definition: Vector4f.hpp:147
constexpr Vector4f operator*(float v) const
Definition: Vector4f.hpp:59
Vector4f & operator/=(const Vector4f &v)
Definition: Vector4f.hpp:70
constexpr Vector4f operator*(const Vector4f &v) const
Definition: Vector4f.hpp:51
Vector4f & operator/=(float v)
Definition: Vector4f.hpp:78
void serialize(serine::Archiver &)
Definition: Vector4f.cpp:51
float pitch
Definition: Vector4f.hpp:27
float a
Definition: Vector4f.hpp:33
Definition: Matrix4f.hpp:25
float length(const Vector4f &v)
Definition: Vector4f.hpp:163
Vector4f & operator*=(const Vector4f &v)
Definition: Vector4f.hpp:54
float elevation
Definition: Vector4f.hpp:27
Vector3f toAero() const
Definition: Vector4f.cpp:138
Quaternion operator*(const Quaternion &) const
Definition: Vector4f.cpp:63
constexpr Vector4f operator-() const
Definition: Vector4f.hpp:47
constexpr Vector4f operator/(float v) const
Definition: Vector4f.hpp:75
Matrix4f toMatrix() const
Definition: Vector4f.cpp:166
constexpr float length2(const Vector4f &v)
Definition: Vector4f.hpp:159
float tetha
Definition: Vector4f.hpp:24
float v
Definition: Vector4f.hpp:33
constexpr Vector4f operator+(const Vector4f &v) const
Definition: Vector4f.hpp:83
Vector4f & operator=(const btVector4 &)
Definition: Vector4f.cpp:27
float roll
Definition: Vector4f.hpp:30
3-dimensional float-based vector/point storage and manipulation struct
Definition: Vector3f.hpp:27
Vector2f normalize(const Vector2f &v)
Definition: Vector2f.hpp:118
constexpr Vector4f operator/(const Vector4f &v) const
Definition: Vector4f.hpp:67