Vector of three elements of type 'float'. More...
#include <helios_vector_types.h>
Public Member Functions | |
vec3 | normalize () |
Normalize vector components such that the magnitude is unity. | |
float | magnitude () const |
Compute the vector magnitude. | |
constexpr | vec3 () |
Default constructor. | |
vec3 (const std::vector< float > &v) | |
Initialize vec3 using a vector of floats. | |
constexpr | vec3 (const float v[3]) |
Initialize vec3 using an array of floats. | |
constexpr | vec3 (float v0, float v1, float v2) |
Initialize vec3 using three floats. | |
constexpr float | operator* (const vec3 &a) const noexcept |
Dot (scalar) product of two vec3 vectors. | |
constexpr vec3 | operator+ (const vec3 &a) const noexcept |
Sum of two vec3 vectors. | |
vec3 & | operator+= (const vec3 &a) noexcept |
Increment vec3 vector. | |
vec3 & | operator-= (const vec3 &a) noexcept |
Decrement vec3 vector. | |
vec3 & | operator*= (float a) noexcept |
Multiplication assignment operator for vec3 vector. | |
vec3 & | operator/= (float a) noexcept |
Division assignment operator for vec2 vector. | |
constexpr vec3 | operator- (const vec3 &a) const noexcept |
Difference of two vec3 vectors. | |
constexpr vec3 | operator* (float a) const noexcept |
Multiply each element by scalar (scalar is multiplied on right: vec3*a) | |
vec3 | operator/ (float a) const noexcept |
Divide each element by scalar (scalar is divided on right: vec3/a) | |
constexpr vec3 | operator+ (float a) const noexcept |
Add a scalar to each element (scalar is added on right: vec3+a) | |
constexpr vec3 | operator- (float a) const noexcept |
Subtract a scalar from each element (scalar is subtracted on right: vec3-a) | |
constexpr bool | operator== (const vec3 &a) const noexcept |
check for equality of two vec3 vectors | |
constexpr bool | operator!= (const vec3 &a) const noexcept |
check for inequality of two vec3 vectors | |
constexpr vec3 | operator- () const noexcept |
Multiply vector by -1. | |
Data Fields | |
float | x |
First element in vector. | |
float | y |
Second element in vector. | |
float | z |
Third element in vector. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const helios::vec3 &vec) |
Write vec3 to output stream. | |
Vector of three elements of type 'float'.
Definition at line 881 of file helios_vector_types.h.
|
inlineconstexpr |
|
inlineexplicit |
Initialize vec3 using a vector of floats.
Definition at line 918 of file helios_vector_types.h.
|
inlineexplicitconstexpr |
Initialize vec3 using an array of floats.
Definition at line 927 of file helios_vector_types.h.
|
inlineconstexpr |
Initialize vec3 using three floats.
Definition at line 931 of file helios_vector_types.h.
|
inline |
Compute the vector magnitude.
Definition at line 906 of file helios_vector_types.h.
|
inline |
Normalize vector components such that the magnitude is unity.
Definition at line 891 of file helios_vector_types.h.
|
constexprnoexcept |
check for inequality of two vec3 vectors
Definition at line 1070 of file helios_vector_types.h.
|
constexprnoexcept |
Dot (scalar) product of two vec3 vectors.
Definition at line 997 of file helios_vector_types.h.
|
constexprnoexcept |
Multiply each element by scalar (scalar is multiplied on right: vec3*a)
Definition at line 1053 of file helios_vector_types.h.
|
inlinenoexcept |
Multiplication assignment operator for vec3 vector.
Definition at line 1019 of file helios_vector_types.h.
Sum of two vec3 vectors.
Definition at line 1001 of file helios_vector_types.h.
|
constexprnoexcept |
Add a scalar to each element (scalar is added on right: vec3+a)
Definition at line 1033 of file helios_vector_types.h.
Increment vec3 vector.
Definition at line 1005 of file helios_vector_types.h.
|
constexprnoexcept |
Multiply vector by -1.
Definition at line 1074 of file helios_vector_types.h.
Difference of two vec3 vectors.
Definition at line 1041 of file helios_vector_types.h.
|
constexprnoexcept |
Subtract a scalar from each element (scalar is subtracted on right: vec3-a)
Definition at line 1045 of file helios_vector_types.h.
Decrement vec3 vector.
Definition at line 1012 of file helios_vector_types.h.
|
inlinenoexcept |
Divide each element by scalar (scalar is divided on right: vec3/a)
Definition at line 1061 of file helios_vector_types.h.
|
inlinenoexcept |
Division assignment operator for vec2 vector.
Definition at line 1026 of file helios_vector_types.h.
|
constexprnoexcept |
check for equality of two vec3 vectors
Definition at line 1066 of file helios_vector_types.h.
|
friend |
Write vec3 to output stream.
Definition at line 964 of file helios_vector_types.h.
float helios::vec3::x |
First element in vector.
Definition at line 884 of file helios_vector_types.h.
float helios::vec3::y |
Second element in vector.
Definition at line 886 of file helios_vector_types.h.
float helios::vec3::z |
Third element in vector.
Definition at line 888 of file helios_vector_types.h.