49 return x == 0.0f &&
y == 0.0f &&
z == 0.0f;
142 return std::sqrt(
x *
x +
y *
y +
z *
z);
150 return x *
x +
y *
y +
z *
z;
158 return std::abs(
x) + std::abs(
y) + std::abs(
z);
178 return a.
x == b.
x && a.
y == b.
y && a.
z == b.
z;
float squaredLength() const
Returns the squared length of this vector.
Vector & operator*=(float c)
In-place scale vector operator.
float manhattanLength() const
Returns the manhattan length of this vector.
float length() const
Returns the length of this vector.
Vector operator-(const Vector &v) const
Subtract vector operator.
Vector operator/(float c) const
Scale vector operator.
Vector(float x, float y, float z=0.0f)
Vector & operator/=(float c)
In-place scale vector operator.
Vector operator*(float c) const
Scale vector operator.
Vector & operator-=(const Vector &v)
In-place subtract vector operator.
Vector normalized() const
Returns a normalized version of this vector.
Vector & operator+=(const Vector &v)
In-place add vector operator.
Vector operator+(const Vector &v) const
Add vector operator.
bool isNull() const
Returns true if all coordinates are set to 0, otherwise returns false.
bool operator==(const Vector &a, const Vector &b)
std::ostream & operator<<(std::ostream &os, const Vector &v)
Appends a string representation of a vector to the output stream.