template<class T>
nCine::Vector3 class

Three-component vector.

Public static variables

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

Public static functions

static auto Dot(Vector3 v1, Vector3 v2) -> T
static auto Cross(Vector3 v1, Vector3 v2) -> Vector3
static auto Lerp(Vector3 a, Vector3 b, float t) -> Vector3

Constructors, destructors, conversion operators

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

Public functions

auto operator=(const Vector3& other) -> Vector3& noexcept
auto operator=(Vector3&& other) -> Vector3& noexcept
void Set(T x, T y, T z)
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 Vector3& v) const -> bool
auto operator!=(const Vector3& v) const -> bool
auto operator-() const -> Vector3
auto operator+=(const Vector3& v) -> Vector3&
auto operator-=(const Vector3& v) -> Vector3&
auto operator*=(const Vector3& v) -> Vector3&
auto operator/=(const Vector3& v) -> Vector3&
auto operator+=(T s) -> Vector3&
auto operator-=(T s) -> Vector3&
auto operator*=(T s) -> Vector3&
auto operator/=(T s) -> Vector3&
auto operator+(const Vector3& v) const -> Vector3
auto operator-(const Vector3& v) const -> Vector3
auto operator*(const Vector3& v) const -> Vector3
auto operator/(const Vector3& v) const -> Vector3
auto operator+(T s) const -> Vector3
auto operator-(T s) const -> Vector3
auto operator*(T s) const -> Vector3
auto operator/(T s) const -> Vector3
auto Length() const -> T
auto SqrLength() const -> T
auto Normalized() const -> Vector3
auto Normalize() -> Vector3&
template<class S>
auto As() -> Vector3<S>
Converts elements of the vector to a specified type.
auto ToVector2() const -> Vector2<T>

Public variables

T X
T Y
T Z

Friends

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