Math::Vector3 struct

A vector of 3 float values (x, y, z).

Constructors, destructors, conversion operators

Vector3()
Vector3(const Vector3& other)
Vector3(float x, float y, float z)

Public functions

auto Length() const -> float
Returns the length of the vector, computed as the square root of then sum of its components squared.
auto Normalized() const -> Vector3
Returns a normalized version of this vector. Being normalized means it has a length of 1.0.
auto Dot(const Vector3& other) const -> float
Computes the dot product between this vector and other.
auto Cross(const Vector3& other) const -> Vector3
Computes the cross product between this vector and other.
auto operator+=(const Vector3&) -> Vector3&
VECTOR 3.
auto operator+=(float) -> Vector3&
auto operator-=(const Vector3&) -> Vector3&
auto operator-=(float) -> Vector3&
auto operator*=(float) -> Vector3&
auto operator/=(float) -> Vector3&

Public variables

float x
float y
float z

Function documentation

float Math::Vector3::Dot(const Vector3& other) const

Computes the dot product between this vector and other.

Parameters
other

The dot product is computed as a.x * b.x + a.y * b.y + a.z * b.z

Vector3 Math::Vector3::Cross(const Vector3& other) const

Computes the cross product between this vector and other.

Parameters
other

This will return a vector that is perpendicular to both vectors.