Vector of four elements of type 'float'. More...
#include <helios_vector_types.h>
Public Member Functions | |
vec4 | normalize () |
Normalize vector components such that the magnitude is unity. | |
float | magnitude () const |
Compute the vector magnitude. | |
constexpr | vec4 () |
Default constructor. | |
vec4 (const std::vector< float > &v) | |
Initialize vec4 using a vector of floats. | |
constexpr | vec4 (const float v[4]) |
Initialize vec3 using an array of floats. | |
constexpr | vec4 (float v0, float v1, float v2, float v3) |
Initialize vec4 using four floats. | |
constexpr float | operator* (const vec4 &a) const noexcept |
Dot (scalar) product of two vec4 vectors. | |
constexpr vec4 | operator+ (const vec4 &a) const noexcept |
Sum of two vec4 vectors. | |
vec4 & | operator+= (const vec4 &a) noexcept |
Increment vec4 vector. | |
vec4 & | operator-= (const vec4 &a) noexcept |
Decrement vec4 vector. | |
vec4 & | operator*= (float a) noexcept |
Multiplication assignment operator for vec4 vector. | |
vec4 & | operator/= (float a) noexcept |
Division assignment operator for vec4 vector. | |
constexpr vec4 | operator- (const vec4 &a) const noexcept |
Difference of two vec4 vectors. | |
constexpr vec4 | operator* (float a) const noexcept |
Multiply each element by scalar (scalar is multiplied on right: vec4*a) | |
vec4 | operator/ (float a) const noexcept |
Divide each element by scalar (scalar is divided on right: vec4/a) | |
constexpr vec4 | operator+ (float a) const noexcept |
Add a scalar to each element (scalar is added on right: vec4+a) | |
constexpr vec4 | operator- (float a) const noexcept |
Subtract a scalar from each element (scalar is subtracted on right: vec4-a) | |
constexpr bool | operator== (const vec4 &a) const noexcept |
check for equality of two vec4 vectors | |
constexpr bool | operator!= (const vec4 &a) const noexcept |
check for equality of two vec4 vectors | |
constexpr vec4 | operator- () const noexcept |
Multiply each element by -1. | |
Data Fields | |
float | x |
First element in vector. | |
float | y |
Second element in vector. | |
float | z |
Third element in vector. | |
float | w |
Fourth element in vector. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const helios::vec4 &vec) |
Write vec4 to output stream. | |
Vector of four elements of type 'float'.
Definition at line 1082 of file helios_vector_types.h.
|
inlineconstexpr |
|
inlineexplicit |
Initialize vec4 using a vector of floats.
Definition at line 1123 of file helios_vector_types.h.
|
inlineexplicitconstexpr |
Initialize vec3 using an array of floats.
Definition at line 1133 of file helios_vector_types.h.
|
inlineconstexpr |
Initialize vec4 using four floats.
Definition at line 1137 of file helios_vector_types.h.
|
inline |
Compute the vector magnitude.
Definition at line 1111 of file helios_vector_types.h.
|
inline |
Normalize vector components such that the magnitude is unity.
Definition at line 1095 of file helios_vector_types.h.
|
constexprnoexcept |
check for equality of two vec4 vectors
Definition at line 1275 of file helios_vector_types.h.
|
constexprnoexcept |
Dot (scalar) product of two vec4 vectors.
Definition at line 1198 of file helios_vector_types.h.
|
constexprnoexcept |
Multiply each element by scalar (scalar is multiplied on right: vec4*a)
Definition at line 1258 of file helios_vector_types.h.
|
inlinenoexcept |
Multiplication assignment operator for vec4 vector.
Definition at line 1222 of file helios_vector_types.h.
Sum of two vec4 vectors.
Definition at line 1202 of file helios_vector_types.h.
|
constexprnoexcept |
Add a scalar to each element (scalar is added on right: vec4+a)
Definition at line 1238 of file helios_vector_types.h.
Increment vec4 vector.
Definition at line 1206 of file helios_vector_types.h.
|
constexprnoexcept |
Multiply each element by -1.
Definition at line 1279 of file helios_vector_types.h.
Difference of two vec4 vectors.
Definition at line 1246 of file helios_vector_types.h.
|
constexprnoexcept |
Subtract a scalar from each element (scalar is subtracted on right: vec4-a)
Definition at line 1250 of file helios_vector_types.h.
Decrement vec4 vector.
Definition at line 1214 of file helios_vector_types.h.
|
inlinenoexcept |
Divide each element by scalar (scalar is divided on right: vec4/a)
Definition at line 1266 of file helios_vector_types.h.
|
inlinenoexcept |
Division assignment operator for vec4 vector.
Definition at line 1230 of file helios_vector_types.h.
|
constexprnoexcept |
check for equality of two vec4 vectors
Definition at line 1271 of file helios_vector_types.h.
|
friend |
Write vec4 to output stream.
Definition at line 1170 of file helios_vector_types.h.
float helios::vec4::w |
Fourth element in vector.
Definition at line 1092 of file helios_vector_types.h.
float helios::vec4::x |
First element in vector.
Definition at line 1086 of file helios_vector_types.h.
float helios::vec4::y |
Second element in vector.
Definition at line 1088 of file helios_vector_types.h.
float helios::vec4::z |
Third element in vector.
Definition at line 1090 of file helios_vector_types.h.