Saga3D API Documentation
1.0-RC4
|
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 > | |
T | abs_ (const T &a) |
returns abs of two values. Own implementation to get rid of STL (VS6 problems) More... | |
template<class T > | |
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 > | |
T | roundingError () |
template<> | |
float | roundingError () |
template<class T > | |
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... | |
typedef for Function Pointer
Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
typedef aabbox3d<float> saga::core::aabbox3df |
Typedef for a float 3d bounding box.
Definition at line 350 of file aabbox3d.h.
typedef aabbox3d<std::int32_t> saga::core::aabbox3di |
Typedef for an integer 3d bounding box.
Definition at line 352 of file aabbox3d.h.
typedef line2d<float> saga::core::line2df |
typedef line2d<std::int32_t> saga::core::line2di |
typedef line3d<float> saga::core::line3df |
typedef line3d<std::int32_t> saga::core::line3di |
typedef plane3d<float> saga::core::plane3df |
typedef plane3d<std::int32_t> saga::core::plane3di |
typedef rect<float> saga::core::rectf |
typedef rect<std::int32_t> saga::core::recti |
typedef triangle3d<float> saga::core::triangle3df |
Typedef for a float 3d triangle.
Definition at line 270 of file triangle3d.h.
typedef triangle3d<std::int32_t> saga::core::triangle3di |
Typedef for an integer 3d triangle.
Definition at line 273 of file triangle3d.h.
|
inline |
REALINLINE std::int32_t saga::core::ceil32 | ( | float | x | ) |
|
inline |
REALINLINE void saga::core::clearFPUException | ( | ) |
|
inline |
Convert a hex-encoded character to an unsigned integer.
[in] | in | The digit to convert. Only digits 0 to 9 and chars A-F,a-f will be considered. |
Definition at line 126 of file fast_atof.h.
|
inline |
|
inline |
|
inlineconstexprnoexcept |
Definition at line 13 of file enumType.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Convert a string to a floating point number.
floatAsString | The string to convert. |
out | Optional pointer to the first character in the string that wasn't used to create the float value. |
Definition at line 357 of file fast_atof.h.
|
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.
[in] | in | The string to convert. |
[out] | result | The resultant float will be written here. |
Definition at line 310 of file fast_atof.h.
|
inline |
|
inline |
REALINLINE std::int32_t saga::core::floor32 | ( | float | x | ) |
|
inline |
|
inline |
REALINLINE std::uint32_t saga::core::if_c_a_else_0 | ( | const std::int32_t | condition, |
const std::uint32_t | a | ||
) |
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 | ||
) |
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 | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
REALINLINE double saga::core::reciprocal | ( | const double | f | ) |
REALINLINE float saga::core::reciprocal | ( | const float | f | ) |
REALINLINE float saga::core::reciprocal_approxim | ( | const float | f | ) |
REALINLINE double saga::core::reciprocal_squareroot | ( | const double | x | ) |
REALINLINE float saga::core::reciprocal_squareroot | ( | const float | f | ) |
REALINLINE std::int32_t saga::core::reciprocal_squareroot | ( | const std::int32_t | x | ) |
|
inline |
|
inline |
|
inline |
REALINLINE std::int32_t saga::core::round32 | ( | float | x | ) |
|
inline |
|
inline |
|
inline |
|
inline |
REALINLINE void saga::core::setbit_cond | ( | std::uint32_t & | state, |
std::int32_t | condition, | ||
std::uint32_t | mask | ||
) |
REALINLINE double saga::core::squareroot | ( | const double | f | ) |
REALINLINE float saga::core::squareroot | ( | const float | f | ) |
REALINLINE std::int32_t saga::core::squareroot | ( | const std::int32_t | f | ) |
|
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.
in | the sequence of digits to convert. |
out | (optional) will be set to point at the first non-converted character. |
Definition at line 259 of file fast_atof.h.
|
inline |
Convert a simple string of base 10 digits into a signed 32 bit integer.
[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. |
Definition at line 90 of file fast_atof.h.
|
inline |
Convert a simple string of base 10 digits into an unsigned 32 bit integer.
[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. |
Definition at line 50 of file fast_atof.h.
|
inline |
Convert a simple string of base 16 digits into an unsigned 32 bit integer.
[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. |
Definition at line 147 of file fast_atof.h.
|
inline |
Convert a simple string of base 8 digits into an unsigned 32 bit integer.
[in] | in | The 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. |
Definition at line 194 of file fast_atof.h.
|
inline |
Convert a C-style prefixed string (hex, oct, integer) into an unsigned 32 bit integer.
[in] | in | The 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. |
Definition at line 237 of file fast_atof.h.
|
inline |
const float saga::core::DEGTORAD = PI / 180.0f |
const double saga::core::DEGTORAD64 = PI64 / 180.0 |
const float saga::core::fast_atof_table[17] |
Definition at line 22 of file fast_atof.h.
const float saga::core::HALF_PI = PI/2.0f |
std::string saga::core::LOCALE_DECIMAL_POINTS |
Selection of characters which count as decimal point in fast_atof.
const float saga::core::PI = 3.14159265359f |
const double saga::core::PI64 = 3.1415926535897932384626433832795028841971693993751 |
const float saga::core::RADTODEG = 180.0f / PI |
const double saga::core::RADTODEG64 = 180.0 / PI64 |
const float saga::core::RECIPROCAL_PI = 1.0f/PI |
const double saga::core::RECIPROCAL_PI64 = 1.0/PI64 |
const double saga::core::ROUNDING_ERROR_double = 0.00000001 |