|
| | PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TVector4) |
| |
| | TVector4 (T vx, T vy, T vz, T vw) |
| |
| template<typename U > |
| | TVector4 (const TVector4< U > &other) |
| |
| T & | x () |
| |
| T & | y () |
| |
| T & | z () |
| |
| T & | w () |
| |
| const T & | x () const |
| |
| const T & | y () const |
| |
| const T & | z () const |
| |
| const T & | w () const |
| |
| T & | r () |
| |
| T & | g () |
| |
| T & | b () |
| |
| T & | a () |
| |
| const T & | r () const |
| |
| const T & | g () const |
| |
| const T & | b () const |
| |
| const T & | a () const |
| |
| T | dot (const TVector4< T > &rhs) const |
| |
| T | dot (T rhs) const |
| |
| T | absDot (const TVector4< T > &rhs) const |
| |
| T | absDot (T rhs) const |
| |
| T | length () const |
| |
| T | lengthSquared () const |
| |
| TVector4< T > | safeNormalize (const TVector4< T > &fallback=TVector4< 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.
|
| |
| TVector4< T > | add (const TVector4< T > &rhs) const |
| |
| TVector4< T > | add (T rhs) const |
| |
| TVector4< T > & | addLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | addLocal (T rhs) |
| |
| TVector4< T > | sub (const TVector4< T > &rhs) const |
| |
| TVector4< T > | sub (T rhs) const |
| |
| TVector4< T > & | subLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | subLocal (T rhs) |
| |
| TVector4< T > | mul (const TVector4< T > &rhs) const |
| |
| TVector4< T > | mul (T rhs) const |
| |
| TVector4< T > & | mulLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | mulLocal (T rhs) |
| |
| TVector4< T > | div (const TVector4< T > &rhs) const |
| |
| TVector4< T > | div (T rhs) const |
| |
| TVector4< T > & | divLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | divLocal (T rhs) |
| |
| TVector4< T > | pow (U exponent) const |
| |
| TVector4< T > | pow (const TVector4< T > &exponent) const |
| |
| TVector4< T > & | powLocal (U exponent) |
| |
| TVector4< T > & | powLocal (const TVector4< T > &exponent) |
| |
| TVector4< T > | exp (U exponent) const |
| | Sets the array to \( e^exponent \).
|
| |
| TVector4< T > | exp (const TVector4< T > &exponent) const |
| | Sets the array to \( e^{exponent_i} \).
|
| |
| TVector4< T > & | expLocal (U exponent) |
| |
| TVector4< T > & | expLocal (const TVector4< T > &exponent) |
| |
| TVector4< T > | sqrt () const |
| |
| TVector4< T > & | sqrtLocal () |
| |
| TVector4< 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.
|
| |
| TVector4< T > | clamp (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) const |
| |
| TVector4< T > & | clampLocal (T lowerBound, T upperBound) |
| |
| TVector4< T > & | clampLocal (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) |
| |
| TVector4< 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.
|
| |
| TVector4< T > | safeClamp (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) const |
| |
| TVector4< T > & | safeClampLocal (T lowerBound, T upperBound) |
| |
| TVector4< T > & | safeClampLocal (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) |
| |
| TVector4< T > | abs () const |
| |
| TVector4< T > & | absLocal () |
| |
| TVector4< T > | rcp () const |
| |
| TVector4< T > & | rcpLocal () |
| |
| TVector4< T > | complement () const |
| | Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
|
| |
| TVector4< T > & | complementLocal () |
| |
| TVector4< T > | negate () const |
| | Applies a negative sign to the array's elements. These methods is only defined for signed element types.
|
| |
| TVector4< T > & | negateLocal () |
| |
| T | sum () const |
| |
| T | avg () const |
| |
| T | product () const |
| |
| T | min () const |
| |
| TVector4< T > | min (const TVector4< T > &other) const |
| |
| std::size_t | minIndex () const |
| |
| T | max () const |
| |
| TVector4< T > | max (const TVector4< T > &other) const |
| |
| std::size_t | maxIndex () const |
| |
| TVector4< T > | ceil () const |
| |
| TVector4< T > | floor () const |
| |
| TVector4< T > | lerp (const TVector4< T > &rhs, U factor) const |
| |
| bool | isZero () const |
| |
| bool | isNonNegative () const |
| |
| bool | isFinite () const |
| |
| TVector4< T > & | set (T value) |
| |
| TVector4< T > & | set (std::size_t index, T value) |
| |
| TVector4< 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 TVector4< T > &other) const |
| |
| bool | isNear (const TVector4< 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 |
| |
| TVector4< T > | normalize () const |
| | Normalize the vector. Notice that normalizing a integer typed vector will result in 0-vector most of the time.
|
| |
| TVector4< T > & | normalizeLocal () |
| |
| | TArithmeticArrayBase (T value) |
| |
| | TArithmeticArrayBase (Elements values) |
| |
| auto | pow (const U exponent) const -> TVector4< T > |
| |
| auto | powLocal (const U exponent) -> TVector4< T > & |
| |
| auto | exp (const U exponent) const -> TVector4< T > |
| |
| auto | expLocal (const U exponent) -> TVector4< T > & |
| |
| auto | lerp (const TVector4< T > &rhs, const U factor) const -> TVector4< 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.
|
| |
| TVector4< T > | add (const TVector4< T > &rhs) const |
| |
| TVector4< T > | add (T rhs) const |
| |
| TVector4< T > & | addLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | addLocal (T rhs) |
| |
| TVector4< T > | sub (const TVector4< T > &rhs) const |
| |
| TVector4< T > | sub (T rhs) const |
| |
| TVector4< T > & | subLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | subLocal (T rhs) |
| |
| TVector4< T > | mul (const TVector4< T > &rhs) const |
| |
| TVector4< T > | mul (T rhs) const |
| |
| TVector4< T > & | mulLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | mulLocal (T rhs) |
| |
| TVector4< T > | div (const TVector4< T > &rhs) const |
| |
| TVector4< T > | div (T rhs) const |
| |
| TVector4< T > & | divLocal (const TVector4< T > &rhs) |
| |
| TVector4< T > & | divLocal (T rhs) |
| |
| TVector4< T > | pow (U exponent) const |
| |
| TVector4< T > | pow (const TVector4< T > &exponent) const |
| |
| TVector4< T > & | powLocal (U exponent) |
| |
| TVector4< T > & | powLocal (const TVector4< T > &exponent) |
| |
| TVector4< T > | sqrt () const |
| |
| TVector4< T > & | sqrtLocal () |
| |
| TVector4< T > | abs () const |
| |
| TVector4< T > & | absLocal () |
| |
| TVector4< T > | rcp () const |
| |
| TVector4< T > & | rcpLocal () |
| |
| T | sum () const |
| |
| T | avg () const |
| |
| T | product () const |
| |
| T | min () const |
| |
| TVector4< T > | min (const TVector4< T > &other) const |
| |
| std::size_t | minIndex () const |
| |
| T | max () const |
| |
| TVector4< T > | max (const TVector4< T > &other) const |
| |
| std::size_t | maxIndex () const |
| |
| TVector4< T > | ceil () const |
| |
| TVector4< T > | floor () const |
| |
| TVector4< T > | lerp (const TVector4< T > &rhs, U factor) const |
| |
| bool | isZero () const |
| |
| bool | isNonNegative () const |
| |
| bool | isFinite () const |
| |
| TVector4< T > & | set (T value) |
| |
| TVector4< T > & | set (std::size_t index, T value) |
| |
| TVector4< 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 TVector4< T > &other) const |
| |
| bool | isNear (const TVector4< T > &other, T margin) const |
| |
| bool | operator== (const TVector4< T > &other) const |
| |
| bool | operator!= (const TVector4< T > &other) const |
| |
| TVector4< T > | operator+ (const TVector4< T > &rhs) const |
| |
| TVector4< T > | operator+ (T rhs) const |
| |
| TVector4< T > | operator- (const TVector4< T > &rhs) const |
| |
| TVector4< T > | operator- (T rhs) const |
| |
| TVector4< T > | operator- () const |
| |
| TVector4< T > | operator* (const TVector4< T > &rhs) const |
| |
| TVector4< T > | operator* (T rhs) const |
| |
| TVector4< T > | operator/ (const TVector4< T > &rhs) const |
| |
| TVector4< T > | operator/ (T rhs) const |
| |
| TVector4< T > & | operator+= (const TVector4< T > &rhs) |
| |
| TVector4< T > & | operator+= (T rhs) |
| |
| TVector4< T > & | operator-= (const TVector4< T > &rhs) |
| |
| TVector4< T > & | operator-= (T rhs) |
| |
| TVector4< T > & | operator*= (const TVector4< T > &rhs) |
| |
| TVector4< T > & | operator*= (T rhs) |
| |
| TVector4< T > & | operator/= (const TVector4< T > &rhs) |
| |
| TVector4< 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 |
| |
| TVector4< T > | exp (U exponent) const |
| | Sets the array to \( e^exponent \).
|
| |
| TVector4< T > & | expLocal (U exponent) |
| |
| TVector4< T > | exp (const TVector4< T > &exponent) const |
| | Sets the array to \( e^{exponent_i} \).
|
| |
| TVector4< T > & | expLocal (const TVector4< T > &exponent) |
| |
| TVector4< 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.
|
| |
| TVector4< T > | clamp (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) const |
| |
| TVector4< T > & | clampLocal (T lowerBound, T upperBound) |
| |
| TVector4< T > & | clampLocal (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) |
| |
| TVector4< 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.
|
| |
| TVector4< T > | safeClamp (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) const |
| |
| TVector4< T > & | safeClampLocal (T lowerBound, T upperBound) |
| |
| TVector4< T > & | safeClampLocal (const TVector4< T > &lowerBound, const TVector4< T > &upperBound) |
| |
| TVector4< T > | complement () const |
| | Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
|
| |
| TVector4< T > & | complementLocal () |
| |
| TVector4< T > | negate () const |
| | Applies a negative sign to the array's elements. These methods is only defined for signed element types.
|
| |
| TVector4< T > & | negateLocal () |
| |
| std::array< T, N > | m |
| |
| std::array< T, N > | m |
| |
| static constexpr auto | NUM_ELEMENTS |
| |
template<typename T>
class ph::math::TVector4< T >
Represents a 4-D vector.