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

class  aabbox3d
 Axis aligned bounding box in 3d dimensional space. More...
 
class  array
 Self reallocating template array (like stl vector) with additional features. More...
 
class  CMatrix4
 4x4 matrix. Mostly used as transformation matrix for 3d calculations. More...
 
class  dimension2d
 Specifies a 2 dimensional size. More...
 
union  FloatIntUnion32
 
union  inttofloat
 
class  irrAllocator
 Very simple allocator implementation, containers using it can be used across dll boundaries. More...
 
class  irrAllocatorFast
 Fast allocator, only to be used in containers inside the same memory heap. More...
 
class  line2d
 2D line between two points with intersection methods. More...
 
class  line3d
 3D line between two points with intersection methods. More...
 
class  list
 Doubly linked list template. More...
 
class  map
 map template for associative arrays using a red-black tree More...
 
class  plane3d
 Template plane class with some intersection testing methods. More...
 
class  quaternion
 Quaternion class for representing rotations. More...
 
class  rect
 Rectangle template. More...
 
class  string
 Very simple string class with some useful features. More...
 
class  triangle3d
 3d triangle template class for doing collision detection and other things. More...
 
class  vector2d
 2d vector template class with lots of operators and methods. More...
 
class  vector3d
 3d vector template class with lots of operators and methods. More...
 

Typedefs

typedef aabbox3d< f32aabbox3df
 Typedef for a f32 3d bounding box. More...
 
typedef aabbox3d< s32aabbox3di
 Typedef for an integer 3d bounding box. More...
 
typedef dimension2d< f32dimension2df
 Typedef for an f32 dimension. More...
 
typedef dimension2d< s32dimension2di
 Typedef for an integer dimension. More...
 
typedef dimension2d< u32dimension2du
 Typedef for an unsigned integer dimension. More...
 
typedef line2d< f32line2df
 Typedef for an f32 line. More...
 
typedef line2d< s32line2di
 Typedef for an integer line. More...
 
typedef line3d< f32line3df
 Typedef for an f32 line. More...
 
typedef line3d< s32line3di
 Typedef for an integer line. More...
 
typedef CMatrix4< f32matrix4
 Typedef for f32 matrix. More...
 
typedef plane3d< f32plane3df
 Typedef for a f32 3d plane. More...
 
typedef plane3d< s32plane3di
 Typedef for an integer 3d plane. More...
 
typedef vector2d< f32position2df
 
typedef vector2d< s32position2di
 
typedef rect< f32rectf
 Rectangle with float values. More...
 
typedef rect< s32recti
 Rectangle with int values. More...
 
typedef string< c8stringc
 Typedef for character strings. More...
 
typedef string< wchar_t > stringw
 Typedef for wide character strings. More...
 
typedef triangle3d< f32triangle3df
 Typedef for a f32 3d triangle. More...
 
typedef triangle3d< s32triangle3di
 Typedef for an integer 3d triangle. More...
 
typedef vector2d< f32vector2df
 Typedef for f32 2d vector. More...
 
typedef vector2d< s32vector2di
 Typedef for integer 2d vector. More...
 
typedef vector3d< f32vector3df
 Typedef for a f32 3d vector. More...
 
typedef vector3d< s32vector3di
 Typedef for an integer 3d vector. More...
 

Enumerations

enum  eAllocStrategy { ALLOC_STRATEGY_SAFE = 0, ALLOC_STRATEGY_DOUBLE = 1, ALLOC_STRATEGY_SQRT = 2 }
 defines an allocation strategy (used only by irr::array so far) More...
 
enum  EIntersectionRelation3D {
  ISREL3D_FRONT = 0, ISREL3D_BACK, ISREL3D_PLANAR, ISREL3D_SPANNING,
  ISREL3D_CLIPPED
}
 Enumeration for intersection relations of 3d objects. More...
 
enum  eLocaleID { IRR_LOCALE_ANSI = 0, IRR_LOCALE_GERMAN = 1 }
 

Functions

template<class T >
abs_ (const T &a)
 returns abs of two values. Own implementation to get rid of STL (VS6 problems) More...
 
REALINLINE s32 ceil32 (f32 x)
 
template<class T >
const T clamp (const T &value, const T &low, const T &high)
 clamps a value between low and high More...
 
REALINLINE void clearFPUException ()
 
u32 ctoul16 (char in)
 Convert a hex-encoded character to an unsigned integer. More...
 
io::pathcutFilenameExtension (io::path &dest, const io::path &source)
 cut the filename extension from a source file path and store it in a dest file path More...
 
f32 degToRad (f32 degrees)
 Utility function to convert a degrees value to radians. More...
 
f64 degToRad (f64 degrees)
 Utility function to convert a degrees value to radians. More...
 
io::pathdeletePathFromFilename (io::path &filename)
 delete path from filename More...
 
io::pathdeletePathFromPath (io::path &filename, s32 pathCount)
 trim paths More...
 
template<class T >
bool equals (const T a, const T b, const T tolerance=roundingError< T >())
 returns if a equals b, taking possible rounding errors into account More...
 
bool equalsByUlp (f32 a, f32 b, int maxUlpDiff)
 We compare the difference in ULP's (spacing between floating-point numbers, aka ULP=1 means there exists no float between). More...
 
template<class T >
bool equalsRelative (const T a, const T b, const T factor=relativeErrorFactor< T >())
 
f32 f32_max3 (const f32 a, const f32 b, const f32 c)
 
f32 f32_min3 (const f32 a, const f32 b, const f32 c)
 
float fast_atof (const char *floatAsString, const char **out=0)
 Convert a string to a floating point number. More...
 
const char * fast_atof_move (const char *in, f32 &result)
 Provides a fast function for converting a string into a float. More...
 
REALINLINE s32 floor32 (f32 x)
 
f32 FR (u32 x)
 Floating-point representation of an integer value. More...
 
f32 FR (s32 x)
 
f32 fract (f32 x)
 
io::pathgetFileNameExtension (io::path &dest, const io::path &source)
 get the filename extension from a file path More...
 
bool hasFileExtension (const io::path &filename, const io::path &ext0, const io::path &ext1="", const io::path &ext2="")
 search if a filename has a proper extension More...
 
template<class T >
void heapsink (T *array, s32 element, s32 max)
 Sinks an element into the heap. More...
 
template<class T >
void heapsort (T *array_, s32 size)
 Sorts an array with size 'size' using heapsort. More...
 
REALINLINE u32 if_c_a_else_0 (const s32 condition, const u32 a)
 conditional set based on mask and arithmetic shift More...
 
REALINLINE u32 if_c_a_else_b (const s32 condition, const u32 a, const u32 b)
 conditional set based on mask and arithmetic shift More...
 
REALINLINE u16 if_c_a_else_b (const s16 condition, const u16 a, const u16 b)
 conditional set based on mask and arithmetic shift More...
 
u32 IR (f32 x)
 
s32 isdigit (s32 c)
 some standard function ( to remove dependencies ) More...
 
s32 isFileExtension (const io::path &filename, const io::path &ext0, const io::path &ext1, const io::path &ext2)
 search if a filename has a proper extension More...
 
s32 isInSameDirectory (const io::path &path, const io::path &file)
 
bool isnotzero (const f32 a, const f32 tolerance=ROUNDING_ERROR_f32)
 returns if a equals not zero, taking rounding errors into account More...
 
s32 isspace (s32 c)
 
s32 isupper (s32 c)
 
bool iszero (const f64 a, const f64 tolerance=ROUNDING_ERROR_f64)
 returns if a equals zero, taking rounding errors into account More...
 
bool iszero (const f32 a, const f32 tolerance=ROUNDING_ERROR_f32)
 returns if a equals zero, taking rounding errors into account More...
 
bool iszero (const s32 a, const s32 tolerance=0)
 returns if a equals zero, taking rounding errors into account More...
 
bool iszero (const u32 a, const u32 tolerance=0)
 returns if a equals zero, taking rounding errors into account More...
 
bool iszero (const s64 a, const s64 tolerance=0)
 returns if a equals zero, taking rounding errors into account More...
 
template<class T >
lerp (const T &a, const T &b, const f32 t)
 
template<class T >
const T & max_ (const T &a, const T &b)
 returns maximum of two values. Own implementation to get rid of the STL (VS6 problems) More...
 
template<class T >
const T & 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) More...
 
template<class T >
const T & min_ (const T &a, const T &b)
 returns minimum of two values. Own implementation to get rid of the STL (VS6 problems) More...
 
template<class T >
const T & 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) More...
 
template<class S , class T >
vector2d< T > operator * (const S scalar, const vector2d< T > &vector)
 
template<class S , class T >
vector3d< T > operator * (const S scalar, const vector3d< T > &vector)
 Function multiplying a scalar and a vector component-wise. More...
 
template<class T >
CMatrix4< T > operator * (const T scalar, const CMatrix4< T > &mat)
 
f32 radToDeg (f32 radians)
 Utility function to convert a radian value to degrees. More...
 
f64 radToDeg (f64 radians)
 Utility function to convert a radian value to degrees. More...
 
REALINLINE f32 reciprocal (const f32 f)
 
REALINLINE f64 reciprocal (const f64 f)
 
REALINLINE f32 reciprocal_approxim (const f32 f)
 
REALINLINE f64 reciprocal_squareroot (const f64 x)
 
REALINLINE f32 reciprocal_squareroot (const f32 f)
 
REALINLINE s32 reciprocal_squareroot (const s32 x)
 
template<class T >
relativeErrorFactor ()
 
template<>
f32 relativeErrorFactor ()
 
template<>
f64 relativeErrorFactor ()
 
REALINLINE s32 round32 (f32 x)
 
f32 round_ (f32 x)
 
template<class T >
roundingError ()
 
template<>
f32 roundingError ()
 
template<>
f64 roundingError ()
 
template<>
s32 roundingError ()
 
template<>
u32 roundingError ()
 
template<>
s64 roundingError ()
 
template<>
u64 roundingError ()
 
s32 s32_clamp (s32 value, s32 low, s32 high)
 
s32 s32_max (s32 a, s32 b)
 
s32 s32_min (s32 a, s32 b)
 
REALINLINE void setbit_cond (u32 &state, s32 condition, u32 mask)
 
REALINLINE f32 squareroot (const f32 f)
 
REALINLINE f64 squareroot (const f64 f)
 
REALINLINE s32 squareroot (const s32 f)
 
REALINLINE s64 squareroot (const s64 f)
 
f32 strtof10 (const char *in, const char **out=0)
 Converts a sequence of digits into a whole positive floating point value. More...
 
s32 strtol10 (const char *in, const char **out=0)
 Convert a simple string of base 10 digits into a signed 32 bit integer. More...
 
u32 strtoul10 (const char *in, const char **out=0)
 Convert a simple string of base 10 digits into an unsigned 32 bit integer. More...
 
u32 strtoul16 (const char *in, const char **out=0)
 Convert a simple string of base 16 digits into an unsigned 32 bit integer. More...
 
u32 strtoul8 (const char *in, const char **out=0)
 Convert a simple string of base 8 digits into an unsigned 32 bit integer. More...
 
u32 strtoul_prefix (const char *in, const char **out=0)
 Convert a C-style prefixed string (hex, oct, integer) into an unsigned 32 bit integer. More...
 
template<class T1 , class T2 >
void swap (T1 &a, T2 &b)
 swaps the content of the passed parameters More...
 
IRRLICHT_API void utf8ToWchar (const char *in, wchar_t *out, const u64 len)
 Convert this utf-8-encoded string to the platform's wchar. More...
 
IRRLICHT_API void wcharToUtf8 (const wchar_t *in, char *out, const u64 len)
 Convert this wchar string to utf-8. More...
 

Variables

const f32 DEGTORAD = PI / 180.0f
 32bit Constant for converting from degrees to radians More...
 
const f64 DEGTORAD64 = PI64 / 180.0
 64bit constant for converting from degrees to radians (formally known as GRAD_PI2) More...
 
const float fast_atof_table [17]
 
const f32 HALF_PI = PI/2.0f
 Constant for half of PI. More...
 
IRRLICHT_API const matrix4 IdentityMatrix
 global const identity matrix More...
 
IRRLICHT_API irr::core::stringc LOCALE_DECIMAL_POINTS
 Selection of characters which count as decimal point in fast_atof. More...
 
const f32 PI = 3.14159265359f
 Constant for PI. More...
 
const f64 PI64 = 3.1415926535897932384626433832795028841971693993751
 Constant for 64bit PI. More...
 
const f32 RADTODEG = 180.0f / PI
 32bit constant for converting from radians to degrees (formally known as GRAD_PI) More...
 
const f64 RADTODEG64 = 180.0 / PI64
 64bit constant for converting from radians to degrees More...
 
const f32 RECIPROCAL_PI = 1.0f/PI
 Constant for reciprocal of PI. More...
 
const f64 RECIPROCAL_PI64 = 1.0/PI64
 Constant for 64bit reciprocal of PI. More...
 
const f32 ROUNDING_ERROR_f32 = 0.000001f
 
const f64 ROUNDING_ERROR_f64 = 0.00000001
 
const s32 ROUNDING_ERROR_S32 = 0
 Rounding error constant often used when comparing f32 values. More...
 
const s64 ROUNDING_ERROR_S64 = 0
 

Detailed Description

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

Typedef Documentation

◆ aabbox3df

Typedef for a f32 3d bounding box.

Definition at line 361 of file aabbox3d.h.

◆ aabbox3di

Typedef for an integer 3d bounding box.

Definition at line 363 of file aabbox3d.h.

◆ dimension2df

Typedef for an f32 dimension.

Definition at line 210 of file dimension2d.h.

◆ dimension2di

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.

◆ dimension2du

Typedef for an unsigned integer dimension.

Definition at line 212 of file dimension2d.h.

◆ line2df

Typedef for an f32 line.

Definition at line 352 of file line2d.h.

◆ line2di

Typedef for an integer line.

Definition at line 354 of file line2d.h.

◆ line3df

Typedef for an f32 line.

Definition at line 136 of file line3d.h.

◆ line3di

Typedef for an integer line.

Definition at line 138 of file line3d.h.

◆ matrix4

Typedef for f32 matrix.

Definition at line 2377 of file matrix4.h.

◆ plane3df

Typedef for a f32 3d plane.

Definition at line 236 of file plane3d.h.

◆ plane3di

Typedef for an integer 3d plane.

Definition at line 239 of file plane3d.h.

◆ position2df

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

Definition at line 21 of file position2d.h.

◆ position2di

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

Definition at line 24 of file position2d.h.

◆ rectf

Rectangle with float values.

Definition at line 276 of file rect.h.

◆ recti

Rectangle with int values.

Definition at line 278 of file rect.h.

◆ stringc

Typedef for character strings.

Definition at line 1458 of file irrString.h.

◆ stringw

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

Typedef for wide character strings.

Definition at line 1461 of file irrString.h.

◆ triangle3df

Typedef for a f32 3d triangle.

Definition at line 270 of file triangle3d.h.

◆ triangle3di

Typedef for an integer 3d triangle.

Definition at line 273 of file triangle3d.h.

◆ vector2df

Typedef for f32 2d vector.

Definition at line 389 of file vector2d.h.

◆ vector2di

Typedef for integer 2d vector.

Definition at line 392 of file vector2d.h.

◆ vector3df

Typedef for a f32 3d vector.

Definition at line 447 of file vector3d.h.

◆ vector3di

Typedef for an integer 3d vector.

Definition at line 450 of file vector3d.h.

Enumeration Type Documentation

◆ eAllocStrategy

defines an allocation strategy (used only by irr::array so far)

Enumerator
ALLOC_STRATEGY_SAFE 
ALLOC_STRATEGY_DOUBLE 
ALLOC_STRATEGY_SQRT 

Definition at line 112 of file irrAllocator.h.

◆ EIntersectionRelation3D

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.

◆ eLocaleID

Enumerator
IRR_LOCALE_ANSI 
IRR_LOCALE_GERMAN 

Definition at line 41 of file irrString.h.

Function Documentation

◆ abs_()

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 152 of file irrMath.h.

Referenced by equalsByUlp().

◆ ceil32()

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

Definition at line 685 of file irrMath.h.

Referenced by irr::video::IImage::getDataSizeFromFormat().

◆ clamp()

◆ clearFPUException()

REALINLINE void irr::core::clearFPUException ( )

Definition at line 491 of file irrMath.h.

◆ ctoul16()

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 126 of file fast_atof.h.

◆ cutFilenameExtension()

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 48 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().

◆ degToRad() [1/2]

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 108 of file irrMath.h.

References DEGTORAD.

◆ degToRad() [2/2]

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 117 of file irrMath.h.

References DEGTORAD64.

◆ deletePathFromFilename()

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

delete path from filename

Definition at line 67 of file coreutil.h.

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

◆ deletePathFromPath()

io::path& irr::core::deletePathFromPath ( io::path filename,
s32  pathCount 
)
inline

◆ equals()

◆ equalsByUlp()

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 278 of file irrMath.h.

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

◆ equalsRelative()

template<class T >
bool irr::core::equalsRelative ( const T  a,
const T  b,
const T  factor = relativeErrorFactor<T>() 
)
inline

returns if a equals b, taking relative error in form of factor this particular function does not involve any division.

Definition at line 255 of file irrMath.h.

References max_(), and min_().

Referenced by irr::core::vector2d< f32 >::nearlyParallel().

◆ f32_max3()

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

Definition at line 745 of file irrMath.h.

◆ f32_min3()

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

Definition at line 750 of file irrMath.h.

◆ fast_atof()

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 360 of file fast_atof.h.

References fast_atof_move().

◆ 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 310 of file fast_atof.h.

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

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

◆ floor32()

◆ FR() [1/2]

f32 irr::core::FR ( u32  x)
inline

Floating-point representation of an integer value.

Definition at line 400 of file irrMath.h.

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

Referenced by irr::video::pack_textureBlendFunc(), and irr::video::pack_textureBlendFuncSeparate().

◆ FR() [2/2]

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

Definition at line 401 of file irrMath.h.

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

◆ fract()

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

Definition at line 755 of file irrMath.h.

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

◆ getFileNameExtension()

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

get the filename extension from a file path

Definition at line 56 of file coreutil.h.

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

◆ hasFileExtension()

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 41 of file coreutil.h.

References isFileExtension().

◆ heapsink()

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().

◆ 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< u16 >::sort().

◆ if_c_a_else_0()

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 470 of file irrMath.h.

◆ if_c_a_else_b() [1/2]

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 458 of file irrMath.h.

◆ if_c_a_else_b() [2/2]

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 464 of file irrMath.h.

◆ IR()

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

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

Definition at line 390 of file irrMath.h.

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

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

◆ isdigit()

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

some standard function ( to remove dependencies )

Definition at line 199 of file coreutil.h.

Referenced by irr::core::string< fschar_t >::eraseTrailingFloatZeros().

◆ isFileExtension()

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().

◆ isInSameDirectory()

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 114 of file coreutil.h.

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

◆ isnotzero()

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 319 of file irrMath.h.

◆ isspace()

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

Definition at line 200 of file coreutil.h.

◆ isupper()

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

Definition at line 201 of file coreutil.h.

◆ iszero() [1/5]

◆ iszero() [2/5]

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 313 of file irrMath.h.

◆ iszero() [3/5]

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 325 of file irrMath.h.

◆ iszero() [4/5]

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 331 of file irrMath.h.

◆ iszero() [5/5]

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 338 of file irrMath.h.

◆ lerp()

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 160 of file irrMath.h.

◆ max_() [1/2]

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 138 of file irrMath.h.

Referenced by clamp(), equalsRelative(), irr::video::SColorHSL::fromRGB(), irr::video::SColor::getLightness(), irr::core::aabbox3d< f32 >::intersect(), and max_().

◆ max_() [2/2]

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 145 of file irrMath.h.

References max_().

◆ min_() [1/2]

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 124 of file irrMath.h.

Referenced by clamp(), equalsRelative(), irr::video::SColorHSL::fromRGB(), irr::video::SColor::getLightness(), irr::core::aabbox3d< f32 >::intersect(), min_(), and irr::video::SColor::operator+().

◆ min_() [2/2]

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 131 of file irrMath.h.

References min_().

◆ operator *() [1/3]

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

Definition at line 395 of file vector2d.h.

◆ operator *() [2/3]

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 454 of file vector3d.h.

◆ operator *() [3/3]

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

Definition at line 2370 of file matrix4.h.

◆ radToDeg() [1/2]

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 90 of file irrMath.h.

References RADTODEG.

◆ radToDeg() [2/2]

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 99 of file irrMath.h.

References RADTODEG64.

◆ reciprocal() [1/2]

◆ reciprocal() [2/2]

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

Definition at line 605 of file irrMath.h.

◆ reciprocal_approxim()

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

Definition at line 612 of file irrMath.h.

◆ reciprocal_squareroot() [1/3]

◆ reciprocal_squareroot() [2/3]

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

Definition at line 538 of file irrMath.h.

◆ reciprocal_squareroot() [3/3]

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

Definition at line 564 of file irrMath.h.

References reciprocal_squareroot().

◆ relativeErrorFactor() [1/3]

template<class T >
T irr::core::relativeErrorFactor ( )
inline

Definition at line 227 of file irrMath.h.

◆ relativeErrorFactor() [2/3]

template<>
f32 irr::core::relativeErrorFactor ( )
inline

Definition at line 233 of file irrMath.h.

◆ relativeErrorFactor() [3/3]

template<>
f64 irr::core::relativeErrorFactor ( )
inline

Definition at line 239 of file irrMath.h.

◆ round32()

◆ round_()

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

Definition at line 486 of file irrMath.h.

Referenced by round32().

◆ roundingError() [1/7]

template<class T >
T irr::core::roundingError ( )
inline

◆ roundingError() [2/7]

template<>
f32 irr::core::roundingError ( )
inline

Definition at line 189 of file irrMath.h.

References ROUNDING_ERROR_f32.

◆ roundingError() [3/7]

template<>
f64 irr::core::roundingError ( )
inline

Definition at line 195 of file irrMath.h.

References ROUNDING_ERROR_f64.

◆ roundingError() [4/7]

template<>
s32 irr::core::roundingError ( )
inline

Definition at line 201 of file irrMath.h.

References ROUNDING_ERROR_S32.

◆ roundingError() [5/7]

template<>
u32 irr::core::roundingError ( )
inline

Definition at line 207 of file irrMath.h.

References ROUNDING_ERROR_S32.

◆ roundingError() [6/7]

template<>
s64 irr::core::roundingError ( )
inline

Definition at line 214 of file irrMath.h.

References ROUNDING_ERROR_S64.

◆ roundingError() [7/7]

template<>
u64 irr::core::roundingError ( )
inline

Definition at line 220 of file irrMath.h.

References ROUNDING_ERROR_S64.

◆ s32_clamp()

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

Definition at line 356 of file irrMath.h.

References s32_max(), and s32_min().

◆ s32_max()

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

Definition at line 350 of file irrMath.h.

Referenced by s32_clamp().

◆ s32_min()

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

Definition at line 344 of file irrMath.h.

Referenced by s32_clamp().

◆ setbit_cond()

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

Definition at line 479 of file irrMath.h.

◆ squareroot() [1/4]

◆ squareroot() [2/4]

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

Definition at line 512 of file irrMath.h.

◆ squareroot() [3/4]

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

Definition at line 518 of file irrMath.h.

References squareroot().

◆ squareroot() [4/4]

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

Definition at line 525 of file irrMath.h.

References squareroot().

◆ strtof10()

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
inthe 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 259 of file fast_atof.h.

References FLT_MAX.

Referenced by fast_atof_move().

◆ strtol10()

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]inThe 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 90 of file fast_atof.h.

References strtoul10().

Referenced by fast_atof_move().

◆ strtoul10()

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]inThe 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 50 of file fast_atof.h.

Referenced by strtol10(), and strtoul_prefix().

◆ strtoul16()

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]inThe 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 147 of file fast_atof.h.

Referenced by strtoul_prefix().

◆ strtoul8()

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 194 of file fast_atof.h.

Referenced by strtoul_prefix().

◆ 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 237 of file fast_atof.h.

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

◆ swap()

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

swaps the content of the passed parameters

Definition at line 178 of file irrMath.h.

Referenced by irr::core::list< irr::scene::ISceneNode * >::swap(), irr::core::array< u16 >::swap(), and irr::core::map< KeyType, ValueType >::swap().

◆ utf8ToWchar()

IRRLICHT_API void irr::core::utf8ToWchar ( const char *  in,
wchar_t *  out,
const u64  len 
)

Convert this utf-8-encoded string to the platform's wchar.

The resulting string is always NULL-terminated and well-formed.

Parameters
lenThe size of the output buffer in bytes.

◆ wcharToUtf8()

IRRLICHT_API void irr::core::wcharToUtf8 ( const wchar_t *  in,
char *  out,
const u64  len 
)

Convert this wchar string to utf-8.

The resulting string is always NULL-terminated and well-formed.

Parameters
lenThe size of the output buffer in bytes.

Variable Documentation

◆ DEGTORAD

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

32bit Constant for converting from degrees to radians

Definition at line 75 of file irrMath.h.

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

◆ DEGTORAD64

const f64 irr::core::DEGTORAD64 = PI64 / 180.0

◆ fast_atof_table

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 22 of file fast_atof.h.

Referenced by fast_atof_move().

◆ HALF_PI

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

Constant for half of PI.

Definition at line 63 of file irrMath.h.

◆ IdentityMatrix

IRRLICHT_API const matrix4 irr::core::IdentityMatrix

◆ LOCALE_DECIMAL_POINTS

IRRLICHT_API irr::core::stringc irr::core::LOCALE_DECIMAL_POINTS

Selection of characters which count as decimal point in fast_atof.

Referenced by fast_atof_move().

◆ PI

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

Constant for PI.

Definition at line 57 of file irrMath.h.

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

◆ PI64

const f64 irr::core::PI64 = 3.1415926535897932384626433832795028841971693993751

Constant for 64bit PI.

Definition at line 69 of file irrMath.h.

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

◆ RADTODEG

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

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

Definition at line 78 of file irrMath.h.

Referenced by radToDeg().

◆ RADTODEG64

◆ RECIPROCAL_PI

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

Constant for reciprocal of PI.

Definition at line 60 of file irrMath.h.

◆ RECIPROCAL_PI64

const f64 irr::core::RECIPROCAL_PI64 = 1.0/PI64

Constant for 64bit reciprocal of PI.

Definition at line 72 of file irrMath.h.

◆ ROUNDING_ERROR_f32

◆ ROUNDING_ERROR_f64

const f64 irr::core::ROUNDING_ERROR_f64 = 0.00000001

Definition at line 51 of file irrMath.h.

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

◆ ROUNDING_ERROR_S32

const s32 irr::core::ROUNDING_ERROR_S32 = 0

Rounding error constant often used when comparing f32 values.

Definition at line 45 of file irrMath.h.

Referenced by roundingError().

◆ ROUNDING_ERROR_S64

const s64 irr::core::ROUNDING_ERROR_S64 = 0

Definition at line 48 of file irrMath.h.

Referenced by roundingError().