Saga3D API Documentation  1.0-RC4
saga::core Namespace Reference

typedef for Function Pointer More...

Classes

class  aabbox3d
 Axis aligned bounding box in 3d dimensional space. More...
 
union  FloatIntUnion32
 
union  inttofloat
 
class  line2d
 2D line between two points with intersection methods. More...
 
class  line3d
 3D line between two points with intersection methods. More...
 
class  plane3d
 Template plane class with some intersection testing methods. More...
 
class  rect
 Rectangle template. More...
 
class  triangle3d
 3d triangle template class for doing collision detection and other things. More...
 

Typedefs

typedef aabbox3d< float > aabbox3df
 Typedef for a float 3d bounding box. More...
 
typedef aabbox3d< std::int32_t > aabbox3di
 Typedef for an integer 3d bounding box. More...
 
typedef line2d< float > line2df
 Typedef for an float line. More...
 
typedef line2d< std::int32_t > line2di
 Typedef for an integer line. More...
 
typedef line3d< float > line3df
 Typedef for an float line. More...
 
typedef line3d< std::int32_t > line3di
 Typedef for an integer line. More...
 
typedef plane3d< float > plane3df
 Typedef for a float 3d plane. More...
 
typedef plane3d< std::int32_t > plane3di
 Typedef for an integer 3d plane. More...
 
typedef rect< float > rectf
 Rectangle with float values. More...
 
typedef rect< std::int32_t > recti
 Rectangle with int values. More...
 
typedef triangle3d< float > triangle3df
 Typedef for a float 3d triangle. More...
 
typedef triangle3d< std::int32_t > triangle3di
 Typedef for an integer 3d triangle. More...
 

Enumerations

enum  EIntersectionRelation3D {
  ISREL3D_FRONT = 0, ISREL3D_BACK, ISREL3D_PLANAR, ISREL3D_SPANNING,
  ISREL3D_CLIPPED
}
 Enumeration for intersection relations of 3d objects. More...
 

Functions

template<typename E >
constexpr auto enumToPOD (E e) noexcept
 
std::uint32_t strtoul10 (const char *in, const char **out=0)
 Convert a simple string of base 10 digits into an unsigned 32 bit integer. More...
 
std::int32_t strtol10 (const char *in, const char **out=0)
 Convert a simple string of base 10 digits into a signed 32 bit integer. More...
 
std::uint32_t ctoul16 (char in)
 Convert a hex-encoded character to an unsigned integer. More...
 
std::uint32_t strtoul16 (const char *in, const char **out=0)
 Convert a simple string of base 16 digits into an unsigned 32 bit integer. More...
 
std::uint32_t strtoul8 (const char *in, const char **out=0)
 Convert a simple string of base 8 digits into an unsigned 32 bit integer. More...
 
std::uint32_t 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...
 
float strtof10 (const char *in, const char **out=0)
 Converts a sequence of digits into a whole positive floating point value. More...
 
const char * fast_atof_move (const char *in, float &result)
 Provides a fast function for converting a string into a float. More...
 
float fast_atof (const char *floatAsString, const char **out=0)
 Convert a string to a floating point number. More...
 
bool isBetweenPoints (const glm::vec3 &point, const glm::vec3 &begin, const glm::vec3 &end)
 
glm::vec3 getHorizontalAngle (const glm::vec3 &vec)
 
glm::vec3 rotationToDirection (const glm::vec3 &vec, const glm::vec3 &forwards={0, 0, 1})
 
float radToDeg (float radians)
 Utility function to convert a radian value to degrees. More...
 
double radToDeg (double radians)
 Utility function to convert a radian value to degrees. More...
 
float degToRad (float degrees)
 Utility function to convert a degrees value to radians. More...
 
double degToRad (double degrees)
 Utility function to convert a degrees value to radians. 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 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 >
abs_ (const T &a)
 returns abs of two values. Own implementation to get rid of STL (VS6 problems) More...
 
template<class T >
lerp (const T &a, const T &b, const float t)
 
template<class T >
const T clamp (const T &value, const T &low, const T &high)
 clamps a value between low and high More...
 
template<class T1 , class T2 >
void swap (T1 &a, T2 &b)
 swaps the content of the passed parameters More...
 
template<class T >
roundingError ()
 
template<>
float roundingError ()
 
template<class T >
relativeErrorFactor ()
 
template<>
float relativeErrorFactor ()
 
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...
 
template<class T >
bool equalsRelative (const T a, const T b, const T factor=relativeErrorFactor< T >())
 
bool equalsByUlp (float a, float 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...
 
bool iszero (const double a, const double tolerance=ROUNDING_ERROR_double)
 returns if a equals zero, taking rounding errors into account More...
 
bool iszero (const float a, const float tolerance=ROUNDING_ERROR_float)
 returns if a equals zero, taking rounding errors into account More...
 
bool isnotzero (const float a, const float tolerance=ROUNDING_ERROR_float)
 returns if a equals not zero, taking rounding errors into account More...
 
bool iszero (const std::int32_t a, const std::int32_t tolerance=0)
 returns if a equals zero, taking rounding errors into account More...
 
bool iszero (const std::uint32_t a, const std::uint32_t tolerance=0)
 returns if a equals zero, taking rounding errors into account More...
 
std::int32_t s32_min (std::int32_t a, std::int32_t b)
 
std::int32_t s32_max (std::int32_t a, std::int32_t b)
 
std::int32_t s32_clamp (std::int32_t value, std::int32_t low, std::int32_t high)
 
std::uint32_t IR (float x)
 
float FR (std::uint32_t x)
 Floating-point representation of an integer value. More...
 
float FR (std::int32_t x)
 
REALINLINE std::uint32_t if_c_a_else_b (const std::int32_t condition, const std::uint32_t a, const std::uint32_t b)
 conditional set based on mask and arithmetic shift More...
 
REALINLINE std::uint16_t if_c_a_else_b (const std::int16_t condition, const std::uint16_t a, const std::uint16_t b)
 conditional set based on mask and arithmetic shift More...
 
REALINLINE std::uint32_t if_c_a_else_0 (const std::int32_t condition, const std::uint32_t a)
 conditional set based on mask and arithmetic shift More...
 
REALINLINE void setbit_cond (std::uint32_t &state, std::int32_t condition, std::uint32_t mask)
 
float round_ (float x)
 
REALINLINE void clearFPUException ()
 
REALINLINE float squareroot (const float f)
 
REALINLINE double squareroot (const double f)
 
REALINLINE std::int32_t squareroot (const std::int32_t f)
 
REALINLINE double reciprocal_squareroot (const double x)
 
REALINLINE float reciprocal_squareroot (const float f)
 
REALINLINE std::int32_t reciprocal_squareroot (const std::int32_t x)
 
REALINLINE float reciprocal (const float f)
 
REALINLINE double reciprocal (const double f)
 
REALINLINE float reciprocal_approxim (const float f)
 
REALINLINE std::int32_t floor32 (float x)
 
REALINLINE std::int32_t ceil32 (float x)
 
REALINLINE std::int32_t round32 (float x)
 
float float_max3 (const float a, const float b, const float c)
 
float float_min3 (const float a, const float b, const float c)
 
float fract (float x)
 

Variables

std::string LOCALE_DECIMAL_POINTS
 Selection of characters which count as decimal point in fast_atof. More...
 
const float fast_atof_table [17]
 
const std::int32_t ROUNDING_ERROR_S32 = 0
 Rounding error constant often used when comparing float values. More...
 
const float ROUNDING_ERROR_float = 0.000001f
 
const double ROUNDING_ERROR_double = 0.00000001
 
const float PI = 3.14159265359f
 Constant for PI. More...
 
const float RECIPROCAL_PI = 1.0f/PI
 Constant for reciprocal of PI. More...
 
const float HALF_PI = PI/2.0f
 Constant for half of PI. More...
 
const double PI64 = 3.1415926535897932384626433832795028841971693993751
 Constant for 64bit PI. More...
 
const double RECIPROCAL_PI64 = 1.0/PI64
 Constant for 64bit reciprocal of PI. More...
 
const float DEGTORAD = PI / 180.0f
 32bit Constant for converting from degrees to radians More...
 
const float RADTODEG = 180.0f / PI
 32bit constant for converting from radians to degrees (formally known as GRAD_PI) More...
 
const double DEGTORAD64 = PI64 / 180.0
 64bit constant for converting from degrees to radians (formally known as GRAD_PI2) More...
 
const double RADTODEG64 = 180.0 / PI64
 64bit constant for converting from radians to degrees More...
 

Detailed Description

typedef for Function Pointer

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

Typedef Documentation

◆ aabbox3df

Typedef for a float 3d bounding box.

Definition at line 350 of file aabbox3d.h.

◆ aabbox3di

typedef aabbox3d<std::int32_t> saga::core::aabbox3di

Typedef for an integer 3d bounding box.

Definition at line 352 of file aabbox3d.h.

◆ line2df

typedef line2d<float> saga::core::line2df

Typedef for an float line.

Definition at line 351 of file line2d.h.

◆ line2di

typedef line2d<std::int32_t> saga::core::line2di

Typedef for an integer line.

Definition at line 353 of file line2d.h.

◆ line3df

typedef line3d<float> saga::core::line3df

Typedef for an float line.

Definition at line 135 of file line3d.h.

◆ line3di

typedef line3d<std::int32_t> saga::core::line3di

Typedef for an integer line.

Definition at line 137 of file line3d.h.

◆ plane3df

typedef plane3d<float> saga::core::plane3df

Typedef for a float 3d plane.

Definition at line 249 of file plane3d.h.

◆ plane3di

typedef plane3d<std::int32_t> saga::core::plane3di

Typedef for an integer 3d plane.

Definition at line 252 of file plane3d.h.

◆ rectf

typedef rect<float> saga::core::rectf

Rectangle with float values.

Definition at line 274 of file rect.h.

◆ recti

typedef rect<std::int32_t> saga::core::recti

Rectangle with int values.

Definition at line 276 of file rect.h.

◆ triangle3df

Typedef for a float 3d triangle.

Definition at line 270 of file triangle3d.h.

◆ triangle3di

typedef triangle3d<std::int32_t> saga::core::triangle3di

Typedef for an integer 3d triangle.

Definition at line 273 of file triangle3d.h.

Enumeration Type Documentation

◆ EIntersectionRelation3D

Enumeration for intersection relations of 3d objects.

Enumerator
ISREL3D_FRONT 
ISREL3D_BACK 
ISREL3D_PLANAR 
ISREL3D_SPANNING 
ISREL3D_CLIPPED 

Definition at line 18 of file plane3d.h.

Function Documentation

◆ abs_()

template<class T >
T saga::core::abs_ ( const T &  a)
inline

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

Definition at line 191 of file irrMath.h.

◆ ceil32()

REALINLINE std::int32_t saga::core::ceil32 ( float  x)

Definition at line 724 of file irrMath.h.

◆ clamp()

template<class T >
const T saga::core::clamp ( const T &  value,
const T &  low,
const T &  high 
)
inline

clamps a value between low and high

Definition at line 206 of file irrMath.h.

◆ clearFPUException()

REALINLINE void saga::core::clearFPUException ( )

Definition at line 530 of file irrMath.h.

◆ ctoul16()

std::uint32_t saga::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.

◆ degToRad() [1/2]

double saga::core::degToRad ( double  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 156 of file irrMath.h.

◆ degToRad() [2/2]

float saga::core::degToRad ( float  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 147 of file irrMath.h.

◆ enumToPOD()

template<typename E >
constexpr auto saga::core::enumToPOD ( e)
inlineconstexprnoexcept

Definition at line 13 of file enumType.hpp.

◆ equals()

template<class T >
bool saga::core::equals ( const T  a,
const T  b,
const T  tolerance = roundingError<T>() 
)
inline

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

Definition at line 285 of file irrMath.h.

◆ equalsByUlp()

bool saga::core::equalsByUlp ( float  a,
float  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 317 of file irrMath.h.

◆ equalsRelative()

template<class T >
bool saga::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 294 of file irrMath.h.

◆ fast_atof()

float saga::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 357 of file fast_atof.h.

◆ fast_atof_move()

const char* saga::core::fast_atof_move ( const char *  in,
float &  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.

◆ float_max3()

float saga::core::float_max3 ( const float  a,
const float  b,
const float  c 
)
inline

Definition at line 784 of file irrMath.h.

◆ float_min3()

float saga::core::float_min3 ( const float  a,
const float  b,
const float  c 
)
inline

Definition at line 789 of file irrMath.h.

◆ floor32()

REALINLINE std::int32_t saga::core::floor32 ( float  x)

Definition at line 692 of file irrMath.h.

◆ FR() [1/2]

float saga::core::FR ( std::int32_t  x)
inline

Definition at line 440 of file irrMath.h.

◆ FR() [2/2]

float saga::core::FR ( std::uint32_t  x)
inline

Floating-point representation of an integer value.

Definition at line 439 of file irrMath.h.

◆ fract()

float saga::core::fract ( float  x)
inline

Definition at line 794 of file irrMath.h.

◆ getHorizontalAngle()

glm::vec3 saga::core::getHorizontalAngle ( const glm::vec3 &  vec)
inline

Definition at line 71 of file irrMath.h.

◆ if_c_a_else_0()

REALINLINE std::uint32_t saga::core::if_c_a_else_0 ( const std::int32_t  condition,
const std::uint32_t  a 
)

conditional set based on mask and arithmetic shift

Definition at line 509 of file irrMath.h.

◆ if_c_a_else_b() [1/2]

REALINLINE std::uint16_t saga::core::if_c_a_else_b ( const std::int16_t  condition,
const std::uint16_t  a,
const std::uint16_t  b 
)

conditional set based on mask and arithmetic shift

Definition at line 503 of file irrMath.h.

◆ if_c_a_else_b() [2/2]

REALINLINE std::uint32_t saga::core::if_c_a_else_b ( const std::int32_t  condition,
const std::uint32_t  a,
const std::uint32_t  b 
)

conditional set based on mask and arithmetic shift

Definition at line 497 of file irrMath.h.

◆ IR()

std::uint32_t saga::core::IR ( float  x)
inline

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

Definition at line 429 of file irrMath.h.

◆ isBetweenPoints()

bool saga::core::isBetweenPoints ( const glm::vec3 &  point,
const glm::vec3 &  begin,
const glm::vec3 &  end 
)
inline

Definition at line 65 of file irrMath.h.

◆ isnotzero()

bool saga::core::isnotzero ( const float  a,
const float  tolerance = ROUNDING_ERROR_float 
)
inline

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

Definition at line 358 of file irrMath.h.

◆ iszero() [1/4]

bool saga::core::iszero ( const double  a,
const double  tolerance = ROUNDING_ERROR_double 
)
inline

returns if a equals zero, taking rounding errors into account

Definition at line 346 of file irrMath.h.

◆ iszero() [2/4]

bool saga::core::iszero ( const float  a,
const float  tolerance = ROUNDING_ERROR_float 
)
inline

returns if a equals zero, taking rounding errors into account

Definition at line 352 of file irrMath.h.

◆ iszero() [3/4]

bool saga::core::iszero ( const std::int32_t  a,
const std::int32_t  tolerance = 0 
)
inline

returns if a equals zero, taking rounding errors into account

Definition at line 364 of file irrMath.h.

◆ iszero() [4/4]

bool saga::core::iszero ( const std::uint32_t  a,
const std::uint32_t  tolerance = 0 
)
inline

returns if a equals zero, taking rounding errors into account

Definition at line 370 of file irrMath.h.

◆ lerp()

template<class T >
T saga::core::lerp ( const T &  a,
const T &  b,
const float  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 199 of file irrMath.h.

◆ max_() [1/2]

template<class T >
const T& saga::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 177 of file irrMath.h.

◆ max_() [2/2]

template<class T >
const T& saga::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 184 of file irrMath.h.

◆ min_() [1/2]

template<class T >
const T& saga::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 163 of file irrMath.h.

◆ min_() [2/2]

template<class T >
const T& saga::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 170 of file irrMath.h.

◆ radToDeg() [1/2]

double saga::core::radToDeg ( double  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 138 of file irrMath.h.

◆ radToDeg() [2/2]

float saga::core::radToDeg ( float  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 129 of file irrMath.h.

◆ reciprocal() [1/2]

REALINLINE double saga::core::reciprocal ( const double  f)

Definition at line 644 of file irrMath.h.

◆ reciprocal() [2/2]

REALINLINE float saga::core::reciprocal ( const float  f)

Definition at line 609 of file irrMath.h.

◆ reciprocal_approxim()

REALINLINE float saga::core::reciprocal_approxim ( const float  f)

Definition at line 651 of file irrMath.h.

◆ reciprocal_squareroot() [1/3]

REALINLINE double saga::core::reciprocal_squareroot ( const double  x)

Definition at line 571 of file irrMath.h.

◆ reciprocal_squareroot() [2/3]

REALINLINE float saga::core::reciprocal_squareroot ( const float  f)

Definition at line 577 of file irrMath.h.

◆ reciprocal_squareroot() [3/3]

REALINLINE std::int32_t saga::core::reciprocal_squareroot ( const std::int32_t  x)

Definition at line 603 of file irrMath.h.

◆ relativeErrorFactor() [1/2]

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

Definition at line 266 of file irrMath.h.

◆ relativeErrorFactor() [2/2]

template<>
double saga::core::relativeErrorFactor ( )
inline

Definition at line 272 of file irrMath.h.

◆ rotationToDirection()

glm::vec3 saga::core::rotationToDirection ( const glm::vec3 &  vec,
const glm::vec3 &  forwards = {0, 0, 1} 
)
inline

Definition at line 95 of file irrMath.h.

◆ round32()

REALINLINE std::int32_t saga::core::round32 ( float  x)

Definition at line 757 of file irrMath.h.

◆ round_()

float saga::core::round_ ( float  x)
inline

Definition at line 525 of file irrMath.h.

◆ roundingError() [1/2]

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

Definition at line 228 of file irrMath.h.

◆ roundingError() [2/2]

template<>
std::uint32_t saga::core::roundingError ( )
inline

Definition at line 228 of file irrMath.h.

◆ s32_clamp()

std::int32_t saga::core::s32_clamp ( std::int32_t  value,
std::int32_t  low,
std::int32_t  high 
)
inline

Definition at line 395 of file irrMath.h.

◆ s32_max()

std::int32_t saga::core::s32_max ( std::int32_t  a,
std::int32_t  b 
)
inline

Definition at line 389 of file irrMath.h.

◆ s32_min()

std::int32_t saga::core::s32_min ( std::int32_t  a,
std::int32_t  b 
)
inline

Definition at line 383 of file irrMath.h.

◆ setbit_cond()

REALINLINE void saga::core::setbit_cond ( std::uint32_t &  state,
std::int32_t  condition,
std::uint32_t  mask 
)

Definition at line 518 of file irrMath.h.

◆ squareroot() [1/3]

REALINLINE double saga::core::squareroot ( const double  f)

Definition at line 551 of file irrMath.h.

◆ squareroot() [2/3]

REALINLINE float saga::core::squareroot ( const float  f)

Definition at line 545 of file irrMath.h.

◆ squareroot() [3/3]

REALINLINE std::int32_t saga::core::squareroot ( const std::int32_t  f)

Definition at line 557 of file irrMath.h.

◆ strtof10()

float saga::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.

◆ strtol10()

std::int32_t saga::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 std::int32_t then +INT_MAX or -INT_MAX will be returned.

Definition at line 90 of file fast_atof.h.

◆ strtoul10()

std::uint32_t saga::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 std::uint32_t then INT_MAX will be returned.

Definition at line 50 of file fast_atof.h.

◆ strtoul16()

std::uint32_t saga::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 std::uint32_t then INT_MAX will be returned.

Definition at line 147 of file fast_atof.h.

◆ strtoul8()

std::uint32_t saga::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 std::uint32_t then INT_MAX will be returned.

Definition at line 194 of file fast_atof.h.

◆ strtoul_prefix()

std::uint32_t saga::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 std::uint32_t then INT_MAX will be returned.

Definition at line 237 of file fast_atof.h.

◆ swap()

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

swaps the content of the passed parameters

Definition at line 217 of file irrMath.h.

Variable Documentation

◆ DEGTORAD

const float saga::core::DEGTORAD = PI / 180.0f

32bit Constant for converting from degrees to radians

Definition at line 54 of file irrMath.h.

◆ DEGTORAD64

const double saga::core::DEGTORAD64 = PI64 / 180.0

64bit constant for converting from degrees to radians (formally known as GRAD_PI2)

Definition at line 60 of file irrMath.h.

◆ fast_atof_table

const float saga::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.

◆ HALF_PI

const float saga::core::HALF_PI = PI/2.0f

Constant for half of PI.

Definition at line 42 of file irrMath.h.

◆ LOCALE_DECIMAL_POINTS

std::string saga::core::LOCALE_DECIMAL_POINTS

Selection of characters which count as decimal point in fast_atof.

◆ PI

const float saga::core::PI = 3.14159265359f

Constant for PI.

Definition at line 36 of file irrMath.h.

◆ PI64

const double saga::core::PI64 = 3.1415926535897932384626433832795028841971693993751

Constant for 64bit PI.

Definition at line 48 of file irrMath.h.

◆ RADTODEG

const float saga::core::RADTODEG = 180.0f / PI

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

Definition at line 57 of file irrMath.h.

◆ RADTODEG64

const double saga::core::RADTODEG64 = 180.0 / PI64

64bit constant for converting from radians to degrees

Definition at line 63 of file irrMath.h.

◆ RECIPROCAL_PI

const float saga::core::RECIPROCAL_PI = 1.0f/PI

Constant for reciprocal of PI.

Definition at line 39 of file irrMath.h.

◆ RECIPROCAL_PI64

const double saga::core::RECIPROCAL_PI64 = 1.0/PI64

Constant for 64bit reciprocal of PI.

Definition at line 51 of file irrMath.h.

◆ ROUNDING_ERROR_double

const double saga::core::ROUNDING_ERROR_double = 0.00000001

Definition at line 30 of file irrMath.h.

◆ ROUNDING_ERROR_float

const float saga::core::ROUNDING_ERROR_float = 0.000001f

Definition at line 29 of file irrMath.h.

◆ ROUNDING_ERROR_S32

const std::int32_t saga::core::ROUNDING_ERROR_S32 = 0

Rounding error constant often used when comparing float values.

Definition at line 24 of file irrMath.h.