#include <vec4.hpp>
template<typename value_type, typename vector_type_raw>
move::vectormath::generic_vec4_rtm struct

A four component vector that can store either floats or doubles. The underlying implementation is RTM's vector4f or vector4d.

Template parameters
value_type The type of the components of the vector
vector_type_raw The underlying RTM vector type

Public types

using component_type = value_type
The type of the components of the vector.
using vector_type = typename vector_type_raw::type

Public static variables

static static uint32_t num_components constexpr
The number of components in the vector.

Public static functions

static auto dot(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD value_type noexcept
Returns the dot product of two vectors.
static auto distance_between_points(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD value_type noexcept
Returns the euclidean distance between two vectors as if they were points in four dimensional space.
static auto squared_distance_between_points(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD value_type noexcept
Returns the squared euclidean distance between two vectors as if they were points in four dimensional space.
static auto cross(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, const generic_vec4_rtm& v3) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Calculates the cross product between three four-dimensional vectors.
static auto angle_between_normalized_vectors(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD value_type noexcept
Returns the angle between two normalizede vectors.
static auto angle_between_vectors(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD value_type noexcept
Returns the angle between two unnormalized vectors.
static auto reflect(const generic_vec4_rtm& incident, const generic_vec4_rtm& normal) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Reflects incident across normal and returns the result.
static auto refract(const generic_vec4_rtm& incident, const generic_vec4_rtm& normal, value_type ior) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Refracts incident across normal and returns the result.
static auto lerp_unclamped(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, value_type t) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns the linear interpolation between two vectors using a single interpolation value. Can be used for extrapolation as well.
static auto lerp_unclamped(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, const generic_vec4_rtm& t) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns the linear interpolation between two vectors using a vector of interpolation values. Can be used for extrapolation as well.
static auto lerp(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, value_type t) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns the linear interpolation between two vectors using a single interpolation value. The interpolation value is clamped between 0 and 1.
static auto lerp(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, const generic_vec4_rtm& t) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns the linear interpolation between two vectors using a vector of interpolation values. The interpolation values are clamped between 0 and 1.
static auto min(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector containing the minimum x, y, z, and w components of the two vectors.
static auto max(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector containing the maximum x, y, z, and w components of the two vectors.
static auto clamp(const generic_vec4_rtm& v, const generic_vec4_rtm& min, const generic_vec4_rtm& max) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector the provided value clamped between the provided minimum and maximum vectors.
static auto filled(value_type value) -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with all components set to the provided value.
static auto infinity() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with all components set to infinity.
static auto negative_infinity() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with all components set to negative infinity.
static auto nan() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with all components set to NaN.
static auto zero() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with all components set to zero.
static auto one() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with all components set to one.
static auto x_axis() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the x component set to one and all other components set to zero.
static auto y_axis() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the y component set to one and all other components set to zero.
static auto z_axis() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the z component set to one and all other components set to zero.
static auto w_axis() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the w component set to one and all other components set to zero.
static auto left() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the x component set to negative one and all other components set to zero.
static auto right() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the x component set to one and all other components set to zero.
static auto down() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the y component set to negative one and all other components set to zero.
static auto up() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the y component set to one and all other components set to zero.
static auto backward() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the z component set to negative one and all other components set to zero.
static auto forward() -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a vector with the z component set to one and all other components set to zero.

Public functions

auto generic_vec4_rtm() -> MVM_INLINE_NODISCARD noexcept
Construct a new generic_vec4_rtm object.
auto generic_vec4_rtm(value_type x, value_type y = 0, value_type z = 0, value_type w = 0) -> MVM_INLINE_NODISCARD noexcept
Construct a new generic_vec4_rtm object.
auto generic_vec4_rtm(const vector_type& v) -> MVM_INLINE_NODISCARD noexcept
Construct a new generic_vec4_rtm object using an RTM vector.
auto get_internal() const -> MVM_INLINE_NODISCARD const vector_type& noexcept
Returns the internal RTM vector. Useful for tight loops, where RTM may outperform the higher level API.
auto get_internal() -> MVM_INLINE_NODISCARD vector_type& noexcept
Returns the internal RTM vector. Useful for tight loops, where RTM may outperform the higher level API.
template<typename Archive>
auto serialize(Archive& ar) -> MVM_INLINE void
Serializes the vector to/from an archive. Intended for use with Cereal and Cereal-like APIs.
auto operator vector_type&() -> MVM_INLINE_NODISCARD
Returns a reference to the vector as a RTM vector. This both enables the compiler to do additional optimizations, as well as allowing you to use the vector in functions that take RTM vectors directly.
auto operator const vector_type&() const -> MVM_INLINE_NODISCARD
Returns a reference to the vector as a RTM vector. This both enables the compiler to do additional optimizations, as well as allowing you to use the vector in functions that take RTM vectors directly.
auto operator==(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD bool noexcept
Determines if the vector is equal to another vector.
auto operator!=(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD bool noexcept
Determines if the vector is not equal to another vector.
auto operator<(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD bool noexcept
Determines if all components of the vector are less than the corresponding components of another vector.
auto operator<=(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD bool noexcept
Determines if all components of the vector are less than or equal to the corresponding components of another vector.
auto operator>(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD bool noexcept
Determines if all components of the vector are greater than the corresponding components of another vector.
auto operator>=(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD bool noexcept
Determines if all components of the vector are greater than or equal to the corresponding components of another vector.
auto operator=(const generic_vec4_rtm& v) -> MVM_INLINE generic_vec4_rtm& noexcept
Assigns the contents of another vector to this vector.
auto operator+=(const generic_vec4_rtm& v) -> MVM_INLINE generic_vec4_rtm& noexcept
Adds another vector to this vector and stores the result in this vector.
auto operator-=(const generic_vec4_rtm& v) -> MVM_INLINE generic_vec4_rtm& noexcept
Subtracts another vector from this vector and stores the result in this vector.
auto operator*=(value_type v) -> MVM_INLINE generic_vec4_rtm& noexcept
Multiplies this vector by a scalar and stores the result in this vector.
auto operator*=(const generic_vec4_rtm& v) -> MVM_INLINE generic_vec4_rtm& noexcept
Multiplies this vector by another vector component-wise and stores the result in this vector.
auto operator/=(value_type v) -> MVM_INLINE generic_vec4_rtm& noexcept
Divides this vector by a scalar and stores the result in this vector.
auto operator/=(const generic_vec4_rtm& v) -> MVM_INLINE generic_vec4_rtm& noexcept
Divides this vector by another vector component-wise and stores the result in this vector.
auto operator+(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Adds the other vector to this vector and returns the result. Does not modify this vector.
auto operator-(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Subtracts a vector from this vector and returns the result. Does not modify this vector.
auto operator*(value_type v) const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Multiplies this vector by a scalar and returns the result. Does not modify this vector.
auto operator*(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Multiplies this vector by another vector component-wise and returns the result. Does not modify this vector.
auto operator/(value_type v) const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Divides this vector by a scalar and returns the result. Does not modify this vector.
auto operator/(const generic_vec4_rtm& v) const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Divides this vector by another vector component-wise and returns the result. Does not modify this vector.
auto operator-() const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Negates the vector and returns the result. Does not modify this vector.
auto get_component(int index) const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the component at the specified index. If the index is out of range, the result is undefined.
auto set_component(int index, value_type value) -> MVM_INLINE void
Sets the component at the specified index. If the index is out of range, the result is undefined. Currently the w component is set.
auto operator[](int i) const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the component at the specified index. If the index is out of range, the result is undefined. Currently the w component is returned.
auto x() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the x component of the vector.
auto y() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the y component of the vector.
auto z() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the z component of the vector.
auto w() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the w component of the vector.
auto x(value_type value) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets the x component of the vector.
auto y(value_type value) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets the y component of the vector.
auto z(value_type value) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets the z component of the vector.
auto w(value_type value) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets the w component of the vector.
auto set_x(value_type x) -> MVM_INLINE generic_vec4_rtm& noexcept
Sets the x component of the vector.
auto set_y(value_type y) -> MVM_INLINE generic_vec4_rtm& noexcept
Sets the y component of the vector.
auto set_z(value_type z) -> MVM_INLINE generic_vec4_rtm& noexcept
Sets the z component of the vector.
auto set_w(value_type w) -> MVM_INLINE generic_vec4_rtm& noexcept
Sets the w component of the vector.
auto fill(component_type value) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets all components of the vector to the same value.
auto set(component_type x, component_type y, component_type z, component_type w) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets the components of the vector.
auto set(const generic_vec4_rtm& v) -> MVM_INLINE_NODISCARD generic_vec4_rtm& noexcept
Sets the components of the vector.
auto length() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the length of the vector.
auto squared_length() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the squared length of the vector.
auto reciprocal_length() const -> MVM_INLINE_NODISCARD value_type noexcept
Returns the reciprocal length of the vector.
auto normalized() const -> MVM_INLINE_NODISCARD generic_vec4_rtm noexcept
Returns a normalized copy of the vector.
auto normalize() -> MVM_INLINE void noexcept
Normalizes the vector.

Function documentation

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::dot(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns the dot product of two vectors.

Parameters
v1 The first vector
v2 The second vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::distance_between_points(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns the euclidean distance between two vectors as if they were points in four dimensional space.

Parameters
v1 The first vector
v2 The second vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::squared_distance_between_points(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns the squared euclidean distance between two vectors as if they were points in four dimensional space.

Parameters
v1 The first vector
v2 The second vector
Returns value_type The squared distance between the two vectors

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::cross(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, const generic_vec4_rtm& v3) noexcept

Calculates the cross product between three four-dimensional vectors.

Parameters
v1 The first vector
v2 The second vector
v3 The third vector
Returns generic_vec4_rtm The cross product

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::angle_between_normalized_vectors(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns the angle between two normalizede vectors.

Parameters
v1 The first vector
v2 The second vector
Returns value_type The angle between the two vectors

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::angle_between_vectors(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns the angle between two unnormalized vectors.

Parameters
v1 The first vector
v2 The second vector
Returns value_type The angle between the two vectors

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::reflect(const generic_vec4_rtm& incident, const generic_vec4_rtm& normal) noexcept

Reflects incident across normal and returns the result.

Parameters
incident The incident vector
normal The normal vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::refract(const generic_vec4_rtm& incident, const generic_vec4_rtm& normal, value_type ior) noexcept

Refracts incident across normal and returns the result.

Parameters
incident The incident vector
normal The normal vector
ior The index of refraction

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::lerp_unclamped(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, value_type t) noexcept

Returns the linear interpolation between two vectors using a single interpolation value. Can be used for extrapolation as well.

Parameters
v1 The first vector
v2 The second vector
t The interpolation value
Returns generic_vec4_rtm The result of the interpolation

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::lerp_unclamped(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, const generic_vec4_rtm& t) noexcept

Returns the linear interpolation between two vectors using a vector of interpolation values. Can be used for extrapolation as well.

Parameters
v1 The first vector
v2 The second vector
t The interpolation values
Returns generic_vec4_rtm The result of the interpolation

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::lerp(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, value_type t) noexcept

Returns the linear interpolation between two vectors using a single interpolation value. The interpolation value is clamped between 0 and 1.

Parameters
v1 The first vector
v2 The second vector
t The interpolation value
Returns generic_vec4_rtm The result of the interpolation

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::lerp(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2, const generic_vec4_rtm& t) noexcept

Returns the linear interpolation between two vectors using a vector of interpolation values. The interpolation values are clamped between 0 and 1.

Parameters
v1 The first vector
v2 The second vector
t The interpolation values
Returns generic_vec4_rtm The result of the interpolation

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::min(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns a vector containing the minimum x, y, z, and w components of the two vectors.

Parameters
v1 The first vector
v2 The second vector
Returns generic_vec4_rtm The minimum vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::max(const generic_vec4_rtm& v1, const generic_vec4_rtm& v2) noexcept

Returns a vector containing the maximum x, y, z, and w components of the two vectors.

Parameters
v1 The first vector
v2 The second vector
Returns generic_vec4_rtm The maximum vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::clamp(const generic_vec4_rtm& v, const generic_vec4_rtm& min, const generic_vec4_rtm& max) noexcept

Returns a vector the provided value clamped between the provided minimum and maximum vectors.

Parameters
v The vector to clamp
min The minimum vector
max The maximum vector
Returns generic_vec4_rtm The clamped vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::filled(value_type value) noexcept

Returns a vector with all components set to the provided value.

Parameters
value The value to fill the vector with
Returns generic_vec4_rtm The filled vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::infinity() noexcept

Returns a vector with all components set to infinity.

Returns generic_vec4_rtm The infinity vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::negative_infinity() noexcept

Returns a vector with all components set to negative infinity.

Returns generic_vec4_rtm The negative infinity vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::nan() noexcept

Returns a vector with all components set to NaN.

Returns generic_vec4_rtm The NaN vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::zero() noexcept

Returns a vector with all components set to zero.

Returns generic_vec4_rtm The zero vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::one() noexcept

Returns a vector with all components set to one.

Returns generic_vec4_rtm The one vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::x_axis() noexcept

Returns a vector with the x component set to one and all other components set to zero.

Returns generic_vec4_rtm The x axis vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::y_axis() noexcept

Returns a vector with the y component set to one and all other components set to zero.

Returns generic_vec4_rtm The y axis vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::z_axis() noexcept

Returns a vector with the z component set to one and all other components set to zero.

Returns generic_vec4_rtm The z axis vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::w_axis() noexcept

Returns a vector with the w component set to one and all other components set to zero.

Returns generic_vec4_rtm The w axis vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::left() noexcept

Returns a vector with the x component set to negative one and all other components set to zero.

Returns generic_vec4_rtm The left vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::right() noexcept

Returns a vector with the x component set to one and all other components set to zero.

Returns generic_vec4_rtm The right vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::down() noexcept

Returns a vector with the y component set to negative one and all other components set to zero.

Returns generic_vec4_rtm The down vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::up() noexcept

Returns a vector with the y component set to one and all other components set to zero.

Returns generic_vec4_rtm The up vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::backward() noexcept

Returns a vector with the z component set to negative one and all other components set to zero.

Returns generic_vec4_rtm The back vector

template<typename value_type, typename vector_type_raw>
static MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::forward() noexcept

Returns a vector with the z component set to one and all other components set to zero.

Returns generic_vec4_rtm The forward vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::generic_vec4_rtm() noexcept

Construct a new generic_vec4_rtm object.

Returns generic_vec4_rtm A new vector initialized to (0, 0, 0, 0)

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::generic_vec4_rtm(value_type x, value_type y = 0, value_type z = 0, value_type w = 0) noexcept

Construct a new generic_vec4_rtm object.

Parameters
x The x component
y The y component. Defaults to 0.
z The z component. Defaults to 0.
w The w component. Defaults to 0.
Returns generic_vec4_rtm A new vector initialized to (x, y, z, w)

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::generic_vec4_rtm(const vector_type& v) noexcept

Construct a new generic_vec4_rtm object using an RTM vector.

Parameters
v The RTM vector to copy
Returns generic_vec4_rtm A new vector initialized to v

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD const vector_type& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::get_internal() const noexcept

Returns the internal RTM vector. Useful for tight loops, where RTM may outperform the higher level API.

Returns const vector_type& A reference to the internal RTM vector.

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD vector_type& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::get_internal() noexcept

Returns the internal RTM vector. Useful for tight loops, where RTM may outperform the higher level API.

Returns vector_type& A reference to the internal RTM vector.

template<typename value_type, typename vector_type_raw> template<typename Archive>
MVM_INLINE void move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::serialize(Archive& ar)

Serializes the vector to/from an archive. Intended for use with Cereal and Cereal-like APIs.

Template parameters
Archive The archive type
Parameters
ar The archive

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator vector_type&()

Returns a reference to the vector as a RTM vector. This both enables the compiler to do additional optimizations, as well as allowing you to use the vector in functions that take RTM vectors directly.

Returns vector_type& A reference to the RTM vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator const vector_type&() const

Returns a reference to the vector as a RTM vector. This both enables the compiler to do additional optimizations, as well as allowing you to use the vector in functions that take RTM vectors directly.

Returns const vector_type& A reference to the RTM vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD bool move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator==(const generic_vec4_rtm& v) const noexcept

Determines if the vector is equal to another vector.

Parameters
v The other vector
Returns true The vectors are equal

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD bool move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator!=(const generic_vec4_rtm& v) const noexcept

Determines if the vector is not equal to another vector.

Parameters
v The other vector
Returns true The vectors are not equal

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD bool move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator<(const generic_vec4_rtm& v) const noexcept

Determines if all components of the vector are less than the corresponding components of another vector.

Parameters
v The other vector
Returns true All components of the vector are less than the corresponding components of the other vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD bool move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator<=(const generic_vec4_rtm& v) const noexcept

Determines if all components of the vector are less than or equal to the corresponding components of another vector.

Parameters
v The other vector
Returns true All components of the vector are less than or equal to the corresponding components of the other vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD bool move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator>(const generic_vec4_rtm& v) const noexcept

Determines if all components of the vector are greater than the corresponding components of another vector.

Parameters
v The other vector
Returns true All components of the vector are greater than the corresponding components of the other vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD bool move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator>=(const generic_vec4_rtm& v) const noexcept

Determines if all components of the vector are greater than or equal to the corresponding components of another vector.

Parameters
v The other vector
Returns true All components of the vector are greater than or equal to the corresponding components of the other vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator=(const generic_vec4_rtm& v) noexcept

Assigns the contents of another vector to this vector.

Parameters
v The other vector
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator+=(const generic_vec4_rtm& v) noexcept

Adds another vector to this vector and stores the result in this vector.

Parameters
v The other vector
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator-=(const generic_vec4_rtm& v) noexcept

Subtracts another vector from this vector and stores the result in this vector.

Parameters
v The other vector
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator*=(value_type v) noexcept

Multiplies this vector by a scalar and stores the result in this vector.

Parameters
v The scalar
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator*=(const generic_vec4_rtm& v) noexcept

Multiplies this vector by another vector component-wise and stores the result in this vector.

Parameters
v The other vector
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator/=(value_type v) noexcept

Divides this vector by a scalar and stores the result in this vector.

Parameters
v The scalar
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator/=(const generic_vec4_rtm& v) noexcept

Divides this vector by another vector component-wise and stores the result in this vector.

Parameters
v The other vector
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator+(const generic_vec4_rtm& v) const noexcept

Adds the other vector to this vector and returns the result. Does not modify this vector.

Parameters
v The other vector
Returns generic_vec4_rtm The result of the addition

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator-(const generic_vec4_rtm& v) const noexcept

Subtracts a vector from this vector and returns the result. Does not modify this vector.

Parameters
v The other vector
Returns generic_vec4_rtm The result of the subtraction

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator*(value_type v) const noexcept

Multiplies this vector by a scalar and returns the result. Does not modify this vector.

Parameters
v The scalar
Returns generic_vec4_rtm The result of the multiplication

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator*(const generic_vec4_rtm& v) const noexcept

Multiplies this vector by another vector component-wise and returns the result. Does not modify this vector.

Parameters
v The other vector
Returns generic_vec4_rtm The result of the multiplication

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator/(value_type v) const noexcept

Divides this vector by a scalar and returns the result. Does not modify this vector.

Parameters
v The scalar
Returns generic_vec4_rtm The result of the division

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator/(const generic_vec4_rtm& v) const noexcept

Divides this vector by another vector component-wise and returns the result. Does not modify this vector.

Parameters
v The other vector
Returns generic_vec4_rtm The result of the division

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator-() const noexcept

Negates the vector and returns the result. Does not modify this vector.

Returns generic_vec4_rtm The result of the negation

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::get_component(int index) const noexcept

Returns the component at the specified index. If the index is out of range, the result is undefined.

Parameters
index The index of the component to return
Returns value_type The component at the specified index

template<typename value_type, typename vector_type_raw>
MVM_INLINE void move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set_component(int index, value_type value)

Sets the component at the specified index. If the index is out of range, the result is undefined. Currently the w component is set.

Parameters
index The index of the component to set
value The new value for the component

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::operator[](int i) const noexcept

Returns the component at the specified index. If the index is out of range, the result is undefined. Currently the w component is returned.

Returns value_type The component at the specified index

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::x() const noexcept

Returns the x component of the vector.

Returns value_type The x component

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::y() const noexcept

Returns the y component of the vector.

Returns value_type The y component

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::z() const noexcept

Returns the z component of the vector.

Returns value_type The z component

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::w() const noexcept

Returns the w component of the vector.

Returns value_type The w component

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::x(value_type value) noexcept

Sets the x component of the vector.

Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::y(value_type value) noexcept

Sets the y component of the vector.

Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::z(value_type value) noexcept

Sets the z component of the vector.

Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::w(value_type value) noexcept

Sets the w component of the vector.

Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set_x(value_type x) noexcept

Sets the x component of the vector.

Parameters
x The new x component
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set_y(value_type y) noexcept

Sets the y component of the vector.

Parameters
y The new y component
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set_z(value_type z) noexcept

Sets the z component of the vector.

Parameters
z The new z component
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set_w(value_type w) noexcept

Sets the w component of the vector.

Parameters
w The new w component
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::fill(component_type value) noexcept

Sets all components of the vector to the same value.

Parameters
value The new value for all components
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set(component_type x, component_type y, component_type z, component_type w) noexcept

Sets the components of the vector.

Parameters
x The new x component
y The new y component
z The new z component
w The new w component
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm& move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::set(const generic_vec4_rtm& v) noexcept

Sets the components of the vector.

Parameters
v The new vector
Returns generic_vec4_rtm& A reference to the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::length() const noexcept

Returns the length of the vector.

Returns value_type The length of the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::squared_length() const noexcept

Returns the squared length of the vector.

Returns value_type The squared length of the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD value_type move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::reciprocal_length() const noexcept

Returns the reciprocal length of the vector.

Returns value_type The reciprocal length of the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE_NODISCARD generic_vec4_rtm move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::normalized() const noexcept

Returns a normalized copy of the vector.

Returns generic_vec4_rtm A normalized copy of the vector

template<typename value_type, typename vector_type_raw>
MVM_INLINE void move::vectormath::generic_vec4_rtm<value_type, vector_type_raw>::normalize() noexcept

Normalizes the vector.

Returns generic_vec4_rtm& A reference to the vector