33 explicit v3(
const std::tuple<float, float, float> &
a);
40 explicit v3(
const float *
a);
68 return x *
x +
y *
y +
z *
z;
95 return {-this->
x, -this->
y, -this->
z};
108 constexpr n3(
float a,
float b,
float c)
#define ASSERT(x)
Assert that a value is true.
#define ADD_CATCH_FORMATTER_DEF(TYPE)
An operator/(const An &lhs, float rhs)
constexpr float min(float lhs, float rhs)
An operator-(const An &lhs, const An &rhs)
constexpr bool is_equal(float lhs, float rhs, float epsilon=kk::epsilon)
v3 lerp_v3(const v3 &f, float v, const v3 &t)
An operator+(const An &lhs, const An &rhs)
An operator*(const An &lhs, float rhs)
std::string string_from(const An &a)
constexpr float max(float lhs, float rhs)
A quaternion representing a rotation in 3d.
A (inclusive) range between two values.
constexpr n3 operator-() const
bool operator==(const n3 &rhs)=delete
constexpr n3(float a, float b, float c)
asserts that the length is 1
constexpr n3(const v3 &v)
asserts that the length is 1
constexpr bool is_valid() const
returns false if the length isn't 1
float * get_data_ptr()
Returns an array to the data.
void operator/=(float rhs)
constexpr v3(float ax, float ay, float az)
constexpr float get_length_squared() const
Returns the squared length of the vector.
static v3 from_to(const v3 &from, const v3 &to)
creates a vector going from from to to
void operator+=(const v3 &rhs)
void operator-=(const v3 &rhs)
std::optional< n3 > get_normalized() const
Returns a unit vector.
static v3 from_localspace_rui(const Q &rotation, float right, float up, float in)
Creates a vector in quaterion local space from Right Up In.
float dot(const v3 &rhs) const
bool normalize()
Changes the length to 1.
void operator*=(float rhs)
v3(const std::tuple< float, float, float > &a)
const float * get_data_ptr() const
Returns an array to the data.
v3 cross(const v3 &u) const
float get_length() const
Returns the length of the vector.
bool operator==(const v3 &rhs)=delete
v3(const float *a)
assumes the given pointer is a array of 3 floats