|
|
| Vec4 ()=default |
| | Default constructor leaves garbage in contents.
|
| |
|
template<typename S > |
| | Vec4 (const Vec4< S > &b) |
| | Copy constructor supports type conversion.
|
| |
|
template<typename S > |
| | Vec4 (S a) |
| | Constructor that sets all components to a single value.
|
| |
|
| Vec4 (T a, T b) |
| | Constructors that set separate components with defaults z=0 and w=1.
|
| |
|
| Vec4 (T a, T b, T c) |
| |
|
| Vec4 (T a, T b, T c, T d) |
| |
|
template<typename S > |
| | Vec4 (S *v) |
| | Constructor from an array of 4 numbers.
|
| |
|
template<typename S > |
| | Vec4 (const S *v) |
| |
|
template<typename S > |
| | Vec4 (const Vec2< S > &v) |
| |
|
template<typename S > |
| | Vec4 (const Vec2< S > &v, T vz, T vw=static_cast< T >(1)) |
| |
|
template<typename S > |
| | Vec4 (const Vec3< S > &v) |
| |
|
template<typename S > |
| | Vec4 (const Vec3< S > &v, T vw) |
| |
|
| operator Vec4< fdk::half > () const |
| | Returns value as a specific type:
|
| |
|
| operator Vec4< float > () const |
| |
|
| operator Vec4< double > () const |
| |
|
| operator Vec4< int > () const |
| |
|
Vec4< fdk::half > | asVec4h () const |
| |
|
Vec4< float > | asVec4f () const |
| |
|
Vec4< double > | asVec4d () const |
| |
|
Vec4< int > | asVec4i () const |
| |
|
T & | operator[] (int n) |
| |
|
const T & | operator[] (int n) const |
| |
|
T * | array () |
| | Returns a pointer to the first element.
|
| |
|
const T * | array () const |
| |
|
Vec2< T > | xy () const |
| |
|
Vec3< T > | xyz () const |
| |
|
void | set (T d) |
| | Set xyz to a single value and w to 1.
|
| |
|
void | set (T a, T b, T c, T d=static_cast< T >(1)) |
| | Set all components, w defaults to 1.
|
| |
|
void | set (const Vec3< T > &v, T vw=static_cast< T >(1)) |
| | Set xyz and w separately.
|
| |
|
void | setToZero () |
| | Set components to 0.
|
| |
|
void | setToOne () |
| | Set components to 1.
|
| |
|
void | clear () |
| | Type-specific clear. Set xyz to 0 and w to 1.
|
| |
|
void | append (fdk::Hash &hash) const |
| | Add this to a fdk::Hash object.
|
| |
|
template<typename S > |
| Vec4 | operator* (const Mat4< S > &m) const |
| |
|
template<typename S > |
| Vec4 & | operator*= (const Mat4< S > &m) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 | operator* (S d) const |
| |
|
Vec4 | operator* (const Vec4 &v) const |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 & | operator*= (S d) |
| |
|
Vec4 & | operator*= (const Vec4 &v) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 | operator/ (S d) const |
| |
|
Vec4 | operator/ (const Vec4 &v) const |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 & | operator/= (S d) |
| |
|
Vec4 & | operator/= (const Vec4 &v) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 | operator+ (S d) const |
| |
|
Vec4 | operator+ (const Vec4 &v) const |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 & | operator+= (S d) |
| |
|
Vec4 & | operator+= (const Vec4 &v) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 | operator- (S d) const |
| |
|
Vec4 | operator- (const Vec4 &v) const |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > = true> |
| Vec4 & | operator-= (S d) |
| |
|
Vec4 & | operator-= (const Vec4 &v) |
| |
|
Vec4 | operator- () const |
| |
|
void | negate () |
| |
|
bool | operator== (const Vec4 &v) const |
| |
|
bool | operator!= (const Vec4 &v) const |
| |
|
bool | operator== (T d) const |
| |
|
bool | operator!= (T d) const |
| |
|
bool | operator< (const Vec4 &v) const |
| | Fairly arbitrary operator so you can store these in ordered arrays.
|
| |
|
Vec4 & | wNormalize () |
| | Divide x, y, and z by w. If w is zero, the behaviour is undefined.
|
| |
|
Vec3< T > | wNormalized () const |
| |
|
Vec3< T > | wTruncate () const |
| | Trims off w, same as xyz() method.
|
| |
|
T | minimumComponent () const |
| | Returns the minimum XYZ element - w is ignored.
|
| |
|
Vec4 | minimum (const Vec4 &v) const |
| |
|
T | maximumComponent () const |
| | Returns the maximum XYZ element - w is ignored.
|
| |
|
Vec4 | maximum (const Vec4 &v) const |
| |
|
T | largestAxis () const |
| | Returns the absolute value of the largest XYZ element - w is ignored.
|
| |
|
template<typename S > |
| Vec4< T > | interpolateTo (const Vec4< T > &b, S t) const |
| | Linear-interpolate between this Vec4 and another at t, where t=0..1.
|
| |
|
template<typename S > |
| Vec4< T > | lerpTo (const Vec4< T > &b, S t) const |
| |
|
template<typename S > |
| Vec4< T > | operator* (const Mat4< S > &m) const |
| |
|
template<typename S > |
| Vec4< T > & | operator*= (const Mat4< S > &m) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > > |
| Vec4< T > & | operator*= (S d) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > > |
| Vec4< T > & | operator/= (S d) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > > |
| Vec4< T > & | operator+= (S d) |
| |
|
template<typename S , std::enable_if_t< fdk::is_arithmetic< S >, bool > > |
| Vec4< T > & | operator-= (S d) |
| |
template<typename T>
class fdk::Vec4< T >
4-component vector