|
| TVector2 ()=default |
|
| TVector2 (const TVector2 &other)=default |
|
| TVector2 (TVector2 &&other)=default |
|
TVector2 & | operator= (const TVector2 &rhs)=default |
|
TVector2 & | operator= (TVector2 &&rhs)=default |
|
| ~TVector2 ()=default |
|
| TVector2 (T vx, T vy) |
|
template<typename U > |
| TVector2 (const TVector2< U > &other) |
|
template<typename U > |
TVector2< U > | losslessCast () const |
|
T & | x () |
|
T & | y () |
|
const T & | x () const |
|
const T & | y () const |
|
T & | u () |
|
T & | v () |
|
const T & | u () const |
|
const T & | v () const |
|
T | dot (const TVector2< T > &rhs) const |
|
T | dot (T rhs) const |
|
T | absDot (const TVector2< T > &rhs) const |
|
T | absDot (T rhs) const |
|
T | length () const |
|
T | lengthSquared () const |
|
TVector2< T > | safeNormalize (const TVector2< T > &fallback=TVector2< T >{}) const |
|
std::size_t | minDimension () const |
|
std::size_t | maxDimension () const |
|
constexpr std::size_t | size () const noexcept |
| Number of elements of the array.
|
|
TVector2< T > | add (const TVector2< T > &rhs) const |
|
TVector2< T > | add (T rhs) const |
|
TVector2< T > & | addLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | addLocal (T rhs) |
|
TVector2< T > | sub (const TVector2< T > &rhs) const |
|
TVector2< T > | sub (T rhs) const |
|
TVector2< T > & | subLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | subLocal (T rhs) |
|
TVector2< T > | mul (const TVector2< T > &rhs) const |
|
TVector2< T > | mul (T rhs) const |
|
TVector2< T > & | mulLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | mulLocal (T rhs) |
|
TVector2< T > | div (const TVector2< T > &rhs) const |
|
TVector2< T > | div (T rhs) const |
|
TVector2< T > & | divLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | divLocal (T rhs) |
|
TVector2< T > | pow (U exponent) const |
|
TVector2< T > | pow (const TVector2< T > &exponent) const |
|
TVector2< T > & | powLocal (U exponent) |
|
TVector2< T > & | powLocal (const TVector2< T > &exponent) |
|
TVector2< T > | exp (U exponent) const |
| Sets the array to \( e^exponent \).
|
|
TVector2< T > | exp (const TVector2< T > &exponent) const |
| Sets the array to \( e^{exponent_i} \).
|
|
TVector2< T > & | expLocal (U exponent) |
|
TVector2< T > & | expLocal (const TVector2< T > &exponent) |
|
TVector2< T > | sqrt () const |
|
TVector2< T > & | sqrtLocal () |
|
TVector2< T > | clamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. None of value , lowerBound and upperBound can be NaN, or the method's behavior is undefined.
|
|
TVector2< T > | clamp (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) const |
|
TVector2< T > & | clampLocal (T lowerBound, T upperBound) |
|
TVector2< T > & | clampLocal (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) |
|
TVector2< T > | safeClamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. If a floating-point value is non-finite (e.g., being Inf, NaN), its value is clamped to lowerBound . Neither lowerBound nor upperBound can be NaN, or the method's behavior is undefined.
|
|
TVector2< T > | safeClamp (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) const |
|
TVector2< T > & | safeClampLocal (T lowerBound, T upperBound) |
|
TVector2< T > & | safeClampLocal (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) |
|
TVector2< T > | abs () const |
|
TVector2< T > & | absLocal () |
|
TVector2< T > | rcp () const |
|
TVector2< T > & | rcpLocal () |
|
TVector2< T > | complement () const |
| Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
|
|
TVector2< T > & | complementLocal () |
|
TVector2< T > | negate () const |
| Applies a negative sign to the array's elements. These methods is only defined for signed element types.
|
|
TVector2< T > & | negateLocal () |
|
T | sum () const |
|
T | avg () const |
|
T | product () const |
|
T | min () const |
|
TVector2< T > | min (const TVector2< T > &other) const |
|
std::size_t | minIndex () const |
|
T | max () const |
|
TVector2< T > | max (const TVector2< T > &other) const |
|
std::size_t | maxIndex () const |
|
TVector2< T > | ceil () const |
|
TVector2< T > | floor () const |
|
TVector2< T > | lerp (const TVector2< T > &rhs, U factor) const |
|
bool | isZero () const |
|
bool | isNonNegative () const |
|
bool | isFinite () const |
|
TVector2< T > & | set (T value) |
|
TVector2< T > & | set (std::size_t index, T value) |
|
TVector2< T > & | set (const std::array< T, N > &values) |
|
auto | begin () noexcept -> typename std::array< T, N >::iterator |
|
auto | begin () const noexcept -> typename std::array< T, N >::const_iterator |
|
auto | end () noexcept -> typename std::array< T, N >::iterator |
|
auto | end () const noexcept -> typename std::array< T, N >::const_iterator |
|
bool | isEqual (const TVector2< T > &other) const |
|
bool | isNear (const TVector2< T > &other, T margin) const |
|
std::string | toString () const |
|
std::vector< T > | toVector () const |
|
std::array< T, N > | toArray () const |
|
TSpan< T, N > | toSpan () |
|
TSpanView< T, N > | toView () const |
|
TVector2< T > | normalize () const |
| Normalize the vector. Notice that normalizing a integer typed vector will result in 0-vector most of the time.
|
|
TVector2< T > & | normalizeLocal () |
|
| TArithmeticArrayBase (T value) |
|
| TArithmeticArrayBase (Elements values) |
|
auto | pow (const U exponent) const -> TVector2< T > |
|
auto | powLocal (const U exponent) -> TVector2< T > & |
|
auto | exp (const U exponent) const -> TVector2< T > |
|
auto | expLocal (const U exponent) -> TVector2< T > & |
|
auto | lerp (const TVector2< T > &rhs, const U factor) const -> TVector2< T > |
|
|
using | Elements |
|
static constexpr auto | NUM_ELEMENTS |
|
| PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TVectorNBase) |
|
| PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TArithmeticArrayBase) |
|
constexpr std::size_t | size () const noexcept |
| Number of elements of the array.
|
|
TVector2< T > | add (const TVector2< T > &rhs) const |
|
TVector2< T > | add (T rhs) const |
|
TVector2< T > & | addLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | addLocal (T rhs) |
|
TVector2< T > | sub (const TVector2< T > &rhs) const |
|
TVector2< T > | sub (T rhs) const |
|
TVector2< T > & | subLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | subLocal (T rhs) |
|
TVector2< T > | mul (const TVector2< T > &rhs) const |
|
TVector2< T > | mul (T rhs) const |
|
TVector2< T > & | mulLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | mulLocal (T rhs) |
|
TVector2< T > | div (const TVector2< T > &rhs) const |
|
TVector2< T > | div (T rhs) const |
|
TVector2< T > & | divLocal (const TVector2< T > &rhs) |
|
TVector2< T > & | divLocal (T rhs) |
|
TVector2< T > | pow (U exponent) const |
|
TVector2< T > | pow (const TVector2< T > &exponent) const |
|
TVector2< T > & | powLocal (U exponent) |
|
TVector2< T > & | powLocal (const TVector2< T > &exponent) |
|
TVector2< T > | sqrt () const |
|
TVector2< T > & | sqrtLocal () |
|
TVector2< T > | abs () const |
|
TVector2< T > & | absLocal () |
|
TVector2< T > | rcp () const |
|
TVector2< T > & | rcpLocal () |
|
T | sum () const |
|
T | avg () const |
|
T | product () const |
|
T | min () const |
|
TVector2< T > | min (const TVector2< T > &other) const |
|
std::size_t | minIndex () const |
|
T | max () const |
|
TVector2< T > | max (const TVector2< T > &other) const |
|
std::size_t | maxIndex () const |
|
TVector2< T > | ceil () const |
|
TVector2< T > | floor () const |
|
TVector2< T > | lerp (const TVector2< T > &rhs, U factor) const |
|
bool | isZero () const |
|
bool | isNonNegative () const |
|
bool | isFinite () const |
|
TVector2< T > & | set (T value) |
|
TVector2< T > & | set (std::size_t index, T value) |
|
TVector2< T > & | set (const std::array< T, N > &values) |
|
T & | operator[] (std::size_t index) |
|
const T & | operator[] (std::size_t index) const |
|
bool | isEqual (const TVector2< T > &other) const |
|
bool | isNear (const TVector2< T > &other, T margin) const |
|
bool | operator== (const TVector2< T > &other) const |
|
bool | operator!= (const TVector2< T > &other) const |
|
TVector2< T > | operator+ (const TVector2< T > &rhs) const |
|
TVector2< T > | operator+ (T rhs) const |
|
TVector2< T > | operator- (const TVector2< T > &rhs) const |
|
TVector2< T > | operator- (T rhs) const |
|
TVector2< T > | operator- () const |
|
TVector2< T > | operator* (const TVector2< T > &rhs) const |
|
TVector2< T > | operator* (T rhs) const |
|
TVector2< T > | operator/ (const TVector2< T > &rhs) const |
|
TVector2< T > | operator/ (T rhs) const |
|
TVector2< T > & | operator+= (const TVector2< T > &rhs) |
|
TVector2< T > & | operator+= (T rhs) |
|
TVector2< T > & | operator-= (const TVector2< T > &rhs) |
|
TVector2< T > & | operator-= (T rhs) |
|
TVector2< T > & | operator*= (const TVector2< T > &rhs) |
|
TVector2< T > & | operator*= (T rhs) |
|
TVector2< T > & | operator/= (const TVector2< T > &rhs) |
|
TVector2< T > & | operator/= (T rhs) |
|
auto | begin () noexcept -> typename std::array< T, N >::iterator |
|
auto | begin () const noexcept -> typename std::array< T, N >::const_iterator |
|
auto | end () noexcept -> typename std::array< T, N >::iterator |
|
auto | end () const noexcept -> typename std::array< T, N >::const_iterator |
|
std::string | toString () const |
|
std::vector< T > | toVector () const |
|
std::array< T, N > | toArray () const |
|
TSpan< T, N > | toSpan () |
|
TSpanView< T, N > | toView () const |
|
TVector2< T > | exp (U exponent) const |
| Sets the array to \( e^exponent \).
|
|
TVector2< T > & | expLocal (U exponent) |
|
TVector2< T > | exp (const TVector2< T > &exponent) const |
| Sets the array to \( e^{exponent_i} \).
|
|
TVector2< T > & | expLocal (const TVector2< T > &exponent) |
|
TVector2< T > | clamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. None of value , lowerBound and upperBound can be NaN, or the method's behavior is undefined.
|
|
TVector2< T > | clamp (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) const |
|
TVector2< T > & | clampLocal (T lowerBound, T upperBound) |
|
TVector2< T > & | clampLocal (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) |
|
TVector2< T > | safeClamp (T lowerBound, T upperBound) const |
| Clamps current array's elements to specific range. If a floating-point value is non-finite (e.g., being Inf, NaN), its value is clamped to lowerBound . Neither lowerBound nor upperBound can be NaN, or the method's behavior is undefined.
|
|
TVector2< T > | safeClamp (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) const |
|
TVector2< T > & | safeClampLocal (T lowerBound, T upperBound) |
|
TVector2< T > & | safeClampLocal (const TVector2< T > &lowerBound, const TVector2< T > &upperBound) |
|
TVector2< T > | complement () const |
| Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
|
|
TVector2< T > & | complementLocal () |
|
TVector2< T > | negate () const |
| Applies a negative sign to the array's elements. These methods is only defined for signed element types.
|
|
TVector2< T > & | negateLocal () |
|
std::array< T, N > | m |
|
std::array< T, N > | m |
|
static constexpr auto | NUM_ELEMENTS |
|
template<typename T>
class ph::math::TVector2< T >
Represents a 2-D vector.