71 return std::sqrt(
x *
x +
y *
y +
z *
z);
80 return x *
x +
y *
y +
z *
z;
113 return (*
this - other).Length();
123 return (*
this - other).LengthSquared();
128 return Vec3(
x + other.
x,
y + other.
y,
z + other.
z);
132 return Vec3(
x - other.
x,
y - other.
y,
z - other.
z);
136 return Vec3(
x * scalar,
y * scalar,
z * scalar);
140 return Vec3(
x / scalar,
y / scalar,
z / scalar);
172 return x == other.
x &&
y == other.
y &&
z == other.
z;
176 return !(*
this == other);
188 return a.
x * b.
x + a.
y * b.
y + a.
z * b.
z;
200 a.
y * b.
z - a.
z * b.
y,
201 a.
z * b.
x - a.
x * b.
z,
202 a.
x * b.
y - a.
y * b.
x
Definition audio_group.cpp:7
Vec3 Cross(const Vec3 &a, const Vec3 &b)
Cross product of two vectors.
Definition vec3.h:198
float Dot(const Vec3 &a, const Vec3 &b)
Dot product of two vectors.
Definition vec3.h:187
3D vector for spatial audio positioning
Definition vec3.h:46
Vec3 operator/(float scalar) const
Definition vec3.h:139
float y
Y component.
Definition vec3.h:48
Vec3 & operator*=(float scalar)
Definition vec3.h:157
Vec3 operator+(const Vec3 &other) const
Definition vec3.h:127
float z
Z component.
Definition vec3.h:49
bool operator==(const Vec3 &other) const
Definition vec3.h:171
float LengthSquared() const
Get the squared length of the vector (faster, no sqrt)
Definition vec3.h:79
Vec3 & operator-=(const Vec3 &other)
Definition vec3.h:150
Vec3()
Default constructor (initializes to origin)
Definition vec3.h:54
Vec3(float x, float y, float z)
Constructor with components.
Definition vec3.h:63
float x
X component.
Definition vec3.h:47
void Normalize()
Normalize the vector in place.
Definition vec3.h:86
Vec3 operator-(const Vec3 &other) const
Definition vec3.h:131
float Length() const
Get the length of the vector.
Definition vec3.h:70
Vec3 & operator+=(const Vec3 &other)
Definition vec3.h:143
float DistanceSquared(const Vec3 &other) const
Calculate squared distance to another point (faster, no sqrt)
Definition vec3.h:122
Vec3 operator*(float scalar) const
Definition vec3.h:135
Vec3 & operator/=(float scalar)
Definition vec3.h:164
float Distance(const Vec3 &other) const
Calculate distance to another point.
Definition vec3.h:112
Vec3 Normalized() const
Get a normalized copy of the vector.
Definition vec3.h:100
bool operator!=(const Vec3 &other) const
Definition vec3.h:175