OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::MathlibC Class Reference

#include <OgreMathlibC.h>

Static Public Member Functions

static ArrayReal Abs4 (ArrayReal a)
 Returns the absolute values of each 4 floats. More...
 
static ArrayReal ACos4 (ArrayReal x)
 Returns the arccos of x. More...
 
static ArrayInt And (ArrayInt a, ArrayInt b)
 Returns the result of "a & b". More...
 
static ArrayMaskI And (ArrayMaskI a, ArrayInt b)
 
static ArrayMaskI And (ArrayInt a, ArrayMaskI b)
 
static ArrayMaskI And (ArrayMaskI a, ArrayMaskI b)
 
static ArrayInt AndNot (ArrayInt a, ArrayInt b)
 Returns the result of "a & ~b". More...
 
static ArrayMaskI AndNot (ArrayMaskI a, ArrayInt b)
 
static ArrayMaskI AndNot (ArrayInt a, ArrayMaskI b)
 
static ArrayMaskI AndNot (ArrayMaskI a, ArrayMaskI b)
 
static ArrayReal Cmov4 (ArrayReal arg1, ArrayReal arg2, ArrayMaskR mask)
 Branchless conditional move for 4 floating point values. More...
 
static ArrayReal CmovRobust (ArrayReal arg1, ArrayReal arg2, ArrayMaskR mask)
 Robust, branchless conditional move for a 128-bit value. More...
 
static ArrayInt CmovRobust (ArrayInt arg1, ArrayInt arg2, ArrayMaskI mask)
 
static Real ColapseMax (ArrayReal a)
 Returns the maximum value of all elements in a. More...
 
static Real ColapseMin (ArrayReal a)
 Returns the minimum value of all elements in a. More...
 
static ArrayMaskR CompareGreater (ArrayReal a, ArrayReal b)
 Returns the result of "a > b". More...
 
static ArrayMaskR CompareGreaterEqual (ArrayReal a, ArrayReal b)
 Returns the result of "a >= b". More...
 
static ArrayMaskR CompareLess (ArrayReal a, ArrayReal b)
 Returns the result of "a < b". More...
 
static ArrayMaskR CompareLessEqual (ArrayReal a, ArrayReal b)
 Returns the result of "a <= b". More...
 
static ArrayReal Cos4 (ArrayReal x)
 Returns the cosine of x. More...
 
static ArrayReal Inv4 (ArrayReal val)
 Returns the reciprocal of x. More...
 
static ArrayReal InvNonZero4 (ArrayReal val)
 Returns the reciprocal of x. More...
 
static ArrayReal InvSqrt4 (ArrayReal f)
 Returns the squared root of the reciprocal of x. More...
 
static ArrayReal InvSqrtNonZero4 (ArrayReal f)
 Returns the squared root of the reciprocal of x. More...
 
static ArrayMaskR isInfinity (ArrayReal a)
 Returns the result of "a == std::numeric_limits<float>::infinity()". More...
 
static ArrayReal Max (ArrayReal a, ArrayReal b)
 Returns the maximum value between a and b. More...
 
static ArrayReal Modf4 (ArrayReal x, ArrayReal &outIntegral)
 Break x into fractional and integral parts. More...
 
static ArrayInt Or (ArrayInt a, ArrayInt b)
 Returns the result of "a | b". More...
 
static ArrayMaskI Or (ArrayMaskI a, ArrayMaskI b)
 
static ArrayMaskI Or (ArrayMaskI a, ArrayInt b)
 
static ArrayMaskI Or (ArrayInt a, ArrayMaskI b)
 
static ArrayReal SetAll (Real val)
 
static ArrayInt SetAll (uint32 val)
 
static ArrayReal Sin4 (ArrayReal x)
 Returns the sine of x. More...
 
static void SinCos4 (ArrayReal x, ArrayReal &outSin, ArrayReal &outCos)
 Calculates the cosine & sine of x. More...
 
static ArrayMaskI TestFlags4 (ArrayInt a, ArrayInt b)
 Test if "a AND b" will result in non-zero, returning 0xffffffff on those cases. More...
 
static ArrayMaskI TestFlags4 (ArrayMaskI a, ArrayInt b)
 
static ArrayMaskI TestFlags4 (ArrayInt a, ArrayMaskI b)
 

Static Public Attributes

static const ArrayReal fDeg2Rad
 
static const ArrayReal fEpsilon
 
static const ArrayReal FLOAT_MIN
 
static const ArrayReal fRad2Deg
 
static const ArrayReal fSqEpsilon
 
static const ArrayReal HALF
 
static const ArrayReal INFINITEA
 
static const ArrayReal MAX_NEG
 
static const ArrayReal MAX_POS
 
static const ArrayReal NEG_ONE
 
static const ArrayReal ONE
 
static const ArrayReal ONE_DIV_2PI
 
static const ArrayReal OneMinusEpsilon
 
static const ArrayReal PI
 
static const ArrayReal SIGN_MASK
 
static const ArrayReal THREE
 
static const ArrayReal TWO_PI
 

Detailed Description

Definition at line 42 of file OgreMathlibC.h.

Member Function Documentation

static ArrayReal Ogre::MathlibC::Abs4 ( ArrayReal  a)
inlinestatic

Returns the absolute values of each 4 floats.

Parameters
4floating point values
Returns
abs( a )

Definition at line 69 of file OgreMathlibC.h.

References Ogre::Math::Abs().

static ArrayReal Ogre::MathlibC::ACos4 ( ArrayReal  x)
inlinestatic

Returns the arccos of x.

Parameters
x4 floating point values
Returns
arccos( x ) (packed as 4 floats)
static ArrayInt Ogre::MathlibC::And ( ArrayInt  a,
ArrayInt  b 
)
inlinestatic

Returns the result of "a & b".

Returns
r[i] = a[i] & b[i];

Definition at line 147 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::And ( ArrayMaskI  a,
ArrayInt  b 
)
inlinestatic

Definition at line 152 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::And ( ArrayInt  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 157 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::And ( ArrayMaskI  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 162 of file OgreMathlibC.h.

static ArrayInt Ogre::MathlibC::AndNot ( ArrayInt  a,
ArrayInt  b 
)
inlinestatic

Returns the result of "a & ~b".

Returns
r[i] = a[i] & ~b[i];

Definition at line 190 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::AndNot ( ArrayMaskI  a,
ArrayInt  b 
)
inlinestatic

Definition at line 195 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::AndNot ( ArrayInt  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 200 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::AndNot ( ArrayMaskI  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 205 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::Cmov4 ( ArrayReal  arg1,
ArrayReal  arg2,
ArrayMaskR  mask 
)
inlinestatic

Branchless conditional move for 4 floating point values.

Remarks
Will NOT work if any of the arguments contains Infinite or NaNs or non-floating point values. If an exact binary copy is needed,
See also
CmovRobust
Parameters
4floating point values. Can't be NaN or Inf
4floating point values. Can't be NaN or Inf
4values containing either 0 or 0xffffffff Any other value, the result is undefined
Returns
r[i] = mask[i] != 0 ? arg1[i] : arg2[i] Another way to say it: if( maskCondition[i] == true ) r[i] = arg1[i]; else arg2[i];

Definition at line 94 of file OgreMathlibC.h.

References Ogre::Math::isNaN().

static ArrayReal Ogre::MathlibC::CmovRobust ( ArrayReal  arg1,
ArrayReal  arg2,
ArrayMaskR  mask 
)
inlinestatic

Robust, branchless conditional move for a 128-bit value.

Remarks
If you're looking to copy 4 floating point values that do not contain Inf or Nans,
See also
Cmov4 which is faster. This is because switching between registers flagged as floating point to integer and back has a latency delay

For more information refer to Chapter 3.5.2.3 Bypass between Execution Domains, IntelĀ® 64 and IA-32 Architectures Optimization Reference Manual Order Number: 248966-026 April (and also Table 2-12)

Parameters
Avalue containing 128 bits
Avalue containing 128 bits
Mask,eachbit is evaluated
Returns
For each bit: r[i] = mask[i] != 0 ? arg1[i] : arg2[i] Another way to say it: if( maskCondition[i] == true ) r[i] = arg1[i]; else arg2[i];

Definition at line 134 of file OgreMathlibC.h.

static ArrayInt Ogre::MathlibC::CmovRobust ( ArrayInt  arg1,
ArrayInt  arg2,
ArrayMaskI  mask 
)
inlinestatic

Definition at line 138 of file OgreMathlibC.h.

static Real Ogre::MathlibC::ColapseMax ( ArrayReal  a)
inlinestatic

Returns the maximum value of all elements in a.

Returns
r[0] = max( a[0], a[1], a[2], a[3] )

Definition at line 306 of file OgreMathlibC.h.

static Real Ogre::MathlibC::ColapseMin ( ArrayReal  a)
inlinestatic

Returns the minimum value of all elements in a.

Returns
r[0] = min( a[0], a[1], a[2], a[3] )

Definition at line 297 of file OgreMathlibC.h.

static ArrayMaskR Ogre::MathlibC::CompareGreater ( ArrayReal  a,
ArrayReal  b 
)
inlinestatic

Returns the result of "a > b".

Returns
r[i] = a[i] > b[i] ? 0xffffffff : 0;

Definition at line 254 of file OgreMathlibC.h.

static ArrayMaskR Ogre::MathlibC::CompareGreaterEqual ( ArrayReal  a,
ArrayReal  b 
)
inlinestatic

Returns the result of "a >= b".

Returns
r[i] = a[i] >= b[i] ? 0xffffffff : 0;

Definition at line 263 of file OgreMathlibC.h.

static ArrayMaskR Ogre::MathlibC::CompareLess ( ArrayReal  a,
ArrayReal  b 
)
inlinestatic

Returns the result of "a < b".

Returns
r[i] = a[i] < b[i] ? 0xffffffff : 0;

Definition at line 236 of file OgreMathlibC.h.

static ArrayMaskR Ogre::MathlibC::CompareLessEqual ( ArrayReal  a,
ArrayReal  b 
)
inlinestatic

Returns the result of "a <= b".

Returns
r[i] = a[i] <= b[i] ? 0xffffffff : 0;

Definition at line 245 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::Cos4 ( ArrayReal  x)
inlinestatic

Returns the cosine of x.

Parameters
x4 floating point values
Returns
cos( x ) (packed as 4 floats)
static ArrayReal Ogre::MathlibC::Inv4 ( ArrayReal  val)
inlinestatic

Returns the reciprocal of x.

Remarks
If you have a very rough guarantees that you won't be feeding a zero, consider using
See also
InvNonZero4 because it's faster. See MathlibSSE2 implementation
Returns
1 / x (packed as 4 floats)

Definition at line 319 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::InvNonZero4 ( ArrayReal  val)
inlinestatic

Returns the reciprocal of x.

Remarks
If the input is zero, it will produce a NaN!!! (but it's faster) Note: Some architectures may slowdown when a NaN is produced, making this function slower than Inv4 for those cases
See also
Inv4
Parameters
valIf it's zero, the returned value could be NaN depending on implementation
Returns
1 / x

Definition at line 335 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::InvSqrt4 ( ArrayReal  f)
inlinestatic

Returns the squared root of the reciprocal of x.

Returns
1 / sqrt( x )

Definition at line 344 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::InvSqrtNonZero4 ( ArrayReal  f)
inlinestatic

Returns the squared root of the reciprocal of x.

Returns
1 / sqrt( x ) (packed as 4 floats)

Definition at line 353 of file OgreMathlibC.h.

static ArrayMaskR Ogre::MathlibC::isInfinity ( ArrayReal  a)
inlinestatic

Returns the result of "a == std::numeric_limits<float>::infinity()".

Returns
r[i] = a[i] == Inf ? 0xffffffff : 0;

Definition at line 282 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::Max ( ArrayReal  a,
ArrayReal  b 
)
inlinestatic

Returns the maximum value between a and b.

Definition at line 288 of file OgreMathlibC.h.

References Ogre::max().

static ArrayReal Ogre::MathlibC::Modf4 ( ArrayReal  x,
ArrayReal outIntegral 
)
inlinestatic

Break x into fractional and integral parts.

Parameters
4floating point values. i.e. "2.57" (x4)
xThe integral part of x. i.e. 2
Returns
outIntegral The fractional part of x. i.e. 0.57
static ArrayInt Ogre::MathlibC::Or ( ArrayInt  a,
ArrayInt  b 
)
inlinestatic

Returns the result of "a | b".

Returns
r[i] = a[i] | b[i];

Definition at line 214 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::Or ( ArrayMaskI  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 218 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::Or ( ArrayMaskI  a,
ArrayInt  b 
)
inlinestatic

Definition at line 223 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::Or ( ArrayInt  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 227 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::SetAll ( Real  val)
inlinestatic

Definition at line 268 of file OgreMathlibC.h.

static ArrayInt Ogre::MathlibC::SetAll ( uint32  val)
inlinestatic

Definition at line 273 of file OgreMathlibC.h.

static ArrayReal Ogre::MathlibC::Sin4 ( ArrayReal  x)
inlinestatic

Returns the sine of x.

Parameters
x4 floating point values
Returns
sin( x ) (packed as 4 floats)
static void Ogre::MathlibC::SinCos4 ( ArrayReal  x,
ArrayReal outSin,
ArrayReal outCos 
)
static

Calculates the cosine & sine of x.

Use this function if you need to calculate both, as it is faster than calling Cos4 & Sin4 together.

Parameters
x4 floating point values
outSinOutput value, sin( x ) (packed as 4 floats)
outCosOutput value, cos( x ) (packed as 4 floats)
static ArrayMaskI Ogre::MathlibC::TestFlags4 ( ArrayInt  a,
ArrayInt  b 
)
inlinestatic

Test if "a AND b" will result in non-zero, returning 0xffffffff on those cases.

Returns
r[i] = (a[i] & b[i]) ? 0xffffffff : 0;

Definition at line 171 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::TestFlags4 ( ArrayMaskI  a,
ArrayInt  b 
)
inlinestatic

Definition at line 176 of file OgreMathlibC.h.

static ArrayMaskI Ogre::MathlibC::TestFlags4 ( ArrayInt  a,
ArrayMaskI  b 
)
inlinestatic

Definition at line 181 of file OgreMathlibC.h.

Member Data Documentation

const ArrayReal Ogre::MathlibC::fDeg2Rad
static

Definition at line 55 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::fEpsilon
static

Definition at line 52 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::FLOAT_MIN
static

Definition at line 57 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::fRad2Deg
static

Definition at line 56 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::fSqEpsilon
static

Definition at line 53 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::HALF
static

Definition at line 45 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::INFINITEA
static

Definition at line 59 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::MAX_NEG
static

Definition at line 60 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::MAX_POS
static

Definition at line 61 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::NEG_ONE
static

Definition at line 48 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::ONE
static

Definition at line 46 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::ONE_DIV_2PI
static

Definition at line 51 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::OneMinusEpsilon
static

Definition at line 54 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::PI
static

Definition at line 49 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::SIGN_MASK
static

Definition at line 58 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::THREE
static

Definition at line 47 of file OgreMathlibC.h.

const ArrayReal Ogre::MathlibC::TWO_PI
static

Definition at line 50 of file OgreMathlibC.h.


The documentation for this class was generated from the following file: