This is the documentation for Enlighten.
module Vectors
Functions
Name | Description |
|---|---|
Returns a vector with the Abs function applied to all 4 elements. | |
Returns true if all elements of a and b are within g_VecEpsilon of each other. | |
Parses a v128 from the given string. | |
Parses a v128 from the given string, ignoring the W-component and instead setting it to the given value. | |
Returns true if all of the 4 elements of v are finite. | |
Returns true if any of the 4 elements of v are NANs. | |
Linearly interpolated between the corresponding components of a and b. | |
Returns a vector where each element has the maximum value of the corresponding values in a and b NOTE - the Min3 template function will work with the v128 type as well. | |
Returns a vector where each element has the minimum value of the corresponding values in a and b NOTE - the Min3 template function will work with the v128 type as well. | |
Operator - (component-wise subtraction) | |
The unary - operator. Equivalent to (VZero() - v);. | |
Operator * (component-wise multiplication) | |
Inplace *. | |
Operator / (component-wise division) | |
Inplace /. | |
Operator + (component-wise addition) | |
The unary + operator (effectively a no-op) | |
Inplace +. | |
Inplace -. | |
Creates a GeoString representation of the vector (space-separated). | |
Creates a GeoString representation of the vector (space-separated). | |
Construct a v128 by broadcasting a float into all elements. | |
Construct a v128 by converting an integer to a float and broadcasting it into all elements. | |
Return ceil(v). | |
Compares all corresponding elements to see if a == b (exact equals). | |
Compares all corresponding elements to see if a >= b. | |
Compares all corresponding elements to see if a > b. | |
Tests all elements of v to see if they are finite or not. | |
Tests all elements of v to see if any of them are NANs. | |
Compares all corresponding elements to see if a <= b. | |
Compares all corresponding elements to see if a < b. | |
Compares all corresponding elements to see if a == b (exact equals). | |
Compares all corresponding elements to see if a >= b. | |
Compares all corresponding elements to see if a > b. | |
Compares all corresponding elements to see if a <= b. | |
Compares all corresponding elements to see if a < b. | |
Construct a v128 from 4 floats. Fairly slow. | |
Re-intreprets 4 ints as floats and construct a vector from them. | |
Cross the first 3 elements of each. | |
Cross the first 3 elements of each. | |
Returns the fractional part of each element of v. | |
Returns a mask with everything but the 4 sign bits set. | |
Returns a mask with just the 4 sign bits set. | |
Load a 4-float array from 16-byte aligned memory. | |
Load a 4-float array from arbitrarily aligned memory. Cannot be null. | |
This is a vector multiply accumulate operation returning (a * b) + c. | |
Return -v. You can use the operator overload instead if you prefer. | |
This is a bitwise & operation. | |
This is a bitwise ~ operation. | |
This is a bitwise | operation. | |
This is a bitwise ^ operation. | |
VPackX4(const Geo::v128 &, const Geo::v128 &, const Geo::v128 &, const Geo::v128 &) | Packs the X component from each of the four vectors into a single vector. |
Returns a vector perpendicular to v (with one of its components being zero). | |
Return 1.f / v. (inaccurate) | |
Return 1.f / v. (fast approximate where available. If not, implemented as VRecip) | |
Return 1.f / sqrt(v). (inaccurate) | |
Return 1.f / sqrt(v). (inaccurate) | |
Reverses the order of the components from xyzw to wzyx. | |
Returns the specified permutation of the parameter vector. Any permutation is valid. | |
Return sqrt(v). (more inaccurate than the reciprocal version on non-sse hardware) | |
Tests the flags produced by the VCompareWithFlags* operations. | |
Tests the flags produced by the VCompareWithFlags* operations. | |
Tests the flags produced by the VCompareWithFlags* operations. | |
Tests the flags produced by the VCompareWithFlags* operations. | |
A fully-zeroed out vector. |
Variables
Name | Description |
|---|---|
const v128 g_VecEpsilon = VBroadcast(0.001f) | This has the value of g_VecEpsilonF broadcast into all elements. |
const float g_VecEpsilonF = 0.001f | A general epsilon for use with the IsUnitLength function. |
const u32 g_VecMaskFalse = 0x00000000 | A mask value of 'false' = 0x00000000. |
const u32 g_VecMaskTrue = 0xffffffff | A mask value of 'true' = 0xffffffff. |
const v128 g_VecNormaliseEpsilon = VBroadcast(1e-35f) | An internal epsilon used inside the vector normalisation functions. |
const Geo::v128 g_VFours | Some common useful constants. |
const Geo::v128 g_VHalves | Some common useful constants. |
const Geo::v128 g_VMinusOnes | Some common useful constants. |
const Geo::v128 g_VMinusOneTwoEights | Some common useful constants. |
const Geo::v128 g_VOneOverOneTwoSevens | Some common useful constants. |
const Geo::v128 g_VOneOverPi | Some common useful constants. |
const Geo::v128 g_VOneOverTwoFives | Some common useful constants. |
const Geo::v128 g_VOneOverTwoPi | Some common useful constants. |
const Geo::v128 g_VOnes | Some common useful constants. |
const Geo::v128 g_VOneTwoSevens | Some common useful constants. |
const Geo::v128 g_VPi | Some common useful constants. |
const Geo::v128 g_VQuarters | Some common useful constants. |
const Geo::v128 g_VThirds | Some common useful constants. |
const Geo::v128 g_VThrees | Some common useful constants. |
const Geo::v128 g_VTwoFiveFives | Some common useful constants. |
const Geo::v128 g_VTwos | Some common useful constants. |
const Geo::v128 g_VZero | Some common useful constants. |
Enums
Name | Description |
|---|---|
Shuffle constants for the GEO_VSHUFFLE macro. |
Defines
Name | Description |
|---|---|
GEO_VSHUFFLE VShuffle(v, x, y, z, w) | Returns the specified permutation of the parameter vector. |
GEO_FORCE_INLINE v128 Geo::Abs
public: v128 Abs
(
v128Param a
)
Returns a vector with the Abs function applied to all 4 elements.
bool Geo::EqualWithinEpsilon
public: bool EqualWithinEpsilon
(
v128Param a,
v128Param b,
v128Param epsilon
)
Returns true if all elements of a and b are within g_VecEpsilon of each other.
You may specify an epsilon vector that contains different epsilon values in each element if you wish.
Geo::v128 GEO_CALL Geo::GetV128FromString
public: Geo::v128GEO_CALL GetV128FromString
(
const C * str
)
Parses a v128 from the given string.
Geo::v128 GEO_CALL Geo::GetV128FromStringXYZ
public: Geo::v128GEO_CALL GetV128FromStringXYZ
(
const C * str,
float w
)
Parses a v128 from the given string, ignoring the W-component and instead setting it to the given value.
bool Geo::IsFinite
public: bool IsFinite
(
v128Param v
)
Returns true if all of the 4 elements of v are finite.
TODO - this function doesn't detect INFs yet!
bool Geo::IsNan
public: bool IsNan
(
v128Param v
)
Returns true if any of the 4 elements of v are NANs.
v128 Geo::Lerp
public: v128 Lerp
(
v128Param a,
v128Param b,
v128Param s
)
Linearly interpolated between the corresponding components of a and b.
s is the interpolation factor, typically having values between 0 -> 1.
GEO_FORCE_INLINE v128 Geo::Max
public: v128 Max
(
const v128 & a,
const v128 & b
)
Returns a vector where each element has the maximum value of the corresponding values in a and b NOTE - the Min3 template function will work with the v128 type as well.
GEO_FORCE_INLINE v128 Geo::Min
public: v128 Min
(
const v128 & a,
const v128 & b
)
Returns a vector where each element has the minimum value of the corresponding values in a and b NOTE - the Min3 template function will work with the v128 type as well.
GEO_FORCE_INLINE Geo::v128 Geo::operator-
public: Geo::v128 operator-
(
Geo::v128Param lhs,
Geo::v128Param rhs
)
Operator - (component-wise subtraction)
GEO_FORCE_INLINE Geo::v128 Geo::operator-
public: Geo::v128 operator-
(
Geo::v128Param v
)
The unary - operator. Equivalent to (VZero() - v);.
GEO_FORCE_INLINE Geo::v128 Geo::operator*
public: Geo::v128 operator*
(
Geo::v128Param lhs,
Geo::v128Param rhs
)
Operator * (component-wise multiplication)
GEO_FORCE_INLINE Geo::v128 & Geo::operator*=
public: Geo::v128 & operator*=
(
Geo::v128 & lhs,
Geo::v128Param rhs)