|
|
| XII_DECLARE_POD_TYPE () |
| | xiiVec3Template () |
| | default-constructed vector is uninitialized (for speed)
|
|
| xiiVec3Template (Type x, Type y, Type z) |
| | Initializes the vector with x,y,z.
|
|
| xiiVec3Template (Type v) |
| | Initializes all 3 components with xyz.
|
|
const xiiVec2Template< Type > | GetAsVec2 () const |
| | Returns a xiiVec2Template with x and y from this vector.
|
|
const xiiVec4Template< Type > | GetAsVec4 (Type w) const |
| | Returns a xiiVec4Template with x,y,z from this vector and w set to the parameter.
|
|
const xiiVec4Template< Type > | GetAsPositionVec4 () const |
| | Returns a xiiVec4Template with x,y,z from this vector and w set 1.
|
|
const xiiVec4Template< Type > | GetAsDirectionVec4 () const |
| | Returns a xiiVec4Template with x,y,z from this vector and w set 0.
|
|
const Type * | GetData () const |
| | Returns the data as an array.
|
|
Type * | GetData () |
| | Returns the data as an array.
|
|
void | Set (Type xyz) |
| | Sets all 3 components to this value.
|
|
void | Set (Type x, Type y, Type z) |
| | Sets the vector to these values.
|
|
void | SetZero () |
| | Sets the vector to all zero.
|
|
XII_DECLARE_IF_FLOAT_TYPE Type | GetLength () const |
| | Returns the length of the vector.
|
| XII_DECLARE_IF_FLOAT_TYPE xiiResult | SetLength (Type fNewLength, Type fEpsilon=xiiMath::DefaultEpsilon< Type >()) |
| Type | GetLengthSquared () const |
| XII_DECLARE_IF_FLOAT_TYPE Type | GetLengthAndNormalize () |
|
XII_DECLARE_IF_FLOAT_TYPE const xiiVec3Template< Type > | GetNormalized () const |
| | Returns a normalized version of this vector, leaves the vector itself unchanged.
|
|
XII_DECLARE_IF_FLOAT_TYPE void | Normalize () |
| | Normalizes this vector.
|
|
XII_DECLARE_IF_FLOAT_TYPE xiiResult | NormalizeIfNotZero (const xiiVec3Template< Type > &vFallback=xiiVec3Template< Type >(1, 0, 0), Type fEpsilon=xiiMath::SmallEpsilon< Type >()) |
| | Tries to normalize this vector. If the vector is too close to zero, XII_FAILURE is returned and the vector is set to the given fallback value.
|
|
bool | IsZero () const |
| | Returns, whether this vector is (0, 0, 0).
|
|
bool | IsZero (Type fEpsilon) const |
| | Returns, whether this vector is (0, 0, 0) within a given epsilon.
|
| XII_DECLARE_IF_FLOAT_TYPE bool | IsNormalized (Type fEpsilon=xiiMath::HugeEpsilon< Type >()) const |
| | Returns, whether the squared length of this vector is between 0.999f and 1.001f.
|
|
bool | IsNaN () const |
| | Returns true, if any of x, y or z is NaN.
|
|
bool | IsValid () const |
| | Checks that all components are finite numbers.
|
|
XII_DECLARE_IF_FLOAT_TYPE Type | GetDistanceTo (const xiiVec3Template< Type > &rhs) const |
| | Returns the distance between two this position and rhs.
|
|
XII_DECLARE_IF_FLOAT_TYPE Type | GetSquaredDistanceTo (const xiiVec3Template< Type > &rhs) const |
| | Returns the squared distance between this position and rhs.
|
|
const xiiVec3Template< Type > | operator- () const |
| | Returns the negation of this vector.
|
|
void | operator+= (const xiiVec3Template< Type > &rhs) |
| | Adds rhs component-wise to this vector.
|
|
void | operator-= (const xiiVec3Template< Type > &rhs) |
| | Subtracts rhs component-wise from this vector.
|
| void | operator*= (const xiiVec3Template< Type > &rhs) |
| | Multiplies rhs component-wise to this vector.
|
| void | operator/= (const xiiVec3Template< Type > &rhs) |
| | Divides this vector component-wise by rhs.
|
|
void | operator*= (Type f) |
| | Multiplies all components of this vector with f.
|
|
void | operator/= (Type f) |
| | Divides all components of this vector by f.
|
|
bool | IsIdentical (const xiiVec3Template< Type > &rhs) const |
| | Equality Check (bitwise).
|
|
bool | IsEqual (const xiiVec3Template< Type > &rhs, Type fEpsilon) const |
| | Equality Check with epsilon.
|
| xiiAngle | GetAngleBetween (const xiiVec3Template< Type > &rhs) const |
|
Type | Dot (const xiiVec3Template< Type > &rhs) const |
| | Returns the Dot-product of the two vectors (commutative, order does not matter).
|
|
const xiiVec3Template< Type > | CrossRH (const xiiVec3Template< Type > &rhs) const |
| | Returns the Cross-product of the two vectors (NOT commutative, order DOES matter).
|
|
const xiiVec3Template< Type > | CompMin (const xiiVec3Template< Type > &rhs) const |
| | Returns the component-wise minimum of *this and rhs.
|
|
const xiiVec3Template< Type > | CompMax (const xiiVec3Template< Type > &rhs) const |
| | Returns the component-wise maximum of *this and rhs.
|
|
const xiiVec3Template< Type > | CompClamp (const xiiVec3Template< Type > &vLow, const xiiVec3Template< Type > &vHigh) const |
| | Returns the component-wise clamped value of *this between low and high.
|
|
const xiiVec3Template< Type > | CompMul (const xiiVec3Template< Type > &rhs) const |
| | Returns the component-wise multiplication of *this and rhs.
|
|
const xiiVec3Template< Type > | CompDiv (const xiiVec3Template< Type > &rhs) const |
| | Returns the component-wise division of *this and rhs.
|
|
const xiiVec3Template< Type > | Abs () const |
| | brief Returns the component-wise absolute of *this.
|
|
XII_DECLARE_IF_FLOAT_TYPE xiiResult | CalculateNormal (const xiiVec3Template< Type > &v1, const xiiVec3Template< Type > &v2, const xiiVec3Template< Type > &v3) |
| | Calculates the normal of the triangle defined by the three vertices. Vertices are assumed to be ordered counter-clockwise.
|
| XII_DECLARE_IF_FLOAT_TYPE void | MakeOrthogonalTo (const xiiVec3Template< Type > &vNormal) |
|
XII_DECLARE_IF_FLOAT_TYPE const xiiVec3Template< Type > | GetOrthogonalVector () const |
| | Returns some arbitrary vector orthogonal to this one. The vector is NOT normalized.
|
|
XII_DECLARE_IF_FLOAT_TYPE const xiiVec3Template< Type > | GetReflectedVector (const xiiVec3Template< Type > &vNormal) const |
| | Returns this vector reflected at vNormal.
|
|
XII_DECLARE_IF_FLOAT_TYPE const xiiVec3Template< Type > | GetRefractedVector (const xiiVec3Template< Type > &vNormal, Type fRefIndex1, Type fRefIndex2) const |
| | Returns this vector, refracted at vNormal, using the refraction index of the current medium and the medium it enters.
|
|
|
static XII_DECLARE_IF_FLOAT_TYPE constexpr xiiVec3Template< Type > | MakeNaN () |
| | Returns a vector with all components set to Not-a-Number (NaN).
|
|
static constexpr xiiVec3Template< Type > | MakeZero () |
| | Returns a vector with all components set to zero.
|
|
static constexpr xiiVec3Template< Type > | MakeAxisX () |
| | Returns a vector initialized to the X unit vector (1, 0, 0).
|
|
static constexpr xiiVec3Template< Type > | MakeAxisY () |
| | Returns a vector initialized to the Y unit vector (0, 1, 0).
|
|
static constexpr xiiVec3Template< Type > | MakeAxisZ () |
| | Returns a vector initialized to the Z unit vector (0, 0, 1).
|
|
static constexpr xiiVec3Template< Type > | Make (Type x, Type y, Type z) |
| | Returns a vector initialized to x,y,z.
|
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomPointInSphere (xiiRandom &inout_rng) |
| | Returns a random point inside a unit sphere (radius 1).
|
|
static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDirection (xiiRandom &inout_rng) |
| | Creates a random direction vector. The vector is normalized.
|
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviationX (xiiRandom &inout_rng, const xiiAngle &maxDeviation) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviationX (xiiRandom &inout_rng, const xiiAngled &maxDeviation) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviationY (xiiRandom &inout_rng, const xiiAngle &maxDeviation) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviationY (xiiRandom &inout_rng, const xiiAngled &maxDeviation) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviationZ (xiiRandom &inout_rng, const xiiAngle &maxDeviation) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviationZ (xiiRandom &inout_rng, const xiiAngled &maxDeviation) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviation (xiiRandom &inout_rng, const xiiAngle &maxDeviation, const xiiVec3Template< Type > &vNormal) |
| static XII_DECLARE_IF_FLOAT_TYPE xiiVec3Template< Type > | MakeRandomDeviation (xiiRandom &inout_rng, const xiiAngled &maxDeviation, const xiiVec3Template< Type > &vNormal) |
template<typename Type>
class xiiVec3Template< Type >
Copyright (c) Theophilus Eriata. All Rights Reserved.
A 3-component vector class.