template<class T>
nCine::Vector4 class

Four-component vector.

Public static variables

static const Vector4 Zero
A vector with all zero elements.
static const Vector4 XAxis
A unit vector on the X axis.
static const Vector4 YAxis
A unit vector on the Y axis.
static const Vector4 ZAxis
A unit vector on the Z axis.
static const Vector4 WAxis
A unit vector on the W axis.

Public static functions

static auto Dot(const Vector4& v1, const Vector4& v2) -> T
static auto Lerp(const Vector4& a, const Vector4& b, float t) -> Vector4

Constructors, destructors, conversion operators

Vector4() constexpr noexcept
Vector4(NoInitT) explicit noexcept
Vector4(T s) explicit constexpr noexcept
Vector4(T x, T y, T z, T w) constexpr noexcept
Vector4(const Vector2<T>& other, T z, T w) constexpr noexcept
Vector4(Vector2<T>&& other, T z, T w) constexpr noexcept
Vector4(const Vector3<T>& other, T w) constexpr noexcept
Vector4(Vector3<T>&& other, T w) constexpr noexcept
Vector4(const Vector4& other) constexpr noexcept
Vector4(Vector4&& other) constexpr noexcept

Public functions

auto operator=(const Vector4& other) -> Vector4& noexcept
auto operator=(Vector4&& other) -> Vector4& noexcept
void Set(T x, T y, T z, T w)
auto Data() -> T*
auto Data() const -> const T*
auto operator[](std::size_t index) -> T&
auto operator[](std::size_t index) const -> const T&
auto operator==(const Vector4& v) const -> bool
auto operator!=(const Vector4& v) const -> bool
auto operator-() const -> Vector4
auto operator+=(const Vector4& v) -> Vector4&
auto operator-=(const Vector4& v) -> Vector4&
auto operator*=(const Vector4& v) -> Vector4&
auto operator/=(const Vector4& v) -> Vector4&
auto operator+=(T s) -> Vector4&
auto operator-=(T s) -> Vector4&
auto operator*=(T s) -> Vector4&
auto operator/=(T s) -> Vector4&
auto operator+(const Vector4& v) const -> Vector4
auto operator-(const Vector4& v) const -> Vector4
auto operator*(const Vector4& v) const -> Vector4
auto operator/(const Vector4& v) const -> Vector4
auto operator+(T s) const -> Vector4
auto operator-(T s) const -> Vector4
auto operator*(T s) const -> Vector4
auto operator/(T s) const -> Vector4
auto Length() const -> T
auto SqrLength() const -> T
auto Normalized() const -> Vector4
auto Normalize() -> Vector4&
template<class S>
auto As() -> Vector4<S>
Converts elements of the vector to a specified type.
auto ToVector2() const -> Vector2<T>
auto ToVector3() const -> Vector3<T>

Public variables

T X
T Y
T Z
T W

Friends

template<class S>
auto operator*(S s, const Vector4<S>& v) -> Vector4<S>