Irrlicht 3D Engine
irr::core Namespace Reference

Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace. More...

Classes

Typedefs

Enumerations

Functions

Variables


Detailed Description

Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.


Typedef Documentation

Typedef for a f32 3d bounding box.

Definition at line 324 of file aabbox3d.h.

Typedef for an integer 3d bounding box.

Definition at line 326 of file aabbox3d.h.

Typedef for an f32 dimension.

Definition at line 210 of file dimension2d.h.

Typedef for an integer dimension.

There are few cases where negative dimensions make sense. Please consider using dimension2du instead.

Definition at line 217 of file dimension2d.h.

Typedef for an unsigned integer dimension.

Definition at line 212 of file dimension2d.h.

Typedef for an f32 line.

Definition at line 266 of file line2d.h.

Typedef for an integer line.

Definition at line 268 of file line2d.h.

Typedef for an f32 line.

Definition at line 136 of file line3d.h.

Typedef for an integer line.

Definition at line 138 of file line3d.h.

Typedef for f32 matrix.

Definition at line 2233 of file matrix4.h.

Typedef for a f32 3d plane.

Definition at line 236 of file plane3d.h.

Typedef for an integer 3d plane.

Definition at line 239 of file plane3d.h.

Deprecated:
position2d is now a synonym for vector2d, but vector2d should be used directly.

Definition at line 21 of file position2d.h.

Deprecated:
position2d is now a synonym for vector2d, but vector2d should be used directly.

Definition at line 24 of file position2d.h.

Rectangle with float values.

Definition at line 271 of file rect.h.

Rectangle with int values.

Definition at line 273 of file rect.h.

Typedef for character strings.

Definition at line 1358 of file irrString.h.

typedef string<wchar_t> irr::core::stringw

Typedef for wide character strings.

Definition at line 1361 of file irrString.h.

Typedef for a f32 3d triangle.

Definition at line 270 of file triangle3d.h.

Typedef for an integer 3d triangle.

Definition at line 273 of file triangle3d.h.

Typedef for f32 2d vector.

Definition at line 323 of file vector2d.h.

Typedef for integer 2d vector.

Definition at line 326 of file vector2d.h.

Typedef for a f32 3d vector.

Definition at line 445 of file vector3d.h.

Typedef for an integer 3d vector.

Definition at line 448 of file vector3d.h.


Enumeration Type Documentation

defines an allocation strategy

Enumerator:
ALLOC_STRATEGY_SAFE 
ALLOC_STRATEGY_DOUBLE 
ALLOC_STRATEGY_SQRT 

Definition at line 112 of file irrAllocator.h.

Enumeration for intersection relations of 3d objects.

Enumerator:
ISREL3D_FRONT 
ISREL3D_BACK 
ISREL3D_PLANAR 
ISREL3D_SPANNING 
ISREL3D_CLIPPED 

Definition at line 17 of file plane3d.h.

Very simple string class with some useful features.

string<c8> and string<wchar_t> both accept Unicode AND ASCII/Latin-1, so you can assign Unicode to string<c8> and ASCII/Latin-1 to string<wchar_t> (and the other way round) if you want to.

However, note that the conversation between both is not done using any encoding. This means that c8 strings are treated as ASCII/Latin-1, not UTF-8, and are simply expanded to the equivalent wchar_t, while Unicode/wchar_t characters are truncated to 8-bit ASCII/Latin-1 characters, discarding all other information in the wchar_t.

Enumerator:
IRR_LOCALE_ANSI 
IRR_LOCALE_GERMAN 

Definition at line 32 of file irrString.h.


Function Documentation

template<class T >
T irr::core::abs_ ( const T &  a) [inline]

returns abs of two values. Own implementation to get rid of STL (VS6 problems)

Definition at line 151 of file irrMath.h.

Referenced by equalsByUlp(), and iszero().

REALINLINE s32 irr::core::ceil32 ( f32  x)

Definition at line 646 of file irrMath.h.

REALINLINE void irr::core::clearFPUException ( )

Definition at line 454 of file irrMath.h.

u32 irr::core::ctoul16 ( char  in) [inline]

Convert a hex-encoded character to an unsigned integer.

Parameters:
[in]inThe digit to convert. Only digits 0 to 9 and chars A-F,a-f will be considered.
Returns:
The unsigned integer value of the digit. 0xffffffff if the input is not hex

Definition at line 125 of file fast_atof.h.

io::path& irr::core::cutFilenameExtension ( io::path &  dest,
const io::path &  source 
) [inline]

cut the filename extension from a source file path and store it in a dest file path

Definition at line 49 of file coreutil.h.

References irr::core::string< T, TAlloc >::findLast(), irr::core::string< T, TAlloc >::size(), and irr::core::string< T, TAlloc >::subString().

Referenced by irr::scene::quake3::getTextures().

f32 irr::core::degToRad ( f32  degrees) [inline]

Utility function to convert a degrees value to radians.

Provided as it can be clearer to write degToRad(X) than DEGTORAD * X

Parameters:
degreesThe degrees value to convert to radians.

Definition at line 107 of file irrMath.h.

References DEGTORAD.

f64 irr::core::degToRad ( f64  degrees) [inline]

Utility function to convert a degrees value to radians.

Provided as it can be clearer to write degToRad(X) than DEGTORAD * X

Parameters:
degreesThe degrees value to convert to radians.

Definition at line 116 of file irrMath.h.

References DEGTORAD64.

io::path& irr::core::deletePathFromFilename ( io::path &  filename) [inline]

delete path from filename

Definition at line 68 of file coreutil.h.

References irr::core::string< T, TAlloc >::c_str(), and irr::core::string< T, TAlloc >::size().

io::path& irr::core::deletePathFromPath ( io::path &  filename,
s32  pathCount 
) [inline]
bool irr::core::equals ( const f32  a,
const f32  b,
const f32  tolerance = ROUNDING_ERROR_f32 
) [inline]

returns if a equals b, taking possible rounding errors into account

Definition at line 191 of file irrMath.h.

bool irr::core::equals ( const s32  a,
const s32  b,
const s32  tolerance = ROUNDING_ERROR_S32 
) [inline]

returns if a equals b, taking an explicit rounding tolerance into account

Definition at line 250 of file irrMath.h.

bool irr::core::equals ( const u32  a,
const u32  b,
const s32  tolerance = ROUNDING_ERROR_S32 
) [inline]

returns if a equals b, taking an explicit rounding tolerance into account

Definition at line 256 of file irrMath.h.

bool irr::core::equals ( const s64  a,
const s64  b,
const s64  tolerance = ROUNDING_ERROR_S64 
) [inline]

returns if a equals b, taking an explicit rounding tolerance into account

Definition at line 263 of file irrMath.h.

bool irr::core::equalsByUlp ( f32  a,
f32  b,
int  maxUlpDiff 
) [inline]

We compare the difference in ULP's (spacing between floating-point numbers, aka ULP=1 means there exists no float between).

Definition at line 208 of file irrMath.h.

References abs_(), irr::core::FloatIntUnion32::i, and irr::core::FloatIntUnion32::sign().

f32 irr::core::f32_max3 ( const f32  a,
const f32  b,
const f32  c 
) [inline]

Definition at line 708 of file irrMath.h.

f32 irr::core::f32_min3 ( const f32  a,
const f32  b,
const f32  c 
) [inline]

Definition at line 713 of file irrMath.h.

float irr::core::fast_atof ( const char *  floatAsString,
const char **  out = 0 
) [inline]

Convert a string to a floating point number.

Parameters:
floatAsStringThe string to convert.
outOptional pointer to the first character in the string that wasn't used to create the float value.
Returns:
Float value parsed from the input string

Definition at line 350 of file fast_atof.h.

References fast_atof_move().

const char* irr::core::fast_atof_move ( const char *  in,
f32 &  result 
) [inline]

Provides a fast function for converting a string into a float.

This is not guaranteed to be as accurate as atof(), but is approximately 6 to 8 times as fast.

Parameters:
[in]inThe string to convert.
[out]resultThe resultant float will be written here.
Returns:
Pointer to the first character in the string that wasn't used to create the float value.

Definition at line 309 of file fast_atof.h.

References fast_atof_table, irr::core::string< T, TAlloc >::findFirst(), LOCALE_DECIMAL_POINTS, strtof10(), and strtol10().

Referenced by fast_atof(), and irr::scene::quake3::getAsFloat().

REALINLINE s32 irr::core::floor32 ( f32  x)
f32 irr::core::FR ( u32  x) [inline]

Floating-point representation of an integer value.

Definition at line 363 of file irrMath.h.

References irr::core::inttofloat::f, and irr::core::inttofloat::u.

Referenced by irr::video::pack_textureBlendFunc().

f32 irr::core::FR ( s32  x) [inline]

Definition at line 364 of file irrMath.h.

References irr::core::inttofloat::f, and irr::core::inttofloat::s.

f32 irr::core::fract ( f32  x) [inline]

Definition at line 718 of file irrMath.h.

Referenced by irr::scene::quake3::SModifierFunction::evaluate().

io::path& irr::core::getFileNameExtension ( io::path &  dest,
const io::path &  source 
) [inline]

get the filename extension from a file path

Definition at line 57 of file coreutil.h.

References irr::core::string< T, TAlloc >::findLast(), irr::core::string< T, TAlloc >::size(), and irr::core::string< T, TAlloc >::subString().

bool irr::core::hasFileExtension ( const io::path &  filename,
const io::path &  ext0,
const io::path &  ext1 = "",
const io::path &  ext2 = "" 
) [inline]

search if a filename has a proper extension

Definition at line 40 of file coreutil.h.

References isFileExtension().

template<class T >
void irr::core::heapsink ( T *  array,
s32  element,
s32  max 
) [inline]

Sinks an element into the heap.

Definition at line 17 of file heapsort.h.

Referenced by heapsort().

template<class T >
void irr::core::heapsort ( T *  array_,
s32  size 
) [inline]

Sorts an array with size 'size' using heapsort.

Definition at line 41 of file heapsort.h.

References heapsink().

Referenced by irr::core::array< IMesh * >::sort().

REALINLINE u32 irr::core::if_c_a_else_0 ( const s32  condition,
const u32  a 
)

conditional set based on mask and arithmetic shift

Definition at line 433 of file irrMath.h.

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

Definition at line 421 of file irrMath.h.

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

Definition at line 427 of file irrMath.h.

u32 irr::core::IR ( f32  x) [inline]

code is taken from IceFPU Integer representation of a floating-point value.

Definition at line 353 of file irrMath.h.

References irr::core::inttofloat::f, and irr::core::inttofloat::u.

Referenced by irr::core::CMatrix4< T >::isIdentity_integer_base(), and irr::video::unpack_textureBlendFunc().

s32 irr::core::isdigit ( s32  c) [inline]

some standard function ( to remove dependencies )

Definition at line 180 of file coreutil.h.

s32 irr::core::isFileExtension ( const io::path &  filename,
const io::path &  ext0,
const io::path &  ext1,
const io::path &  ext2 
) [inline]

search if a filename has a proper extension

Definition at line 23 of file coreutil.h.

References irr::core::string< T, TAlloc >::equals_substring_ignore_case(), and irr::core::string< T, TAlloc >::findLast().

Referenced by hasFileExtension().

s32 irr::core::isInSameDirectory ( const io::path &  path,
const io::path &  file 
) [inline]

looks if file is in the same directory of path. returns offset of directory. 0 means in same directory. 1 means file is direct child of path

Definition at line 115 of file coreutil.h.

References irr::core::string< T, TAlloc >::equalsn(), irr::core::string< T, TAlloc >::findNext(), and irr::core::string< T, TAlloc >::size().

bool irr::core::isnotzero ( const f32  a,
const f32  tolerance = ROUNDING_ERROR_f32 
) [inline]

returns if a equals not zero, taking rounding errors into account

Definition at line 282 of file irrMath.h.

s32 irr::core::isspace ( s32  c) [inline]

Definition at line 181 of file coreutil.h.

s32 irr::core::isupper ( s32  c) [inline]

Definition at line 182 of file coreutil.h.

bool irr::core::iszero ( const f64  a,
const f64  tolerance = ROUNDING_ERROR_f64 
) [inline]
bool irr::core::iszero ( const f32  a,
const f32  tolerance = ROUNDING_ERROR_f32 
) [inline]

returns if a equals zero, taking rounding errors into account

Definition at line 276 of file irrMath.h.

bool irr::core::iszero ( const s32  a,
const s32  tolerance = 0 
) [inline]

returns if a equals zero, taking rounding errors into account

Definition at line 288 of file irrMath.h.

bool irr::core::iszero ( const u32  a,
const u32  tolerance = 0 
) [inline]

returns if a equals zero, taking rounding errors into account

Definition at line 294 of file irrMath.h.

bool irr::core::iszero ( const s64  a,
const s64  tolerance = 0 
) [inline]

returns if a equals zero, taking rounding errors into account

Definition at line 301 of file irrMath.h.

References abs_().

template<class T >
T irr::core::lerp ( const T &  a,
const T &  b,
const f32  t 
) [inline]

returns linear interpolation of a and b with ratio t

Returns:
: a if t==0, b if t==1, and the linear interpolation else

Definition at line 159 of file irrMath.h.

template<class T >
const T& irr::core::max_ ( const T &  a,
const T &  b 
) [inline]

returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)

Definition at line 137 of file irrMath.h.

Referenced by clamp(), irr::video::SColorHSL::fromRGB(), irr::video::SColor::getLightness(), and max_().

template<class T >
const T& irr::core::max_ ( const T &  a,
const T &  b,
const T &  c 
) [inline]

returns maximum of three values. Own implementation to get rid of the STL (VS6 problems)

Definition at line 144 of file irrMath.h.

References max_().

template<class T >
const T& irr::core::min_ ( const T &  a,
const T &  b 
) [inline]

returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)

Definition at line 123 of file irrMath.h.

Referenced by clamp(), irr::video::SColorHSL::fromRGB(), irr::video::SColor::getLightness(), min_(), and irr::video::SColor::operator+().

template<class T >
const T& irr::core::min_ ( const T &  a,
const T &  b,
const T &  c 
) [inline]

returns minimum of three values. Own implementation to get rid of the STL (VS6 problems)

Definition at line 130 of file irrMath.h.

References min_().

template<class S , class T >
vector2d<T> irr::core::operator* ( const S  scalar,
const vector2d< T > &  vector 
)

Definition at line 329 of file vector2d.h.

template<class S , class T >
vector3d<T> irr::core::operator* ( const S  scalar,
const vector3d< T > &  vector 
)

Function multiplying a scalar and a vector component-wise.

Definition at line 452 of file vector3d.h.

template<class T >
CMatrix4<T> irr::core::operator* ( const T  scalar,
const CMatrix4< T > &  mat 
) [inline]

Definition at line 2226 of file matrix4.h.

f32 irr::core::radToDeg ( f32  radians) [inline]

Utility function to convert a radian value to degrees.

Provided as it can be clearer to write radToDeg(X) than RADTODEG * X

Parameters:
radiansThe radians value to convert to degrees.

Definition at line 89 of file irrMath.h.

References RADTODEG.

f64 irr::core::radToDeg ( f64  radians) [inline]

Utility function to convert a radian value to degrees.

Provided as it can be clearer to write radToDeg(X) than RADTODEG * X

Parameters:
radiansThe radians value to convert to degrees.

Definition at line 98 of file irrMath.h.

References RADTODEG64.

REALINLINE f64 irr::core::reciprocal ( const f64  f)

Definition at line 568 of file irrMath.h.

REALINLINE f32 irr::core::reciprocal_approxim ( const f32  f)

Definition at line 575 of file irrMath.h.

REALINLINE f32 irr::core::reciprocal_squareroot ( const f32  f)

Definition at line 503 of file irrMath.h.

REALINLINE s32 irr::core::reciprocal_squareroot ( const s32  x)

Definition at line 529 of file irrMath.h.

References reciprocal_squareroot().

f32 irr::core::round_ ( f32  x) [inline]

Definition at line 449 of file irrMath.h.

Referenced by round32().

s32 irr::core::s32_clamp ( s32  value,
s32  low,
s32  high 
) [inline]

Definition at line 319 of file irrMath.h.

References s32_max(), and s32_min().

s32 irr::core::s32_max ( s32  a,
s32  b 
) [inline]

Definition at line 313 of file irrMath.h.

Referenced by s32_clamp().

s32 irr::core::s32_min ( s32  a,
s32  b 
) [inline]

Definition at line 307 of file irrMath.h.

Referenced by s32_clamp().

REALINLINE void irr::core::setbit_cond ( u32 &  state,
s32  condition,
u32  mask 
)

Definition at line 442 of file irrMath.h.

REALINLINE f64 irr::core::squareroot ( const f64  f)

Definition at line 477 of file irrMath.h.

REALINLINE s32 irr::core::squareroot ( const s32  f)

Definition at line 483 of file irrMath.h.

References squareroot().

REALINLINE s64 irr::core::squareroot ( const s64  f)

Definition at line 490 of file irrMath.h.

References squareroot().

f32 irr::core::strtof10 ( const char *  in,
const char **  out = 0 
) [inline]

Converts a sequence of digits into a whole positive floating point value.

Only digits 0 to 9 are parsed. Parsing stops at any other character, including sign characters or a decimal point.

Parameters:
in,:the sequence of digits to convert.
out,:(optional) will be set to point at the first non-converted character.
Returns:
The whole positive floating point representation of the digit sequence.

Definition at line 258 of file fast_atof.h.

References FLT_MAX.

Referenced by fast_atof_move().

s32 irr::core::strtol10 ( const char *  in,
const char **  out = 0 
) [inline]

Convert a simple string of base 10 digits into a signed 32 bit integer.

Parameters:
[in]in,:The string of digits to convert. Only a leading - or + followed by digits 0 to 9 will be considered. Parsing stops at the first non-digit.
[out]out,:(optional) If provided, it will be set to point at the first character not used in the calculation.
Returns:
The signed integer value of the digits. If the string specifies too many digits to encode in an s32 then +INT_MAX or -INT_MAX will be returned.

Definition at line 89 of file fast_atof.h.

References strtoul10().

Referenced by fast_atof_move().

u32 irr::core::strtoul10 ( const char *  in,
const char **  out = 0 
) [inline]

Convert a simple string of base 10 digits into an unsigned 32 bit integer.

Parameters:
[in]in,:The string of digits to convert. No leading chars are allowed, only digits 0 to 9. Parsing stops at the first non-digit.
[out]out,:(optional) If provided, it will be set to point at the first character not used in the calculation.
Returns:
The unsigned integer value of the digits. If the string specifies too many digits to encode in an u32 then INT_MAX will be returned.

Definition at line 49 of file fast_atof.h.

Referenced by strtol10(), and strtoul_prefix().

u32 irr::core::strtoul16 ( const char *  in,
const char **  out = 0 
) [inline]

Convert a simple string of base 16 digits into an unsigned 32 bit integer.

Parameters:
[in]in,:The string of digits to convert. No leading chars are allowed, only digits 0 to 9 and chars A-F,a-f are allowed. Parsing stops at the first illegal char.
[out]out,:(optional) If provided, it will be set to point at the first character not used in the calculation.
Returns:
The unsigned integer value of the digits. If the string specifies too many digits to encode in an u32 then INT_MAX will be returned.

Definition at line 146 of file fast_atof.h.

Referenced by strtoul_prefix().

u32 irr::core::strtoul8 ( const char *  in,
const char **  out = 0 
) [inline]

Convert a simple string of base 8 digits into an unsigned 32 bit integer.

Parameters:
[in]inThe string of digits to convert. No leading chars are allowed, only digits 0 to 7 are allowed. Parsing stops at the first illegal char.
[out]out(optional) If provided, it will be set to point at the first character not used in the calculation.
Returns:
The unsigned integer value of the digits. If the string specifies too many digits to encode in an u32 then INT_MAX will be returned.

Definition at line 193 of file fast_atof.h.

Referenced by strtoul_prefix().

u32 irr::core::strtoul_prefix ( const char *  in,
const char **  out = 0 
) [inline]

Convert a C-style prefixed string (hex, oct, integer) into an unsigned 32 bit integer.

Parameters:
[in]inThe string of digits to convert. If string starts with 0x the hex parser is used, if only leading 0 is used, oct parser is used. In all other cases, the usual unsigned parser is used.
[out]out(optional) If provided, it will be set to point at the first character not used in the calculation.
Returns:
The unsigned integer value of the digits. If the string specifies too many digits to encode in an u32 then INT_MAX will be returned.

Definition at line 236 of file fast_atof.h.

References strtoul10(), strtoul16(), and strtoul8().

template<class T1 , class T2 >
void irr::core::swap ( T1 &  a,
T2 &  b 
) [inline]

swaps the content of the passed parameters

Definition at line 177 of file irrMath.h.


Variable Documentation

const f32 irr::core::DEGTORAD = PI / 180.0f

32bit Constant for converting from degrees to radians

Definition at line 74 of file irrMath.h.

Referenced by degToRad(), irr::core::CMatrix4< T >::setInverseRotationDegrees(), and irr::core::CMatrix4< T >::setRotationDegrees().

const float irr::core::fast_atof_table[17]
Initial value:
 {
    0.f,
    0.1f,
    0.01f,
    0.001f,
    0.0001f,
    0.00001f,
    0.000001f,
    0.0000001f,
    0.00000001f,
    0.000000001f,
    0.0000000001f,
    0.00000000001f,
    0.000000000001f,
    0.0000000000001f,
    0.00000000000001f,
    0.000000000000001f,
    0.0000000000000001f
}

Definition at line 21 of file fast_atof.h.

Referenced by fast_atof_move().

const f32 irr::core::HALF_PI = PI/2.0f

Constant for half of PI.

Definition at line 62 of file irrMath.h.

Selection of characters which count as decimal point in fast_atof.

Referenced by fast_atof_move().

const f32 irr::core::PI = 3.14159265359f

Constant for PI.

Definition at line 56 of file irrMath.h.

Referenced by irr::scene::quake3::SModifierFunction::evaluate(), and irr::scene::quake3::getMD3Normal().

const f64 irr::core::PI64 = 3.1415926535897932384626433832795028841971693993751

Constant for 64bit PI.

Definition at line 68 of file irrMath.h.

Referenced by irr::core::quaternion::toEuler().

const f32 irr::core::RADTODEG = 180.0f / PI

32bit constant for converting from radians to degrees (formally known as GRAD_PI)

Definition at line 77 of file irrMath.h.

Referenced by radToDeg().

const f32 irr::core::RECIPROCAL_PI = 1.0f/PI

Constant for reciprocal of PI.

Definition at line 59 of file irrMath.h.

Constant for 64bit reciprocal of PI.

Definition at line 71 of file irrMath.h.

const f64 irr::core::ROUNDING_ERROR_f64 = 0.00000001

Definition at line 50 of file irrMath.h.

Referenced by irr::core::plane3d< f32 >::getIntersectionWithPlane().

Rounding error constant often used when comparing f32 values.

Definition at line 45 of file irrMath.h.

Definition at line 47 of file irrMath.h.