|
| Vec3 ()=default |
| Constructor.
|
|
| Vec3 (const Vec3 &inRHS)=default |
|
Vec3 & | operator= (const Vec3 &inRHS)=default |
|
JPH_INLINE | Vec3 (Vec4Arg inRHS) |
|
JPH_INLINE | Vec3 (Type inRHS) |
|
JPH_INLINE | Vec3 (const Float3 &inV) |
| Load 3 floats from memory.
|
|
JPH_INLINE | Vec3 (float inX, float inY, float inZ) |
| Create a vector from 3 components.
|
|
JPH_INLINE float | GetX () const |
| Get individual components.
|
|
JPH_INLINE float | GetY () const |
|
JPH_INLINE float | GetZ () const |
|
JPH_INLINE void | SetX (float inX) |
| Set individual components.
|
|
JPH_INLINE void | SetY (float inY) |
|
JPH_INLINE void | SetZ (float inZ) |
|
JPH_INLINE void | Set (float inX, float inY, float inZ) |
| Set all components.
|
|
JPH_INLINE float | operator[] (uint inCoordinate) const |
| Get float component by index.
|
|
JPH_INLINE void | SetComponent (uint inCoordinate, float inValue) |
| Set float component by index.
|
|
JPH_INLINE bool | operator== (Vec3Arg inV2) const |
| Comparison.
|
|
JPH_INLINE bool | operator!= (Vec3Arg inV2) const |
|
JPH_INLINE bool | IsClose (Vec3Arg inV2, float inMaxDistSq=1.0e-12f) const |
| Test if two vectors are close.
|
|
JPH_INLINE bool | IsNearZero (float inMaxDistSq=1.0e-12f) const |
| Test if vector is near zero.
|
|
JPH_INLINE bool | IsNormalized (float inTolerance=1.0e-6f) const |
| Test if vector is normalized.
|
|
JPH_INLINE bool | IsNaN () const |
| Test if vector contains NaN elements.
|
|
JPH_INLINE Vec3 | operator* (Vec3Arg inV2) const |
| Multiply two float vectors (component wise)
|
|
JPH_INLINE Vec3 | operator* (float inV2) const |
| Multiply vector with float.
|
|
JPH_INLINE Vec3 | operator/ (float inV2) const |
| Divide vector by float.
|
|
JPH_INLINE Vec3 & | operator*= (float inV2) |
| Multiply vector with float.
|
|
JPH_INLINE Vec3 & | operator*= (Vec3Arg inV2) |
| Multiply vector with vector.
|
|
JPH_INLINE Vec3 & | operator/= (float inV2) |
| Divide vector by float.
|
|
JPH_INLINE Vec3 | operator+ (Vec3Arg inV2) const |
| Add two float vectors (component wise)
|
|
JPH_INLINE Vec3 & | operator+= (Vec3Arg inV2) |
| Add two float vectors (component wise)
|
|
JPH_INLINE Vec3 | operator- () const |
| Negate.
|
|
JPH_INLINE Vec3 | operator- (Vec3Arg inV2) const |
| Subtract two float vectors (component wise)
|
|
JPH_INLINE Vec3 & | operator-= (Vec3Arg inV2) |
| Subtract two float vectors (component wise)
|
|
JPH_INLINE Vec3 | operator/ (Vec3Arg inV2) const |
| Divide (component wise)
|
|
template<uint32 SwizzleX, uint32 SwizzleY, uint32 SwizzleZ> |
JPH_INLINE Vec3 | Swizzle () const |
| Swizzle the elements in inV.
|
|
JPH_INLINE Vec4 | SplatX () const |
| Replicate the X component to all components.
|
|
JPH_INLINE Vec4 | SplatY () const |
| Replicate the Y component to all components.
|
|
JPH_INLINE Vec4 | SplatZ () const |
| Replicate the Z component to all components.
|
|
JPH_INLINE int | GetLowestComponentIndex () const |
| Get index of component with lowest value.
|
|
JPH_INLINE int | GetHighestComponentIndex () const |
| Get index of component with highest value.
|
|
JPH_INLINE Vec3 | Abs () const |
| Return the absolute value of each of the components.
|
|
JPH_INLINE Vec3 | Reciprocal () const |
| Reciprocal vector (1 / value) for each of the components.
|
|
JPH_INLINE Vec3 | Cross (Vec3Arg inV2) const |
| Cross product.
|
|
JPH_INLINE Vec3 | DotV (Vec3Arg inV2) const |
| Dot product, returns the dot product in X, Y and Z components.
|
|
JPH_INLINE Vec4 | DotV4 (Vec3Arg inV2) const |
| Dot product, returns the dot product in X, Y, Z and W components.
|
|
JPH_INLINE float | Dot (Vec3Arg inV2) const |
| Dot product.
|
|
JPH_INLINE float | LengthSq () const |
| Squared length of vector.
|
|
JPH_INLINE float | Length () const |
| Length of vector.
|
|
JPH_INLINE Vec3 | Normalized () const |
| Normalize vector.
|
|
JPH_INLINE Vec3 | NormalizedOr (Vec3Arg inZeroValue) const |
| Normalize vector or return inZeroValue if the length of the vector is zero.
|
|
JPH_INLINE void | StoreFloat3 (Float3 *outV) const |
| Store 3 floats to memory.
|
|
JPH_INLINE UVec4 | ToInt () const |
| Convert each component from a float to an int.
|
|
JPH_INLINE UVec4 | ReinterpretAsInt () const |
| Reinterpret Vec3 as a UVec4 (doesn't change the bits)
|
|
JPH_INLINE float | ReduceMin () const |
| Get the minimum of X, Y and Z.
|
|
JPH_INLINE float | ReduceMax () const |
| Get the maximum of X, Y and Z.
|
|
JPH_INLINE Vec3 | Sqrt () const |
| Component wise square root.
|
|
JPH_INLINE Vec3 | GetNormalizedPerpendicular () const |
| Get normalized vector that is perpendicular to this vector.
|
|
JPH_INLINE Vec3 | GetSign () const |
| Get vector that contains the sign of each element (returns 1.0f if positive, -1.0f if negative)
|
|
JPH_INLINE void | CheckW () const |
| Internal helper function that checks that W is equal to Z, so e.g. dividing by it should not generate div by 0.
|
|
template<uint32 SwizzleX, uint32 SwizzleY, uint32 SwizzleZ> |
Vec3 | Swizzle () const |
|
|
static JPH_INLINE Vec3 | sZero () |
| Vector with all zeros.
|
|
static JPH_INLINE Vec3 | sNaN () |
| Vector with all NaN's.
|
|
static JPH_INLINE Vec3 | sAxisX () |
| Vectors with the principal axis.
|
|
static JPH_INLINE Vec3 | sAxisY () |
|
static JPH_INLINE Vec3 | sAxisZ () |
|
static JPH_INLINE Vec3 | sReplicate (float inV) |
| Replicate inV across all components.
|
|
static JPH_INLINE Vec3 | sLoadFloat3Unsafe (const Float3 &inV) |
| Load 3 floats from memory (reads 32 bits extra which it doesn't use)
|
|
static JPH_INLINE Vec3 | sMin (Vec3Arg inV1, Vec3Arg inV2) |
| Return the minimum value of each of the components.
|
|
static JPH_INLINE Vec3 | sMax (Vec3Arg inV1, Vec3Arg inV2) |
| Return the maximum of each of the components.
|
|
static JPH_INLINE Vec3 | sClamp (Vec3Arg inV, Vec3Arg inMin, Vec3Arg inMax) |
| Clamp a vector between min and max (component wise)
|
|
static JPH_INLINE UVec4 | sEquals (Vec3Arg inV1, Vec3Arg inV2) |
| Equals (component wise)
|
|
static JPH_INLINE UVec4 | sLess (Vec3Arg inV1, Vec3Arg inV2) |
| Less than (component wise)
|
|
static JPH_INLINE UVec4 | sLessOrEqual (Vec3Arg inV1, Vec3Arg inV2) |
| Less than or equal (component wise)
|
|
static JPH_INLINE UVec4 | sGreater (Vec3Arg inV1, Vec3Arg inV2) |
| Greater than (component wise)
|
|
static JPH_INLINE UVec4 | sGreaterOrEqual (Vec3Arg inV1, Vec3Arg inV2) |
| Greater than or equal (component wise)
|
|
static JPH_INLINE Vec3 | sFusedMultiplyAdd (Vec3Arg inMul1, Vec3Arg inMul2, Vec3Arg inAdd) |
| Calculates inMul1 * inMul2 + inAdd.
|
|
static JPH_INLINE Vec3 | sSelect (Vec3Arg inNotSet, Vec3Arg inSet, UVec4Arg inControl) |
| Component wise select, returns inNotSet when highest bit of inControl = 0 and inSet when highest bit of inControl = 1.
|
|
static JPH_INLINE Vec3 | sOr (Vec3Arg inV1, Vec3Arg inV2) |
| Logical or (component wise)
|
|
static JPH_INLINE Vec3 | sXor (Vec3Arg inV1, Vec3Arg inV2) |
| Logical xor (component wise)
|
|
static JPH_INLINE Vec3 | sAnd (Vec3Arg inV1, Vec3Arg inV2) |
| Logical and (component wise)
|
|
static JPH_INLINE Vec3 | sUnitSpherical (float inTheta, float inPhi) |
|
template<class Random > |
static Vec3 | sRandom (Random &inRandom) |
| Get random unit vector.
|
|
static JPH_INLINE Type | sFixW (Type inValue) |
| Internal helper function that ensures that the Z component is replicated to the W component to prevent divisions by zero.
|
|
3 component vector (stored as 4 vectors). Note that we keep the 4th component the same as the 3rd component to avoid divisions by zero when JPH_FLOATING_POINT_EXCEPTIONS_ENABLED defined