Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# irrMath.h File Reference

`#include "IrrCompileConfig.h"`
`#include "irrTypes.h"`
`#include <math.h>`
`#include <float.h>`
`#include <stdlib.h>`
`#include <limits.h>`

Go to the source code of this file.

## Namespaces
namespace | irr
namespace | irr::core
## Classes
union | irr::core::inttofloat
## Defines
#define | AIR(x) (IR(x)&0x7fffffff)
| Absolute integer representation of a floating-point value.
#define | F32_A_GREATER_B(a, b) ((a) > (b))
#define | F32_AS_S32(f) (*((s32 *) &(f)))
#define | F32_AS_U32(f) (*((u32 *) &(f)))
#define | F32_AS_U32_POINTER(f) ( ((u32 *) &(f)))
#define | F32_EQUAL_0(n) ((n) == 0.0f)
#define | F32_EQUAL_1(n) ((n) == 1.0f)
#define | F32_EXPON_MANTISSA 0x7FFFFFFFU
#define | F32_GREATER_0(n) ((n) > 0.0f)
#define | F32_GREATER_EQUAL_0(n) ((n) >= 0.0f)
#define | F32_LOWER_0(n) ((n) < 0.0f)
#define | F32_LOWER_EQUAL_0(n) ((n) <= 0.0f)
#define | F32_SIGN_BIT 0x80000000U
#define | F32_VALUE_0 0x00000000
#define | F32_VALUE_1 0x3f800000
#define | FLT_MAX 3.402823466E+38F
#define | IEEE_1_0 0x3f800000
| integer representation of 1.0
#define | IEEE_255_0 0x437f0000
| integer representation of 255.0
#define | REALINLINE inline
## Functions
template<class T>
T | irr::core::abs_ (const T &a)
| returns abs of two values. Own implementation to get rid of STL (VS6 problems)
REALINLINE s32 | irr::core::ceil32 (f32 x)
template<class T>
const T | irr::core::clamp (const T &value, const T &low, const T &high)
| clamps a value between low and high
REALINLINE void | irr::core::clearFPUException ()
f64 | irr::core::degToRad (f64 degrees)
| Utility function to convert a degrees value to radians.
f32 | irr::core::degToRad (f32 degrees)
| Utility function to convert a degrees value to radians.
bool | irr::core::equals (const u32 a, const u32 b, const s32 tolerance=ROUNDING_ERROR_S32)
| returns if a equals b, taking an explicit rounding tolerance into account
bool | irr::core::equals (const s32 a, const s32 b, const s32 tolerance=ROUNDING_ERROR_S32)
| returns if a equals b, taking an explicit rounding tolerance into account
bool | irr::core::equals (const f32 a, const f32 b, const f32 tolerance=ROUNDING_ERROR_f32)
| returns if a equals b, taking possible rounding errors into account
bool | irr::core::equals (const f64 a, const f64 b, const f64 tolerance=ROUNDING_ERROR_f64)
| returns if a equals b, taking possible rounding errors into account
f32 | irr::core::f32_max3 (const f32 a, const f32 b, const f32 c)
f32 | irr::core::f32_min3 (const f32 a, const f32 b, const f32 c)
REALINLINE s32 | irr::core::floor32 (f32 x)
f32 | irr::core::FR (s32 x)
f32 | irr::core::FR (u32 x)
| Floating-point representation of an integer value.
f32 | irr::core::fract (f32 x)
REALINLINE u32 | irr::core::if_c_a_else_0 (const s32 condition, const u32 a)
| conditional set based on mask and arithmetic shift
REALINLINE u16 | irr::core::if_c_a_else_b (const s16 condition, const u16 a, const u16 b)
| conditional set based on mask and arithmetic shift
REALINLINE u32 | irr::core::if_c_a_else_b (const s32 condition, const u32 a, const u32 b)
| conditional set based on mask and arithmetic shift
u32 | irr::core::IR (f32 x)
bool | irr::core::isnotzero (const f32 a, const f32 tolerance=ROUNDING_ERROR_f32)
| returns if a equals not zero, taking rounding errors into account
bool | irr::core::iszero (const u32 a, const u32 tolerance=0)
| returns if a equals zero, taking rounding errors into account
bool | irr::core::iszero (const s32 a, const s32 tolerance=0)
| returns if a equals zero, taking rounding errors into account
bool | irr::core::iszero (const f32 a, const f32 tolerance=ROUNDING_ERROR_f32)
| returns if a equals zero, taking rounding errors into account
bool | irr::core::iszero (const f64 a, const f64 tolerance=ROUNDING_ERROR_f64)
| returns if a equals zero, taking rounding errors into account
template<class T>
T | irr::core::lerp (const T &a, const T &b, const f32 t)
template<class T>
const T & | irr::core::max_ (const T &a, const T &b, const T &c)
| returns maximum of three values. Own implementation to get rid of the STL (VS6 problems)
template<class T>
const T & | irr::core::max_ (const T &a, const T &b)
| returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)
template<class T>
const T & | irr::core::min_ (const T &a, const T &b, const T &c)
| returns minimum of three values. Own implementation to get rid of the STL (VS6 problems)
template<class T>
const T & | irr::core::min_ (const T &a, const T &b)
| returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)
f64 | irr::core::radToDeg (f64 radians)
| Utility function to convert a radian value to degrees.
f32 | irr::core::radToDeg (f32 radians)
| Utility function to convert a radian value to degrees.
REALINLINE f64 | irr::core::reciprocal (const f64 f)
REALINLINE f32 | irr::core::reciprocal (const f32 f)
REALINLINE f32 | irr::core::reciprocal_approxim (const f32 f)
REALINLINE s32 | irr::core::reciprocal_squareroot (const s32 x)
REALINLINE f32 | irr::core::reciprocal_squareroot (const f32 f)
REALINLINE f64 | irr::core::reciprocal_squareroot (const f64 x)
REALINLINE s32 | irr::core::round32 (f32 x)
f32 | irr::core::round_ (f32 x)
s32 | irr::core::s32_clamp (s32 value, s32 low, s32 high)
s32 | irr::core::s32_max (s32 a, s32 b)
s32 | irr::core::s32_min (s32 a, s32 b)
REALINLINE void | irr::core::setbit_cond (u32 &state, s32 condition, u32 mask)
REALINLINE s32 | irr::core::squareroot (const s32 f)
REALINLINE f64 | irr::core::squareroot (const f64 f)
REALINLINE f32 | irr::core::squareroot (const f32 f)
## Variables
const f32 | irr::core::DEGTORAD = PI / 180.0f
| 32bit Constant for converting from degrees to radians
const f64 | irr::core::DEGTORAD64 = PI64 / 180.0
| 64bit constant for converting from degrees to radians (formally known as GRAD_PI2)
const f32 | irr::core::HALF_PI = PI/2.0f
| Constant for half of PI.
const f32 | irr::core::PI = 3.14159265359f
| Constant for PI.
const f64 | irr::core::PI64 = 3.1415926535897932384626433832795028841971693993751
| Constant for 64bit PI.
const f32 | irr::core::RADTODEG = 180.0f / PI
| 32bit constant for converting from radians to degrees (formally known as GRAD_PI)
const f64 | irr::core::RADTODEG64 = 180.0 / PI64
| 64bit constant for converting from radians to degrees
const f32 | irr::core::RECIPROCAL_PI = 1.0f/PI
| Constant for reciprocal of PI.
const f64 | irr::core::RECIPROCAL_PI64 = 1.0/PI64
| Constant for 64bit reciprocal of PI.
const f32 | irr::core::ROUNDING_ERROR_f32 = 0.000001f
const f64 | irr::core::ROUNDING_ERROR_f64 = 0.00000001
const s32 | irr::core::ROUNDING_ERROR_S32 = 1
| Rounding error constant often used when comparing f32 values.

## Define Documentation

#define AIR | ( | x |  | ) | (IR(x)&0x7fffffff)

Absolute integer representation of a floating-point value.

Definition at line 281 of file irrMath.h.

#define F32_A_GREATER_B | ( | a,
|  | b |  | ) | ((a) > (b))

Definition at line 315 of file irrMath.h.

#define F32_AS_S32 | ( | f |  | ) | (*((s32 *) &(f)))

Definition at line 263 of file irrMath.h.

#define F32_AS_U32 | ( | f |  | ) | (*((u32 *) &(f)))

Definition at line 264 of file irrMath.h.

#define F32_AS_U32_POINTER | ( | f |  | ) | ( ((u32 *) &(f)))

Definition at line 265 of file irrMath.h.

#define F32_EQUAL_0 | ( | n |  | ) | ((n) == 0.0f)

Definition at line 314 of file irrMath.h.

#define F32_EQUAL_1 | ( | n |  | ) | ((n) == 1.0f)

Definition at line 313 of file irrMath.h.

#define F32_EXPON_MANTISSA 0x7FFFFFFFU

Definition at line 270 of file irrMath.h.

#define F32_GREATER_0 | ( | n |  | ) | ((n) > 0.0f)

Definition at line 311 of file irrMath.h.

#define F32_GREATER_EQUAL_0 | ( | n |  | ) | ((n) >= 0.0f)

Definition at line 312 of file irrMath.h.

#define F32_LOWER_0 | ( | n |  | ) | ((n) < 0.0f)

Definition at line 309 of file irrMath.h.

#define F32_LOWER_EQUAL_0 | ( | n |  | ) | ((n) <= 0.0f)

Definition at line 310 of file irrMath.h.

Referenced by irr::core::triangle3d< T >::isFrontFacing(), and irr::core::plane3d< float >::isFrontFacing().

#define F32_SIGN_BIT 0x80000000U

Definition at line 269 of file irrMath.h.

#define F32_VALUE_0 0x00000000

Definition at line 267 of file irrMath.h.

#define F32_VALUE_1 0x3f800000

Definition at line 268 of file irrMath.h.

Referenced by irr::core::CMatrix4< T >::isIdentity_integer_base().

#define FLT_MAX 3.402823466E+38F

Definition at line 31 of file irrMath.h.

Referenced by irr::core::strtof10().

#define IEEE_1_0 0x3f800000

integer representation of 1.0

Definition at line 292 of file irrMath.h.

#define IEEE_255_0 0x437f0000

integer representation of 255.0

Definition at line 294 of file irrMath.h.

#define REALINLINE inline

Definition at line 323 of file irrMath.h.

| The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:05 2010 by Doxygen (1.5.6)