5#ifndef SAPPHIRE_MATHS_VECTOR3_GUARD
6#define SAPPHIRE_MATHS_VECTOR3_GUARD
97 constexpr Vec3(T _x, T _y, T _z)
noexcept;
104 constexpr Vec3(T _scale)
noexcept;
120 template <
typename TIn>
131 template <
typename TIn>
141 template <typename TIn>
163 constexpr
bool Equals(const
Vec3& _other, T _epsilon = std::numeric_limits<T>::epsilon()) const noexcept;
173 constexpr
bool operator==(const
Vec3 & _rhs) const noexcept;
182 constexpr
bool operator!=(const
Vec3 & _rhs) const noexcept;
200 const T*
Data() const noexcept;
210 T& operator[](uint32_t _index);
219 const T& operator[](uint32_t _index) const;
310 static constexpr T
Dot(const
Vec3& _lhs, const
Vec3& _rhs) noexcept;
473 constexpr
Vec3 operator-() const noexcept;
482 Vec3 operator*(T _scale) const noexcept;
491 Vec3 operator/(T _scale) const;
500 constexpr
Vec3 operator+(const
Vec3& _rhs) const noexcept;
509 constexpr
Vec3 operator-(const
Vec3& _rhs) const noexcept;
518 constexpr
Vec3 operator*(const
Vec3& _rhs) const noexcept;
536 constexpr T operator|(const
Vec3& _rhs) const noexcept;
545 constexpr
Vec3 operator^(const
Vec3& _rhs) const noexcept;
555 Vec3& operator*=(T _scale) noexcept;
614 template <typename T>
615 constexpr
Vec3<T> operator*(typename std::remove_cv<T>::type _lhs, const
Vec3<T>& _rhs) noexcept;
625 template <typename T>
626 Vec3<T> operator/(typename std::remove_cv<T>::type _lhs, const
Vec3<T>& _rhs);
642 template <
typename T>
643 std::string ToString(
const Vec3<T>& _v);
664 template <
typename T>
690#include <SA/Maths/Space/Vector3.inl>
Cosinus method implementation.
Maths module Debug compatibility definition.
Degree type implementation.
Equals method implementation.
Lerp algorithms implementation.
Square Root algorithm implementation.
Maths Degree type.
Definition Degree.hpp:37
Vector 2 Sapphire's class.
Definition Vector2.hpp:41
Vector 3 Sapphire-Maths class.
Definition Vector3.hpp:43
static const Vec3 Forward
Down vector constant {0, 0, 1}.
Definition Vector3.hpp:77
Vec3 Reflect(const Vec3 &_normal, float _elasticity=1.0f) const noexcept
Reflect this vector over the normal.
static const Vec3 Down
Down vector constant {0, -1, 0}.
Definition Vector3.hpp:74
static const Vec3 Zero
Zero vector constant {0, 0, 0}.
Definition Vector3.hpp:59
static Vec3 LerpUnclamped(const Vec3 &_start, const Vec3 &_end, float _alpha) noexcept
Unclamped Lerp from _start to _end at _alpha.
static constexpr Vec3 DirN(const Vec3 &_start, const Vec3 &_end)
Compute the Normalized Direction from _start to _end.
constexpr Vec3(T _scale) noexcept
Scale Value constructor.
Vec3()=default
Default constructor.
T z
Vector's Z component (axis value).
Definition Vector3.hpp:54
constexpr T Length() const
Getter of the length of this vector.
static const Vec3 Right
Right vector constant {1, 0, 0}.
Definition Vector3.hpp:65
static Vec3 SLerp(const Vec3 &_start, const Vec3 &_end, float _alpha) noexcept
Clamped SLerp from _start to _end at _alpha.
Vec3 & Normalize()
Normalize this vector.
Vec3 GetNormalized() const
Normalize this vector.
constexpr T SqrLength() const noexcept
Getter of the Squared Length of this vector.
Vec3 ProjectOnToNormal(const Vec3 &_normal) const noexcept
Project this vector onto s normal.
T Type
Type of the Vector.
Definition Vector3.hpp:45
constexpr bool IsZero() const noexcept
Whether this vector is a zero vector.
static Vec3 SLerpUnclamped(const Vec3 &_start, const Vec3 &_end, float _alpha) noexcept
Unclamped SLerp from _start to _end at _alpha.
constexpr bool Equals(const Vec3 &_other, T _epsilon=std::numeric_limits< T >::epsilon()) const noexcept
Compare 2 vector.
static constexpr T SqrDist(const Vec3 &_start, const Vec3 &_end) noexcept
Compute the Squared Distance between _lhs and _rhs.
constexpr Vec3(const Vec3< TIn > &_other) noexcept
Value constructor from another Vec3 type.
Vec3(Vec3 &&)=default
Default move constructor.
constexpr Vec3(const Vec2< TIn > &_other, T _z=T(0)) noexcept
Value constructor from Vec2.
static constexpr T Dist(const Vec3 &_start, const Vec3 &_end)
Compute the Distance between _lhs and _rhs.
constexpr bool IsNormalized() const noexcept
Whether this vector is normalized.
static const Vec3 One
One vector constant {1, 1, 1}.
Definition Vector3.hpp:62
static constexpr Vec3< T > Cross(const Vec3 &_lhs, const Vec3 &_rhs) noexcept
Compute the Cross product between _lhs and _rhs.
Vec3(const Vec3 &)=default
Default copy constructor.
T * Data() noexcept
Getter of vector data
static constexpr T Dot(const Vec3 &_lhs, const Vec3 &_rhs) noexcept
Compute the Dot product between _lhs and _rhs.
T y
Vector's Y component (axis value).
Definition Vector3.hpp:51
static Deg< T > AngleUnsigned(const Vec3 &_start, const Vec3 &_end) noexcept
Compute the Unsigned Angle between _lhs and _rhs.
static constexpr Vec3 Dir(const Vec3 &_start, const Vec3 &_end) noexcept
Compute the Non-Normalized Direction from _lhs and _rhs.
static const Vec3 Up
Up vector constant {0, 1, 0}.
Definition Vector3.hpp:71
T x
Vector's X component (axis value).
Definition Vector3.hpp:48
Vec3 ProjectOnTo(const Vec3 &_other) const noexcept
Project this vector onto an other vector.
constexpr Vec3(T _x, T _y, T _z) noexcept
Value constructor.
static const Vec3 Backward
Down vector constant {0, 0, -1}.
Definition Vector3.hpp:80
static const Vec3 Left
Left vector constant {-1, 0, 0}.
Definition Vector3.hpp:68
static Deg< T > Angle(const Vec3 &_start, const Vec3 &_end, const Vec3 &_normal=Vec3::Up) noexcept
Compute the Signed Angle between _lhs and _rhs.
static Vec3 Lerp(const Vec3 &_start, const Vec3 &_end, float _alpha) noexcept
Clamped Lerp from _start to _end at _alpha.
Vector 4 Sapphire-Maths class.
Definition Vector4.hpp:41