Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
irrMath.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_MATH_HPP_INCLUDED
6#define NIRT_MATH_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/NirtCompileConfig.hpp>
9#include <nirtcpp/core/engine/nirt_types.hpp>
10#include <math.h>
11
12#if defined(_NIRT_SOLARIS_PLATFORM_) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) || defined (_WIN32_WCE)
13 #define sqrtf(X) (nirt::f32)sqrt((nirt::f64)(X))
14 #define sinf(X) (nirt::f32)sin((nirt::f64)(X))
15 #define cosf(X) (nirt::f32)cos((nirt::f64)(X))
16 #define asinf(X) (nirt::f32)asin((nirt::f64)(X))
17 #define acosf(X) (nirt::f32)acos((nirt::f64)(X))
18 #define atan2f(X,Y) (nirt::f32)atan2((nirt::f64)(X),(nirt::f64)(Y))
19 #define ceilf(X) (nirt::f32)ceil((nirt::f64)(X))
20 #define floorf(X) (nirt::f32)floor((nirt::f64)(X))
21 #define powf(X,Y) (nirt::f32)pow((nirt::f64)(X),(nirt::f64)(Y))
22 #define fmodf(X,Y) (nirt::f32)fmod((nirt::f64)(X),(nirt::f64)(Y))
23 #define fabsf(X) (nirt::f32)fabs((nirt::f64)(X))
24 #define logf(X) (nirt::f32)log((nirt::f64)(X))
25#endif
26
27#ifndef FLT_MAX
28#define FLT_MAX 3.402823466E+38F
29#endif
30
31#ifndef FLT_MIN
32#define FLT_MIN 1.17549435e-38F
33#endif
34
35namespace nirt
36{
37namespace core
38{
39
41
43
44#ifdef __NIRT_HAS_S64
45 const s64 ROUNDING_ERROR_S64 = 0;
46#endif
47 const f32 ROUNDING_ERROR_f32 = 0.000001f;
48 const f64 ROUNDING_ERROR_f64 = 0.00000001;
49
50#ifdef PI // make sure we don't collide with a define
51#undef PI
52#endif
54 const f32 PI = 3.14159265359f;
55
57 const f32 RECIPROCAL_PI = 1.0f/PI;
58
60 const f32 HALF_PI = PI/2.0f;
61
62#ifdef PI64 // make sure we don't collide with a define
63#undef PI64
64#endif
66 const f64 PI64 = 3.1415926535897932384626433832795028841971693993751;
67
70
72 const f32 DEGTORAD = PI / 180.0f;
73
75 const f32 RADTODEG = 180.0f / PI;
76
78 const f64 DEGTORAD64 = PI64 / 180.0;
79
81 const f64 RADTODEG64 = 180.0 / PI64;
82
84
88 {
89 return RADTODEG * radians;
90 }
91
93
97 {
98 return RADTODEG64 * radians;
99 }
100
102
106 {
107 return DEGTORAD * degrees;
108 }
109
111
115 {
116 return DEGTORAD64 * degrees;
117 }
118
120 template<class T>
121 inline const T& min_(const T& a, const T& b)
122 {
123 return a < b ? a : b;
124 }
125
127 template<class T>
128 inline const T& min_(const T& a, const T& b, const T& c)
129 {
130 return a < b ? min_(a, c) : min_(b, c);
131 }
132
134 template<class T>
135 inline const T& max_(const T& a, const T& b)
136 {
137 return a < b ? b : a;
138 }
139
141 template<class T>
142 inline const T& max_(const T& a, const T& b, const T& c)
143 {
144 return a < b ? max_(b, c) : max_(a, c);
145 }
146
148 template<class T>
149 inline T abs_(const T& a)
150 {
151 return a < (T)0 ? -a : a;
152 }
153
156 template<class T>
157 inline T lerp(const T& a, const T& b, const f32 t)
158 {
159 return (T)(a*(1.f-t)) + (b*t);
160 }
161
163 template <class T>
164 inline const T clamp (const T& value, const T& low, const T& high)
165 {
166 return min_ (max_(value,low), high);
167 }
168
170 // Note: We use the same trick as boost and use two template arguments to
171 // avoid ambiguity when swapping objects of an Nirtcpp type that has not
172 // it's own swap overload. Otherwise we get conflicts with some compilers
173 // in combination with stl.
174 template <class T1, class T2>
175 inline void swap(T1& a, T2& b)
176 {
177 T1 c(a);
178 a = b;
179 b = c;
180 }
181
182 template <class T>
183 inline T roundingError();
184
185 template <>
186 inline f32 roundingError()
187 {
188 return ROUNDING_ERROR_f32;
189 }
190
191 template <>
192 inline f64 roundingError()
193 {
194 return ROUNDING_ERROR_f64;
195 }
196
197 template <>
198 inline s32 roundingError()
199 {
200 return ROUNDING_ERROR_S32;
201 }
202
203 template <>
204 inline u32 roundingError()
205 {
206 return ROUNDING_ERROR_S32;
207 }
208
209#ifdef __NIRT_HAS_S64
210 template <>
211 inline s64 roundingError()
212 {
213 return ROUNDING_ERROR_S64;
214 }
215
216 template <>
217 inline u64 roundingError()
218 {
219 return ROUNDING_ERROR_S64;
220 }
221#endif
222
223 template <class T>
224 inline T relativeErrorFactor()
225 {
226 return 1;
227 }
228
229 template <>
230 inline f32 relativeErrorFactor()
231 {
232 return 4;
233 }
234
235 template <>
236 inline f64 relativeErrorFactor()
237 {
238 return 8;
239 }
240
242 template <class T>
243 inline bool equals(const T a, const T b, const T tolerance = roundingError<T>())
244 {
245 return (a + tolerance >= b) && (a - tolerance <= b);
246 }
247
248
251 template <class T>
252 inline bool equalsRelative( const T a, const T b, const T factor = relativeErrorFactor<T>())
253 {
254 //https://eagergames.wordpress.com/2017/04/01/fast-parallel-lines-and-vectors-test/
255
256 const T maxi = max_( a, b);
257 const T mini = min_( a, b);
258 const T maxMagnitude = max_( maxi, -mini);
259
260 return (maxMagnitude*factor + maxi) == (maxMagnitude*factor + mini); // MAD Wise
261 }
262
264 {
265 FloatIntUnion32(float f1 = 0.0f) : f(f1) {}
266 // Portable sign-extraction
267 bool sign() const { return (i >> 31) != 0; }
268
269 nirt::s32 i;
270 nirt::f32 f;
271 };
272
274 //\result true when numbers have a ULP <= maxUlpDiff AND have the same sign.
275 inline bool equalsByUlp(f32 a, f32 b, int maxUlpDiff)
276 {
277 // Based on the ideas and code from Bruce Dawson on
278 // http://www.altdevblogaday.com/2012/02/22/comparing-floating-point-numbers-2012-edition/
279 // When floats are interpreted as integers the two nearest possible float numbers differ just
280 // by one integer number. Also works the other way round, an integer of 1 interpreted as float
281 // is for example the smallest possible float number.
282
283 const FloatIntUnion32 fa(a);
284 const FloatIntUnion32 fb(b);
285
286 // Different signs, we could maybe get difference to 0, but so close to 0 using epsilons is better.
287 if ( fa.sign() != fb.sign() )
288 {
289 // Check for equality to make sure +0==-0
290 if (fa.i == fb.i)
291 return true;
292 return false;
293 }
294
295 // Find the difference in ULPs.
296 const int ulpsDiff = abs_(fa.i- fb.i);
297 if (ulpsDiff <= maxUlpDiff)
298 return true;
299
300 return false;
301 }
302
304 inline bool iszero(const f64 a, const f64 tolerance = ROUNDING_ERROR_f64)
305 {
306 return fabs(a) <= tolerance;
307 }
308
310 inline bool iszero(const f32 a, const f32 tolerance = ROUNDING_ERROR_f32)
311 {
312 return fabsf(a) <= tolerance;
313 }
314
316 inline bool isnotzero(const f32 a, const f32 tolerance = ROUNDING_ERROR_f32)
317 {
318 return fabsf(a) > tolerance;
319 }
320
322 inline bool iszero(const s32 a, const s32 tolerance = 0)
323 {
324 return ( a & 0x7ffffff ) <= tolerance;
325 }
326
328 inline bool iszero(const u32 a, const u32 tolerance = 0)
329 {
330 return a <= tolerance;
331 }
332
333#ifdef __NIRT_HAS_S64
335 inline bool iszero(const s64 a, const s64 tolerance = 0)
336 {
337 return abs_(a) <= tolerance;
338 }
339#endif
340
341 inline s32 s32_min(s32 a, s32 b)
342 {
343 const s32 mask = (a - b) >> 31;
344 return (a & mask) | (b & ~mask);
345 }
346
347 inline s32 s32_max(s32 a, s32 b)
348 {
349 const s32 mask = (a - b) >> 31;
350 return (b & mask) | (a & ~mask);
351 }
352
353 inline s32 s32_clamp (s32 value, s32 low, s32 high)
354 {
355 return s32_min(s32_max(value,low), high);
356 }
357
358 /*
359 float IEEE-754 bit representation
360
361 0 0x00000000
362 1.0 0x3f800000
363 0.5 0x3f000000
364 3 0x40400000
365 +inf 0x7f800000
366 -inf 0xff800000
367 +NaN 0x7fc00000 or 0x7ff00000
368 in general: number = (sign ? -1:1) * 2^(exponent) * 1.(mantissa bits)
369 */
370
371 using inttofloat = union { u32 u; s32 s; f32 f; };
372
373 #define F32_AS_S32(f) (*((s32 *) &(f)))
374 #define F32_AS_U32(f) (*((u32 *) &(f)))
375 #define F32_AS_U32_POINTER(f) ( ((u32 *) &(f)))
376
377 #define F32_VALUE_0 0x00000000
378 #define F32_VALUE_1 0x3f800000
379 #define F32_SIGN_BIT 0x80000000U
380 #define F32_EXPON_MANTISSA 0x7FFFFFFFU
381
384#ifdef NIRTCPP_FAST_MATH
385 #define IR(x) ((u32&)(x))
386#else
387 inline u32 IR(f32 x) {inttofloat tmp; tmp.f=x; return tmp.u;}
388#endif
389
391 #define AIR(x) (IR(x)&0x7fffffff)
392
394#ifdef NIRTCPP_FAST_MATH
395 #define FR(x) ((f32&)(x))
396#else
397 inline f32 FR(u32 x) {inttofloat tmp; tmp.u=x; return tmp.f;}
398 inline f32 FR(s32 x) {inttofloat tmp; tmp.s=x; return tmp.f;}
399#endif
400
402 #define IEEE_1_0 0x3f800000
404 #define IEEE_255_0 0x437f0000
405
406#ifdef NIRTCPP_FAST_MATH
407 #define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT)
408 #define F32_LOWER_EQUAL_0(f) (F32_AS_S32(f) <= F32_VALUE_0)
409 #define F32_GREATER_0(f) (F32_AS_S32(f) > F32_VALUE_0)
410 #define F32_GREATER_EQUAL_0(f) (F32_AS_U32(f) <= F32_SIGN_BIT)
411 #define F32_EQUAL_1(f) (F32_AS_U32(f) == F32_VALUE_1)
412 #define F32_EQUAL_0(f) ( (F32_AS_U32(f) & F32_EXPON_MANTISSA ) == F32_VALUE_0)
413
414 // only same sign
415 #define F32_A_GREATER_B(a,b) (F32_AS_S32((a)) > F32_AS_S32((b)))
416
417#else
418
419 #define F32_LOWER_0(n) ((n) < 0.0f)
420 #define F32_LOWER_EQUAL_0(n) ((n) <= 0.0f)
421 #define F32_GREATER_0(n) ((n) > 0.0f)
422 #define F32_GREATER_EQUAL_0(n) ((n) >= 0.0f)
423 #define F32_EQUAL_1(n) ((n) == 1.0f)
424 #define F32_EQUAL_0(n) ((n) == 0.0f)
425 #define F32_A_GREATER_B(a,b) ((a) > (b))
426#endif
427
428
429#ifndef REALINLINE
430 #ifdef _MSC_VER
431 #define REALINLINE __forceinline
432 #else
433 #define REALINLINE inline
434 #endif
435#endif
436
437#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
438
439 // 8-bit bools in Borland builder
440
442 REALINLINE u32 if_c_a_else_b ( const c8 condition, const u32 a, const u32 b )
443 {
444 return ( ( -condition >> 7 ) & ( a ^ b ) ) ^ b;
445 }
446
448 REALINLINE u32 if_c_a_else_0 ( const c8 condition, const u32 a )
449 {
450 return ( -condition >> 31 ) & a;
451 }
452#else
453
455 REALINLINE u32 if_c_a_else_b ( const s32 condition, const u32 a, const u32 b )
456 {
457 return ( ( -condition >> 31 ) & ( a ^ b ) ) ^ b;
458 }
459
461 REALINLINE u16 if_c_a_else_b ( const s16 condition, const u16 a, const u16 b )
462 {
463 return ( ( -condition >> 15 ) & ( a ^ b ) ) ^ b;
464 }
465
467 REALINLINE u32 if_c_a_else_0 ( const s32 condition, const u32 a )
468 {
469 return ( -condition >> 31 ) & a;
470 }
471#endif
472
473 /*
474 if (condition) state |= m; else state &= ~m;
475 */
476 REALINLINE void setbit_cond ( u32 &state, s32 condition, u32 mask )
477 {
478 // 0, or any positive to mask
479 //s32 conmask = -condition >> 31;
480 state ^= ( ( -condition >> 31 ) ^ state ) & mask;
481 }
482
483 // NOTE: This is not as exact as the c99/c++11 round function, especially at high numbers starting with 8388609
484 // (only low number which seems to go wrong is 0.49999997 which is rounded to 1)
485 // Also negative 0.5 is rounded up not down unlike with the standard function (p.E. input -0.5 will be 0 and not -1)
486 inline f32 round_( f32 x )
487 {
488 return floorf( x + 0.5f );
489 }
490
491 // calculate: sqrt ( x )
492 REALINLINE f32 squareroot(const f32 f)
493 {
494 return sqrtf(f);
495 }
496
497 // calculate: sqrt ( x )
498 REALINLINE f64 squareroot(const f64 f)
499 {
500 return sqrt(f);
501 }
502
503 // calculate: sqrt ( x )
504 REALINLINE s32 squareroot(const s32 f)
505 {
506 return static_cast<s32>(squareroot(static_cast<f32>(f)));
507 }
508
509#ifdef __NIRT_HAS_S64
510 // calculate: sqrt ( x )
511 REALINLINE s64 squareroot(const s64 f)
512 {
513 return static_cast<s64>(squareroot(static_cast<f64>(f)));
514 }
515#endif
516
517 // calculate: 1 / sqrt ( x )
518 REALINLINE f64 reciprocal_squareroot(const f64 x)
519 {
520 return 1.0 / sqrt(x);
521 }
522
523 // calculate: 1 / sqrtf ( x )
524 REALINLINE f32 reciprocal_squareroot(const f32 f)
525 {
526#if defined ( NIRTCPP_FAST_MATH )
527 // NOTE: Unlike comment below says I found inaccuracies already at 4'th significant bit.
528 // p.E: Input 1, expected 1, got 0.999755859
529
530 #if defined(_MSC_VER) && !defined(_WIN64)
531 // SSE reciprocal square root estimate, accurate to 12 significant
532 // bits of the mantissa
533 f32 recsqrt;
534 __asm rsqrtss xmm0, f // xmm0 = rsqrtss(f)
535 __asm movss recsqrt, xmm0 // return xmm0
536 return recsqrt;
537
538/*
539 // comes from Nvidia
540 u32 tmp = (u32(IEEE_1_0 << 1) + IEEE_1_0 - *(u32*)&x) >> 1;
541 f32 y = *(f32*)&tmp;
542 return y * (1.47f - 0.47f * x * y * y);
543*/
544 #else
545 return 1.f / sqrtf(f);
546 #endif
547#else // no fast math
548 return 1.f / sqrtf(f);
549#endif
550 }
551
552 // calculate: 1 / sqrtf( x )
553 REALINLINE s32 reciprocal_squareroot(const s32 x)
554 {
555 return static_cast<s32>(reciprocal_squareroot(static_cast<f32>(x)));
556 }
557
558 // calculate: 1 / x
559 REALINLINE f32 reciprocal( const f32 f )
560 {
561#if defined (NIRTCPP_FAST_MATH)
562 // NOTE: Unlike with 1.f / f the values very close to 0 return -nan instead of inf
563
564 // SSE Newton-Raphson reciprocal estimate, accurate to 23 significant
565 // bi ts of the mantissa
566 // One Newton-Raphson Iteration:
567 // f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f)
568#if defined(_MSC_VER) && !defined(_WIN64)
569 f32 rec;
570 __asm rcpss xmm0, f // xmm0 = rcpss(f)
571 __asm movss xmm1, f // xmm1 = f
572 __asm mulss xmm1, xmm0 // xmm1 = f * rcpss(f)
573 __asm mulss xmm1, xmm0 // xmm2 = f * rcpss(f) * rcpss(f)
574 __asm addss xmm0, xmm0 // xmm0 = 2 * rcpss(f)
575 __asm subss xmm0, xmm1 // xmm0 = 2 * rcpss(f)
576 // - f * rcpss(f) * rcpss(f)
577 __asm movss rec, xmm0 // return xmm0
578 return rec;
579#else // no support yet for other compilers
580 return 1.f / f;
581#endif
583 // instead set f to a high value to get a return value near zero..
584 // -1000000000000.f.. is use minus to stay negative..
585 // must test's here (plane.normal dot anything ) checks on <= 0.f
586 //u32 x = (-(AIR(f) != 0 ) >> 31 ) & ( IR(f) ^ 0xd368d4a5 ) ^ 0xd368d4a5;
587 //return 1.f / FR ( x );
588
589#else // no fast math
590 return 1.f / f;
591#endif
592 }
593
594 // calculate: 1 / x
595 REALINLINE f64 reciprocal ( const f64 f )
596 {
597 return 1.0 / f;
598 }
599
600
601 // calculate: 1 / x, low precision allowed
602 REALINLINE f32 reciprocal_approxim ( const f32 f )
603 {
604#if defined( NIRTCPP_FAST_MATH)
605
606 // SSE Newton-Raphson reciprocal estimate, accurate to 23 significant
607 // bi ts of the mantissa
608 // One Newton-Raphson Iteration:
609 // f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f)
610#if defined(_MSC_VER) && !defined(_WIN64)
611 f32 rec;
612 __asm rcpss xmm0, f // xmm0 = rcpss(f)
613 __asm movss xmm1, f // xmm1 = f
614 __asm mulss xmm1, xmm0 // xmm1 = f * rcpss(f)
615 __asm mulss xmm1, xmm0 // xmm2 = f * rcpss(f) * rcpss(f)
616 __asm addss xmm0, xmm0 // xmm0 = 2 * rcpss(f)
617 __asm subss xmm0, xmm1 // xmm0 = 2 * rcpss(f)
618 // - f * rcpss(f) * rcpss(f)
619 __asm movss rec, xmm0 // return xmm0
620 return rec;
621#else // no support yet for other compilers
622 return 1.f / f;
623#endif
624
625/*
626 // SSE reciprocal estimate, accurate to 12 significant bits of
627 f32 rec;
628 __asm rcpss xmm0, f // xmm0 = rcpss(f)
629 __asm movss rec , xmm0 // return xmm0
630 return rec;
631*/
632/*
633 u32 x = 0x7F000000 - IR ( p );
634 const f32 r = FR ( x );
635 return r * (2.0f - p * r);
636*/
637#else // no fast math
638 return 1.f / f;
639#endif
640 }
641
642
643 REALINLINE s32 floor32(f32 x)
644 {
645 return (s32) floorf ( x );
646 }
647
648 REALINLINE s32 ceil32 ( f32 x )
649 {
650 return (s32) ceilf ( x );
651 }
652
653 // NOTE: Please check round_ documentation about some inaccuracies in this compared to standard library round function.
654 REALINLINE s32 round32(f32 x)
655 {
656 return (s32) round_(x);
657 }
658
659 inline f32 f32_max3(const f32 a, const f32 b, const f32 c)
660 {
661 return a > b ? (a > c ? a : c) : (b > c ? b : c);
662 }
663
664 inline f32 f32_min3(const f32 a, const f32 b, const f32 c)
665 {
666 return a < b ? (a < c ? a : c) : (b < c ? b : c);
667 }
668
669 inline f32 fract ( f32 x )
670 {
671 return x - floorf ( x );
672 }
673
674} // end namespace core
675} // end namespace nirt
676
677#ifndef NIRTCPP_FAST_MATH
678 using nirt::core::IR;
679 using nirt::core::FR;
680#endif
681
682#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
const f32 HALF_PI
Constant for half of PI.
Definition irrMath.hpp:60
const T & max_(const T &a, const T &b)
returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)
Definition irrMath.hpp:135
const f64 RECIPROCAL_PI64
Constant for 64bit reciprocal of PI.
Definition irrMath.hpp:69
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 exi...
Definition irrMath.hpp:275
f32 degToRad(f32 degrees)
Utility function to convert a degrees value to radians.
Definition irrMath.hpp:105
f32 FR(u32 x)
Floating-point representation of an integer value.
Definition irrMath.hpp:397
const f32 RECIPROCAL_PI
Constant for reciprocal of PI.
Definition irrMath.hpp:57
REALINLINE u32 if_c_a_else_0(const s32 condition, const u32 a)
conditional set based on mask and arithmetic shift
Definition irrMath.hpp:467
REALINLINE u32 if_c_a_else_b(const s32 condition, const u32 a, const u32 b)
conditional set based on mask and arithmetic shift
Definition irrMath.hpp:455
const T & min_(const T &a, const T &b)
returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)
Definition irrMath.hpp:121
const f32 PI
Constant for PI.
Definition irrMath.hpp:54
bool equalsRelative(const T a, const T b, const T factor=relativeErrorFactor< T >())
Definition irrMath.hpp:252
bool isnotzero(const f32 a, const f32 tolerance=ROUNDING_ERROR_f32)
returns if a equals not zero, taking rounding errors into account
Definition irrMath.hpp:316
f32 radToDeg(f32 radians)
Utility function to convert a radian value to degrees.
Definition irrMath.hpp:87
const f64 RADTODEG64
64bit constant for converting from radians to degrees
Definition irrMath.hpp:81
void swap(T1 &a, T2 &b)
swaps the content of the passed parameters
Definition irrMath.hpp:175
const s32 ROUNDING_ERROR_S32
Rounding error constant often used when comparing f32 values.
Definition irrMath.hpp:42
bool iszero(const f64 a, const f64 tolerance=ROUNDING_ERROR_f64)
returns if a equals zero, taking rounding errors into account
Definition irrMath.hpp:304
const f32 DEGTORAD
32bit Constant for converting from degrees to radians
Definition irrMath.hpp:72
T abs_(const T &a)
returns abs of two values. Own implementation to get rid of STL (VS6 problems)
Definition irrMath.hpp:149
const T clamp(const T &value, const T &low, const T &high)
clamps a value between low and high
Definition irrMath.hpp:164
T lerp(const T &a, const T &b, const f32 t)
Definition irrMath.hpp:157
u32 IR(f32 x)
Definition irrMath.hpp:387
const f64 DEGTORAD64
64bit constant for converting from degrees to radians (formally known as GRAD_PI2)
Definition irrMath.hpp:78
const f32 RADTODEG
32bit constant for converting from radians to degrees (formally known as GRAD_PI)
Definition irrMath.hpp:75
bool equals(const T a, const T b, const T tolerance=roundingError< T >())
returns if a equals b, taking possible rounding errors into account
Definition irrMath.hpp:243
const f64 PI64
Constant for 64bit PI.
Definition irrMath.hpp:66
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
unsigned short u16
16 bit unsigned variable.
Definition irrTypes.hpp:46
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
double f64
64 bit floating point variable.
Definition irrTypes.hpp:114
char c8
8 bit character variable.
Definition irrTypes.hpp:37
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110
signed short s16
16 bit signed variable.
Definition irrTypes.hpp:54
Definition irrMath.hpp:264

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print