diff --git a/Doxygen/build/Collider_8cpp.html b/Doxygen/build/Collider_8cpp.html index 6002017..b84bff0 100644 --- a/Doxygen/build/Collider_8cpp.html +++ b/Doxygen/build/Collider_8cpp.html @@ -100,7 +100,7 @@ Include dependency graph for Collider.cpp: diff --git a/Doxygen/build/Collider_8cpp_source.html b/Doxygen/build/Collider_8cpp_source.html index 36d9d51..7d6ade8 100644 --- a/Doxygen/build/Collider_8cpp_source.html +++ b/Doxygen/build/Collider_8cpp_source.html @@ -82,7 +82,7 @@ $(function() {
Collider.h
diff --git a/Doxygen/build/Collider_8h.html b/Doxygen/build/Collider_8h.html index b072bf6..d275e5d 100644 --- a/Doxygen/build/Collider_8h.html +++ b/Doxygen/build/Collider_8h.html @@ -125,7 +125,7 @@ Namespaces diff --git a/Doxygen/build/Collider_8h_source.html b/Doxygen/build/Collider_8h_source.html index 5992a1c..bb7cafb 100644 --- a/Doxygen/build/Collider_8h_source.html +++ b/Doxygen/build/Collider_8h_source.html @@ -96,7 +96,7 @@ $(function() {
Eule
Definition: Collider.h:4
diff --git a/Doxygen/build/Constants_8h.html b/Doxygen/build/Constants_8h.html index 173c4f2..61c611f 100644 --- a/Doxygen/build/Constants_8h.html +++ b/Doxygen/build/Constants_8h.html @@ -215,7 +215,7 @@ Variables diff --git a/Doxygen/build/Constants_8h_source.html b/Doxygen/build/Constants_8h_source.html index a9e0248..6c4cbef 100644 --- a/Doxygen/build/Constants_8h_source.html +++ b/Doxygen/build/Constants_8h_source.html @@ -95,7 +95,7 @@ $(function() {
HALF_PI
static constexpr double HALF_PI
Pi divided by two.
Definition: Constants.h:9
diff --git a/Doxygen/build/Debug_2Eule_8vcxproj_8FileListAbsolute_8txt.html b/Doxygen/build/Debug_2Eule_8vcxproj_8FileListAbsolute_8txt.html index c6320ec..257f8b8 100644 --- a/Doxygen/build/Debug_2Eule_8vcxproj_8FileListAbsolute_8txt.html +++ b/Doxygen/build/Debug_2Eule_8vcxproj_8FileListAbsolute_8txt.html @@ -76,7 +76,7 @@ $(function() { diff --git a/Doxygen/build/Math_8cpp.html b/Doxygen/build/Math_8cpp.html index e1fcaf6..1737852 100644 --- a/Doxygen/build/Math_8cpp.html +++ b/Doxygen/build/Math_8cpp.html @@ -87,11 +87,12 @@ Include dependency graph for Math.cpp:
- - - - + + + + +
@@ -122,7 +123,7 @@ Macros diff --git a/Doxygen/build/Math_8cpp__incl.map b/Doxygen/build/Math_8cpp__incl.map index e3e37ad..bf72fb5 100644 --- a/Doxygen/build/Math_8cpp__incl.map +++ b/Doxygen/build/Math_8cpp__incl.map @@ -1,7 +1,8 @@ - - - - + + + + + diff --git a/Doxygen/build/Math_8cpp__incl.md5 b/Doxygen/build/Math_8cpp__incl.md5 index da36cbb..a0793aa 100644 --- a/Doxygen/build/Math_8cpp__incl.md5 +++ b/Doxygen/build/Math_8cpp__incl.md5 @@ -1 +1 @@ -b3c86aa9fc0928813fa25ed5a0b9b4c3 \ No newline at end of file +64f48b056a74ba18f5f53630c99b02b9 \ No newline at end of file diff --git a/Doxygen/build/Math_8cpp__incl.png b/Doxygen/build/Math_8cpp__incl.png index 2202df0..8a08b15 100644 Binary files a/Doxygen/build/Math_8cpp__incl.png and b/Doxygen/build/Math_8cpp__incl.png differ diff --git a/Doxygen/build/Math_8cpp_source.html b/Doxygen/build/Math_8cpp_source.html index 9135076..6cb8c05 100644 --- a/Doxygen/build/Math_8cpp_source.html +++ b/Doxygen/build/Math_8cpp_source.html @@ -154,13 +154,33 @@ $(function() {
75  return Random() <= chance;
76 }
77 
-
78 std::mt19937 Math::rng;
-
79 bool Math::isRngInitialized = true;
+
78 int Math::Mod(const int numerator, const int denominator)
+
79 {
+
80  if (denominator == 0)
+
81  throw std::logic_error("Divide by zero");
+
82 
+
83  // Quick optimizations:
+
84 
+
85  // -> 0/n is always 0
+
86  if (numerator == 0)
+
87  return 0;
+
88 
+
89  // -> operator% works for a > 0 && b > 0
+
90  if (denominator > 0 && numerator > 0)
+
91  return numerator % denominator;
+
92 
+
93  // Else: generalized formula
+
94  return (denominator + (numerator % denominator)) % denominator;
+
95 }
+
96 
+
97 std::mt19937 Math::rng;
+
98 bool Math::isRngInitialized = true;
MAKE_SURE_RNG_IS_INITIALIZED
#define MAKE_SURE_RNG_IS_INITIALIZED
Definition: Math.cpp:8
Eule::Math::RandomChance
static bool RandomChance(const double chance)
Will 'roll' a dice, returning true percent of the time.
Definition: Math.cpp:73
PI
static constexpr double PI
Pi up to 50 decimal places.
Definition: Constants.h:6
Eule::Math::RandomRange
static double RandomRange(const double min, const double max)
Will return a random double within a range These bounds are INCLUSIVE!
Definition: Math.cpp:56
+
Eule::Math::Mod
static int Mod(const int numerator, const int denominator)
Will compute the actual modulo of a fraction.
Definition: Math.cpp:78
Constants.h
Eule::Math::RandomInt
static unsigned int RandomInt()
Will return a random integer.
Definition: Math.cpp:45
Math.h
@@ -172,7 +192,7 @@ $(function() {
Eule::Math::Oscillate
static double Oscillate(const double a, const double b, const double counter, const double speed)
Kind of like , but it oscillates over instead of , by a given speed.
Definition: Math.cpp:68
diff --git a/Doxygen/build/Math_8h.html b/Doxygen/build/Math_8h.html index a4064a0..1ba7b05 100644 --- a/Doxygen/build/Math_8h.html +++ b/Doxygen/build/Math_8h.html @@ -81,13 +81,15 @@ $(function() {
#include <random>
+#include <stdexcept>
Include dependency graph for Math.h:
- - + + +
@@ -120,7 +122,7 @@ Namespaces
diff --git a/Doxygen/build/Math_8h__incl.map b/Doxygen/build/Math_8h__incl.map index db0e59e..ab15bad 100644 --- a/Doxygen/build/Math_8h__incl.map +++ b/Doxygen/build/Math_8h__incl.map @@ -1,4 +1,5 @@ - - + + + diff --git a/Doxygen/build/Math_8h__incl.md5 b/Doxygen/build/Math_8h__incl.md5 index 1b7b3c1..a77a0ab 100644 --- a/Doxygen/build/Math_8h__incl.md5 +++ b/Doxygen/build/Math_8h__incl.md5 @@ -1 +1 @@ -00ccaa4881b8dd3c6030cc0f136de55d \ No newline at end of file +30e3340847668dd6d0fcf574a3f1e946 \ No newline at end of file diff --git a/Doxygen/build/Math_8h__incl.png b/Doxygen/build/Math_8h__incl.png index 8e72433..f3cbb31 100644 Binary files a/Doxygen/build/Math_8h__incl.png and b/Doxygen/build/Math_8h__incl.png differ diff --git a/Doxygen/build/Math_8h_source.html b/Doxygen/build/Math_8h_source.html index 94e9cee..410a0a1 100644 --- a/Doxygen/build/Math_8h_source.html +++ b/Doxygen/build/Math_8h_source.html @@ -79,103 +79,107 @@ $(function() {
Go to the documentation of this file.
1 #pragma once
2 #include <random>
-
3 
-
4 namespace Eule
-
5 {
-
8  class Math
-
9  {
-
10  public:
-
12  [[nodiscard]] static constexpr double Max(const double a, const double b);
-
13 
-
15  [[nodiscard]] static constexpr double Min(const double a, const double b);
-
16 
-
18  [[nodiscard]] static constexpr double Clamp(const double v, const double min, const double max);
-
19 
-
21  [[nodiscard]] static constexpr double Lerp(double a, double b, double t);
-
22 
-
24  [[nodiscard]] static constexpr double Abs(const double a);
-
25 
-
27  [[nodiscard]] static constexpr bool Similar(const double a, const double b, const double epsilon = 0.00001);
-
28 
-
30  static double Random();
-
31 
-
33  static unsigned int RandomUint();
-
34 
-
36  static unsigned int RandomInt();
-
37 
-
40  static double RandomRange(const double min, const double max);
-
41 
-
44  static int RandomIntRange(const int max, const int min);
-
45 
-
47  static bool RandomChance(const double chance);
-
48 
-
53  static double Oscillate(const double a, const double b, const double counter, const double speed);
-
54 
-
55  private:
-
57  static void InitRng();
-
58 
-
59  static std::mt19937 rng;
-
60  static bool isRngInitialized;
-
61 
-
62  // No instanciation! >:(
-
63  Math();
-
64  };
-
65 
+
3 #include <stdexcept>
+
4 
+
5 namespace Eule
+
6 {
+
9  class Math
+
10  {
+
11  public:
+
13  [[nodiscard]] static constexpr double Max(const double a, const double b);
+
14 
+
16  [[nodiscard]] static constexpr double Min(const double a, const double b);
+
17 
+
19  [[nodiscard]] static constexpr double Clamp(const double v, const double min, const double max);
+
20 
+
22  [[nodiscard]] static constexpr double Lerp(double a, double b, double t);
+
23 
+
25  [[nodiscard]] static constexpr double Abs(const double a);
+
26 
+
28  [[nodiscard]] static constexpr bool Similar(const double a, const double b, const double epsilon = 0.00001);
+
29 
+
32  [[nodiscard]] static int Mod(const int numerator, const int denominator);
+
33 
+
35  static double Random();
+
36 
+
38  static unsigned int RandomUint();
+
39 
+
41  static unsigned int RandomInt();
+
42 
+
45  static double RandomRange(const double min, const double max);
+
46 
+
49  static int RandomIntRange(const int max, const int min);
+
50 
+
52  static bool RandomChance(const double chance);
+
53 
+
58  static double Oscillate(const double a, const double b, const double counter, const double speed);
+
59 
+
60  private:
+
62  static void InitRng();
+
63 
+
64  static std::mt19937 rng;
+
65  static bool isRngInitialized;
66 
-
67 
-
68  /* These are just the inline methods. They have to lie in the header file. */
-
69  /* The more sophisticated methods are in the .cpp */
+
67  // No instanciation! >:(
+
68  Math();
+
69  };
70 
-
71  constexpr inline double Math::Max(double a, double b)
-
72  {
-
73  return (a > b) ? a : b;
-
74  }
+
71 
+
72 
+
73  /* These are just the inline methods. They have to lie in the header file. */
+
74  /* The more sophisticated methods are in the .cpp */
75 
-
76  constexpr inline double Math::Min(double a, double b)
+
76  constexpr inline double Math::Max(double a, double b)
77  {
-
78  return (a < b) ? a : b;
+
78  return (a > b) ? a : b;
79  }
80 
-
81  constexpr inline double Math::Clamp(double v, double min, double max)
+
81  constexpr inline double Math::Min(double a, double b)
82  {
-
83  return Max(Min(v, max), min);
+
83  return (a < b) ? a : b;
84  }
85 
-
86  constexpr inline double Math::Lerp(double a, double b, double t)
+
86  constexpr inline double Math::Clamp(double v, double min, double max)
87  {
-
88  const double it = 1.0 - t;
-
89  return (a * it) + (b * t);
-
90  }
-
91 
-
92  inline constexpr double Math::Abs(const double a)
-
93  {
-
94  return (a > 0.0) ? a : -a;
+
88  return Max(Min(v, max), min);
+
89  }
+
90 
+
91  constexpr inline double Math::Lerp(double a, double b, double t)
+
92  {
+
93  const double it = 1.0 - t;
+
94  return (a * it) + (b * t);
95  }
96 
-
97  inline constexpr bool Math::Math::Similar(const double a, const double b, const double epsilon)
+
97  constexpr inline double Math::Abs(const double a)
98  {
-
99  return Abs(a - b) <= epsilon;
+
99  return (a > 0.0) ? a : -a;
100  }
-
101 }
+
101 
+
102  constexpr inline bool Math::Similar(const double a, const double b, const double epsilon)
+
103  {
+
104  return Abs(a - b) <= epsilon;
+
105  }
+
106 }
static bool RandomChance(const double chance)
Will 'roll' a dice, returning true percent of the time.
Definition: Math.cpp:73
-
static constexpr double Abs(const double a)
Will return the absolute value of a
Definition: Math.h:92
+
static constexpr double Abs(const double a)
Will return the absolute value of a
Definition: Math.h:97
static double RandomRange(const double min, const double max)
Will return a random double within a range These bounds are INCLUSIVE!
Definition: Math.cpp:56
-
static constexpr double Lerp(double a, double b, double t)
Will return the linear interpolation between a and b by t
Definition: Math.h:86
+
static constexpr double Lerp(double a, double b, double t)
Will return the linear interpolation between a and b by t
Definition: Math.h:91
+
static int Mod(const int numerator, const int denominator)
Will compute the actual modulo of a fraction.
Definition: Math.cpp:78
static unsigned int RandomInt()
Will return a random integer.
Definition: Math.cpp:45
-
static constexpr double Max(const double a, const double b)
Will return the bigger of two values.
Definition: Math.h:71
-
Math utility class containing basic functions.
Definition: Math.h:8
-
static constexpr double Clamp(const double v, const double min, const double max)
Will return v, but at least min, and at most max
Definition: Math.h:81
-
static constexpr double Min(const double a, const double b)
Will return the smaller of two values.
Definition: Math.h:76
+
static constexpr double Max(const double a, const double b)
Will return the bigger of two values.
Definition: Math.h:76
+
Math utility class containing basic functions.
Definition: Math.h:9
+
static constexpr double Clamp(const double v, const double min, const double max)
Will return v, but at least min, and at most max
Definition: Math.h:86
+
static constexpr double Min(const double a, const double b)
Will return the smaller of two values.
Definition: Math.h:81
static int RandomIntRange(const int max, const int min)
Will return a random integer within a range.
Definition: Math.cpp:63
+
static constexpr bool Similar(const double a, const double b, const double epsilon=0.00001)
Compares two double values with a given accuracy.
Definition: Math.h:102
static double Random()
Will return a random double between 0 and 1
Definition: Math.cpp:29
-
static constexpr bool Similar(const double a, const double b, const double epsilon=0.00001)
Compares two double values with a given accuracy.
static unsigned int RandomUint()
Will return a random unsigned integer.
Definition: Math.cpp:37
Definition: Collider.h:4
static double Oscillate(const double a, const double b, const double counter, const double speed)
Kind of like , but it oscillates over instead of , by a given speed.
Definition: Math.cpp:68
diff --git a/Doxygen/build/Matrix4x4_8cpp.html b/Doxygen/build/Matrix4x4_8cpp.html index f6a0f58..1501ab2 100644 --- a/Doxygen/build/Matrix4x4_8cpp.html +++ b/Doxygen/build/Matrix4x4_8cpp.html @@ -89,11 +89,11 @@ Include dependency graph for Matrix4x4.cpp:
- + - - - + + + @@ -101,6 +101,7 @@ Include dependency graph for Matrix4x4.cpp:
+
@@ -121,7 +122,7 @@ Functions diff --git a/Doxygen/build/Matrix4x4_8cpp__incl.map b/Doxygen/build/Matrix4x4_8cpp__incl.map index d443343..c1238c4 100644 --- a/Doxygen/build/Matrix4x4_8cpp__incl.map +++ b/Doxygen/build/Matrix4x4_8cpp__incl.map @@ -1,9 +1,9 @@ - + - - - + + + @@ -11,4 +11,5 @@ + diff --git a/Doxygen/build/Matrix4x4_8cpp__incl.md5 b/Doxygen/build/Matrix4x4_8cpp__incl.md5 index 0cf31c5..3ea338d 100644 --- a/Doxygen/build/Matrix4x4_8cpp__incl.md5 +++ b/Doxygen/build/Matrix4x4_8cpp__incl.md5 @@ -1 +1 @@ -7564e27ac3fef491d766419d5a5fe90e \ No newline at end of file +249160e44e952572df002a88ede6eb16 \ No newline at end of file diff --git a/Doxygen/build/Matrix4x4_8cpp__incl.png b/Doxygen/build/Matrix4x4_8cpp__incl.png index e2c7808..811988b 100644 Binary files a/Doxygen/build/Matrix4x4_8cpp__incl.png and b/Doxygen/build/Matrix4x4_8cpp__incl.png differ diff --git a/Doxygen/build/Matrix4x4_8cpp_source.html b/Doxygen/build/Matrix4x4_8cpp_source.html index 5b137a2..dde9492 100644 --- a/Doxygen/build/Matrix4x4_8cpp_source.html +++ b/Doxygen/build/Matrix4x4_8cpp_source.html @@ -688,7 +688,7 @@ $(function() {
609 {
610  for (std::size_t i = 0; i < 4; i++)
611  for (std::size_t j = 0; j < 4; j++)
-
612  if (!Math::Similar(v[i][j], other[i][j], epsilon))
+
612  if (!Math::Similar(v[i][j], other[i][j], epsilon))
613  return false;
614 
615  return true;
@@ -755,6 +755,7 @@ $(function() {
Eule::Matrix4x4::operator/=
void operator/=(const Matrix4x4 &other)
Definition: Matrix4x4.cpp:158
Eule::Vector3::x
T x
Definition: Vector3.h:94
Eule::Matrix4x4::p
double & p
Definition: Matrix4x4.h:143
+
Eule::Math::Similar
static constexpr bool Similar(const double a, const double b, const double epsilon=0.00001)
Compares two double values with a given accuracy.
Definition: Math.h:102
Eule::Matrix4x4::IsInversible3x3
bool IsInversible3x3() const
Will check if the 3x3-component is inversible.
Definition: Matrix4x4.cpp:598
Eule::Matrix4x4::Transpose3x3
Matrix4x4 Transpose3x3() const
Will return the 3x3 transpose of this matrix.
Definition: Matrix4x4.cpp:429
Eule::operator<<
std::ostream & operator<<(std::ostream &os, const Matrix4x4 &m)
Definition: Matrix4x4.cpp:620
@@ -762,7 +763,6 @@ $(function() {
Eule::Matrix4x4::operator-
Matrix4x4 operator-(const Matrix4x4 &other) const
Cellwise subtraction.
Definition: Matrix4x4.cpp:298
Eule::Matrix4x4::Determinant
double Determinant(std::size_t n) const
Will return the determinant, by dimension n.
Definition: Matrix4x4.cpp:511
Vector3.h
-
Eule::Math::Similar
static constexpr bool Similar(const double a, const double b, const double epsilon=0.00001)
Compares two double values with a given accuracy.
Eule::Matrix4x4::operator+=
void operator+=(const Matrix4x4 &other)
Cellwise addition.
Definition: Matrix4x4.cpp:261
Eule::Matrix4x4::Matrix4x4
Matrix4x4()
Definition: Matrix4x4.cpp:12
Eule::Matrix4x4::SetTranslationComponent
void SetTranslationComponent(const Vector3d &trans)
Will set d,h,l from a Vector3d(x,y,z)
Definition: Matrix4x4.cpp:412
@@ -778,7 +778,7 @@ $(function() {
Eule::Vector3::y
T y
Definition: Vector3.h:95
diff --git a/Doxygen/build/Matrix4x4_8h.html b/Doxygen/build/Matrix4x4_8h.html index 9c1c0fc..5028ec7 100644 --- a/Doxygen/build/Matrix4x4_8h.html +++ b/Doxygen/build/Matrix4x4_8h.html @@ -140,7 +140,7 @@ Typedefs diff --git a/Doxygen/build/Matrix4x4_8h_source.html b/Doxygen/build/Matrix4x4_8h_source.html index 1e1b6c7..8358bcd 100644 --- a/Doxygen/build/Matrix4x4_8h_source.html +++ b/Doxygen/build/Matrix4x4_8h_source.html @@ -226,7 +226,7 @@ $(function() {
Eule::Matrix4x4::d
double & d
Definition: Matrix4x4.h:131
diff --git a/Doxygen/build/Quaternion_8cpp.html b/Doxygen/build/Quaternion_8cpp.html index f498be6..2ef11a9 100644 --- a/Doxygen/build/Quaternion_8cpp.html +++ b/Doxygen/build/Quaternion_8cpp.html @@ -121,7 +121,7 @@ Functions diff --git a/Doxygen/build/Quaternion_8cpp_source.html b/Doxygen/build/Quaternion_8cpp_source.html index f05bce4..6768fa0 100644 --- a/Doxygen/build/Quaternion_8cpp_source.html +++ b/Doxygen/build/Quaternion_8cpp_source.html @@ -468,7 +468,7 @@ $(function() {
Eule::Vector4< double >
diff --git a/Doxygen/build/Quaternion_8h.html b/Doxygen/build/Quaternion_8h.html index c722e15..06407f5 100644 --- a/Doxygen/build/Quaternion_8h.html +++ b/Doxygen/build/Quaternion_8h.html @@ -126,7 +126,7 @@ Namespaces diff --git a/Doxygen/build/Quaternion_8h_source.html b/Doxygen/build/Quaternion_8h_source.html index 74ce721..1c49620 100644 --- a/Doxygen/build/Quaternion_8h_source.html +++ b/Doxygen/build/Quaternion_8h_source.html @@ -186,7 +186,7 @@ $(function() {
Eule::Vector4< double >
diff --git a/Doxygen/build/Rect_8h.html b/Doxygen/build/Rect_8h.html index 9c46799..8c90be9 100644 --- a/Doxygen/build/Rect_8h.html +++ b/Doxygen/build/Rect_8h.html @@ -109,7 +109,7 @@ Namespaces diff --git a/Doxygen/build/Rect_8h_source.html b/Doxygen/build/Rect_8h_source.html index 1a41472..22ec769 100644 --- a/Doxygen/build/Rect_8h_source.html +++ b/Doxygen/build/Rect_8h_source.html @@ -96,7 +96,7 @@ $(function() {
Eule
Definition: Collider.h:4
diff --git a/Doxygen/build/TrapazoidalPrismCollider_8cpp.html b/Doxygen/build/TrapazoidalPrismCollider_8cpp.html index bda753b..db68681 100644 --- a/Doxygen/build/TrapazoidalPrismCollider_8cpp.html +++ b/Doxygen/build/TrapazoidalPrismCollider_8cpp.html @@ -101,7 +101,7 @@ Include dependency graph for TrapazoidalPrismCollider.cpp: diff --git a/Doxygen/build/TrapazoidalPrismCollider_8cpp_source.html b/Doxygen/build/TrapazoidalPrismCollider_8cpp_source.html index c6f8dd8..ffdb8b0 100644 --- a/Doxygen/build/TrapazoidalPrismCollider_8cpp_source.html +++ b/Doxygen/build/TrapazoidalPrismCollider_8cpp_source.html @@ -205,7 +205,7 @@ $(function() {
Eule
Definition: Collider.h:4
diff --git a/Doxygen/build/TrapazoidalPrismCollider_8h.html b/Doxygen/build/TrapazoidalPrismCollider_8h.html index 93fe8f9..439dd56 100644 --- a/Doxygen/build/TrapazoidalPrismCollider_8h.html +++ b/Doxygen/build/TrapazoidalPrismCollider_8h.html @@ -126,7 +126,7 @@ Namespaces diff --git a/Doxygen/build/TrapazoidalPrismCollider_8h_source.html b/Doxygen/build/TrapazoidalPrismCollider_8h_source.html index 500012f..79e9dc3 100644 --- a/Doxygen/build/TrapazoidalPrismCollider_8h_source.html +++ b/Doxygen/build/TrapazoidalPrismCollider_8h_source.html @@ -150,7 +150,7 @@ $(function() {
Eule
Definition: Collider.h:4
diff --git a/Doxygen/build/Vector2_8cpp.html b/Doxygen/build/Vector2_8cpp.html index 230f8e5..d395002 100644 --- a/Doxygen/build/Vector2_8cpp.html +++ b/Doxygen/build/Vector2_8cpp.html @@ -88,16 +88,17 @@ Include dependency graph for Vector2.cpp:
- + - - - - - + + + + + + @@ -110,7 +111,7 @@ Include dependency graph for Vector2.cpp:
diff --git a/Doxygen/build/Vector2_8cpp__incl.map b/Doxygen/build/Vector2_8cpp__incl.map index 4da9149..4c2de4a 100644 --- a/Doxygen/build/Vector2_8cpp__incl.map +++ b/Doxygen/build/Vector2_8cpp__incl.map @@ -1,17 +1,18 @@ - + - - - - - + + + + + - - - - - + + + + + + diff --git a/Doxygen/build/Vector2_8cpp__incl.md5 b/Doxygen/build/Vector2_8cpp__incl.md5 index 9794b11..67ab26c 100644 --- a/Doxygen/build/Vector2_8cpp__incl.md5 +++ b/Doxygen/build/Vector2_8cpp__incl.md5 @@ -1 +1 @@ -b35543da7b888c6bd84dab2507034d1c \ No newline at end of file +deda7dfc8579dff3057c04f6c146a99e \ No newline at end of file diff --git a/Doxygen/build/Vector2_8cpp__incl.png b/Doxygen/build/Vector2_8cpp__incl.png index a8c0654..eecfd00 100644 Binary files a/Doxygen/build/Vector2_8cpp__incl.png and b/Doxygen/build/Vector2_8cpp__incl.png differ diff --git a/Doxygen/build/Vector2_8cpp_source.html b/Doxygen/build/Vector2_8cpp_source.html index 38074bc..de69a53 100644 --- a/Doxygen/build/Vector2_8cpp_source.html +++ b/Doxygen/build/Vector2_8cpp_source.html @@ -794,7 +794,7 @@ $(function() {
Eule::Vector4
Representation of a 4d vector.
Definition: Vector2.h:8
diff --git a/Doxygen/build/Vector2_8h.html b/Doxygen/build/Vector2_8h.html index 1eb3660..a8d925d 100644 --- a/Doxygen/build/Vector2_8h.html +++ b/Doxygen/build/Vector2_8h.html @@ -135,7 +135,7 @@ Typedefs diff --git a/Doxygen/build/Vector2_8h_source.html b/Doxygen/build/Vector2_8h_source.html index 08aac2a..1569dea 100644 --- a/Doxygen/build/Vector2_8h_source.html +++ b/Doxygen/build/Vector2_8h_source.html @@ -208,7 +208,7 @@ $(function() {
Eule::Vector2i
Vector2< int > Vector2i
Definition: Vector2.h:101
diff --git a/Doxygen/build/Vector3_8cpp.html b/Doxygen/build/Vector3_8cpp.html index fa5ea5a..b2c929a 100644 --- a/Doxygen/build/Vector3_8cpp.html +++ b/Doxygen/build/Vector3_8cpp.html @@ -88,13 +88,13 @@ Include dependency graph for Vector3.cpp:
- - - - - + + + + + - + @@ -103,6 +103,7 @@ Include dependency graph for Vector3.cpp:
+ @@ -110,7 +111,7 @@ Include dependency graph for Vector3.cpp: diff --git a/Doxygen/build/Vector3_8cpp__incl.map b/Doxygen/build/Vector3_8cpp__incl.map index 1d7cea3..fee91e1 100644 --- a/Doxygen/build/Vector3_8cpp__incl.map +++ b/Doxygen/build/Vector3_8cpp__incl.map @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + @@ -14,4 +14,5 @@ + diff --git a/Doxygen/build/Vector3_8cpp__incl.md5 b/Doxygen/build/Vector3_8cpp__incl.md5 index c6df49e..2cda40e 100644 --- a/Doxygen/build/Vector3_8cpp__incl.md5 +++ b/Doxygen/build/Vector3_8cpp__incl.md5 @@ -1 +1 @@ -1afca43d443611dd35343256967edfc8 \ No newline at end of file +789550095991799f4f64ce3613fef44a \ No newline at end of file diff --git a/Doxygen/build/Vector3_8cpp__incl.png b/Doxygen/build/Vector3_8cpp__incl.png index b1b1b90..4934660 100644 Binary files a/Doxygen/build/Vector3_8cpp__incl.png and b/Doxygen/build/Vector3_8cpp__incl.png differ diff --git a/Doxygen/build/Vector3_8cpp_source.html b/Doxygen/build/Vector3_8cpp_source.html index 108de5d..a504a5e 100644 --- a/Doxygen/build/Vector3_8cpp_source.html +++ b/Doxygen/build/Vector3_8cpp_source.html @@ -999,7 +999,7 @@ $(function() {
Eule::Vector4
Representation of a 4d vector.
Definition: Vector2.h:8
diff --git a/Doxygen/build/Vector3_8h.html b/Doxygen/build/Vector3_8h.html index a118c17..347a9c3 100644 --- a/Doxygen/build/Vector3_8h.html +++ b/Doxygen/build/Vector3_8h.html @@ -147,7 +147,7 @@ Typedefs diff --git a/Doxygen/build/Vector3_8h_source.html b/Doxygen/build/Vector3_8h_source.html index 58838eb..cd65950 100644 --- a/Doxygen/build/Vector3_8h_source.html +++ b/Doxygen/build/Vector3_8h_source.html @@ -219,7 +219,7 @@ $(function() {
Eule::Vector3::VectorScale
Vector3< T > VectorScale(const Vector3< T > &scalar) const
Will scale self.n by scalar.n.
Definition: Vector3.cpp:135
diff --git a/Doxygen/build/Vector4_8cpp.html b/Doxygen/build/Vector4_8cpp.html index b85feee..3c0e4aa 100644 --- a/Doxygen/build/Vector4_8cpp.html +++ b/Doxygen/build/Vector4_8cpp.html @@ -88,13 +88,13 @@ Include dependency graph for Vector4.cpp:
- - - - - + + + + + - + @@ -103,6 +103,7 @@ Include dependency graph for Vector4.cpp:
+ @@ -110,7 +111,7 @@ Include dependency graph for Vector4.cpp: diff --git a/Doxygen/build/Vector4_8cpp__incl.map b/Doxygen/build/Vector4_8cpp__incl.map index faa7a6d..a6df62c 100644 --- a/Doxygen/build/Vector4_8cpp__incl.map +++ b/Doxygen/build/Vector4_8cpp__incl.map @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + @@ -14,4 +14,5 @@ + diff --git a/Doxygen/build/Vector4_8cpp__incl.md5 b/Doxygen/build/Vector4_8cpp__incl.md5 index 59af498..ff91198 100644 --- a/Doxygen/build/Vector4_8cpp__incl.md5 +++ b/Doxygen/build/Vector4_8cpp__incl.md5 @@ -1 +1 @@ -0823430d67194eb6b1547166859dfe71 \ No newline at end of file +6edd4b6a266f3a86f459e12460ef3060 \ No newline at end of file diff --git a/Doxygen/build/Vector4_8cpp__incl.png b/Doxygen/build/Vector4_8cpp__incl.png index 25b7995..0007259 100644 Binary files a/Doxygen/build/Vector4_8cpp__incl.png and b/Doxygen/build/Vector4_8cpp__incl.png differ diff --git a/Doxygen/build/Vector4_8cpp_source.html b/Doxygen/build/Vector4_8cpp_source.html index 23ca30f..3116a5b 100644 --- a/Doxygen/build/Vector4_8cpp_source.html +++ b/Doxygen/build/Vector4_8cpp_source.html @@ -906,7 +906,7 @@ $(function() {
Eule::Vector4
Representation of a 4d vector.
Definition: Vector2.h:8
diff --git a/Doxygen/build/Vector4_8h.html b/Doxygen/build/Vector4_8h.html index 9dfdeeb..ea2127f 100644 --- a/Doxygen/build/Vector4_8h.html +++ b/Doxygen/build/Vector4_8h.html @@ -144,7 +144,7 @@ Typedefs diff --git a/Doxygen/build/Vector4_8h_source.html b/Doxygen/build/Vector4_8h_source.html index 0dfaaa3..9f2680b 100644 --- a/Doxygen/build/Vector4_8h_source.html +++ b/Doxygen/build/Vector4_8h_source.html @@ -219,7 +219,7 @@ $(function() {
Eule::Vector4
Representation of a 4d vector.
Definition: Vector2.h:8
diff --git a/Doxygen/build/annotated.html b/Doxygen/build/annotated.html index ff237b5..801b6e4 100644 --- a/Doxygen/build/annotated.html +++ b/Doxygen/build/annotated.html @@ -90,7 +90,7 @@ $(function() { diff --git a/Doxygen/build/classEule_1_1Collider-members.html b/Doxygen/build/classEule_1_1Collider-members.html index 95dcfb0..fd919cf 100644 --- a/Doxygen/build/classEule_1_1Collider-members.html +++ b/Doxygen/build/classEule_1_1Collider-members.html @@ -84,7 +84,7 @@ $(function() { diff --git a/Doxygen/build/classEule_1_1Collider.html b/Doxygen/build/classEule_1_1Collider.html index 6c3a374..b33fce5 100644 --- a/Doxygen/build/classEule_1_1Collider.html +++ b/Doxygen/build/classEule_1_1Collider.html @@ -143,7 +143,7 @@ Public Member Functions diff --git a/Doxygen/build/classEule_1_1Math-members.html b/Doxygen/build/classEule_1_1Math-members.html index 4d3f1e0..e78a44b 100644 --- a/Doxygen/build/classEule_1_1Math-members.html +++ b/Doxygen/build/classEule_1_1Math-members.html @@ -85,18 +85,19 @@ $(function() { Lerp(double a, double b, double t)Eule::Mathinlinestatic Max(const double a, const double b)Eule::Mathinlinestatic Min(const double a, const double b)Eule::Mathinlinestatic - Oscillate(const double a, const double b, const double counter, const double speed)Eule::Mathstatic - Random()Eule::Mathstatic - RandomChance(const double chance)Eule::Mathstatic - RandomInt()Eule::Mathstatic - RandomIntRange(const int max, const int min)Eule::Mathstatic - RandomRange(const double min, const double max)Eule::Mathstatic - RandomUint()Eule::Mathstatic - Similar(const double a, const double b, const double epsilon=0.00001)Eule::Mathstatic + Mod(const int numerator, const int denominator)Eule::Mathstatic + Oscillate(const double a, const double b, const double counter, const double speed)Eule::Mathstatic + Random()Eule::Mathstatic + RandomChance(const double chance)Eule::Mathstatic + RandomInt()Eule::Mathstatic + RandomIntRange(const int max, const int min)Eule::Mathstatic + RandomRange(const double min, const double max)Eule::Mathstatic + RandomUint()Eule::Mathstatic + Similar(const double a, const double b, const double epsilon=0.00001)Eule::Mathinlinestatic diff --git a/Doxygen/build/classEule_1_1Math.html b/Doxygen/build/classEule_1_1Math.html index c35ac43..05619a9 100644 --- a/Doxygen/build/classEule_1_1Math.html +++ b/Doxygen/build/classEule_1_1Math.html @@ -103,9 +103,12 @@ Static Public Member Functions static constexpr double Abs (const double a)  Will return the absolute value of a More...
  -static constexpr bool Similar (const double a, const double b, const double epsilon=0.00001) - Compares two double values with a given accuracy. More...
-  +static constexpr bool Similar (const double a, const double b, const double epsilon=0.00001) + Compares two double values with a given accuracy. More...
+  +static int Mod (const int numerator, const int denominator) + Will compute the actual modulo of a fraction. More...
+  static double Random ()  Will return a random double between 0 and 1 More...
  @@ -132,7 +135,7 @@ Static Public Member Functions

Detailed Description

Math utility class containing basic functions.

-

Definition at line 8 of file Math.h.

+

Definition at line 9 of file Math.h.

Member Function Documentation

◆ Abs()

@@ -160,10 +163,10 @@ Static Public Member Functions

Will return the absolute value of a

-

Definition at line 92 of file Math.h.

-
93  {
-
94  return (a > 0.0) ? a : -a;
-
95  }
+

Definition at line 97 of file Math.h.

+
98  {
+
99  return (a > 0.0) ? a : -a;
+
100  }
@@ -209,10 +212,10 @@ Static Public Member Functions

Will return v, but at least min, and at most max

-

Definition at line 81 of file Math.h.

-
82  {
-
83  return Max(Min(v, max), min);
-
84  }
+

Definition at line 86 of file Math.h.

+
87  {
+
88  return Max(Min(v, max), min);
+
89  }
@@ -258,11 +261,11 @@ Static Public Member Functions

Will return the linear interpolation between a and b by t

-

Definition at line 86 of file Math.h.

-
87  {
-
88  const double it = 1.0 - t;
-
89  return (a * it) + (b * t);
-
90  }
+

Definition at line 91 of file Math.h.

+
92  {
+
93  const double it = 1.0 - t;
+
94  return (a * it) + (b * t);
+
95  }
@@ -302,10 +305,10 @@ Static Public Member Functions

Will return the bigger of two values.

-

Definition at line 71 of file Math.h.

-
72  {
-
73  return (a > b) ? a : b;
-
74  }
+

Definition at line 76 of file Math.h.

+
77  {
+
78  return (a > b) ? a : b;
+
79  }
@@ -345,10 +348,68 @@ Static Public Member Functions

Will return the smaller of two values.

-

Definition at line 76 of file Math.h.

-
77  {
-
78  return (a < b) ? a : b;
-
79  }
+

Definition at line 81 of file Math.h.

+
82  {
+
83  return (a < b) ? a : b;
+
84  }
+
+
+ + +

◆ Mod()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
int Math::Mod (const int numerator,
const int denominator 
)
+
+static
+
+ +

Will compute the actual modulo of a fraction.

+

The % operator returns bs for n<0. May throw divide-by-zero std::logic_error

+ +

Definition at line 78 of file Math.cpp.

+
79 {
+
80  if (denominator == 0)
+
81  throw std::logic_error("Divide by zero");
+
82 
+
83  // Quick optimizations:
+
84 
+
85  // -> 0/n is always 0
+
86  if (numerator == 0)
+
87  return 0;
+
88 
+
89  // -> operator% works for a > 0 && b > 0
+
90  if (denominator > 0 && numerator > 0)
+
91  return numerator % denominator;
+
92 
+
93  // Else: generalized formula
+
94  return (denominator + (numerator % denominator)) % denominator;
+
95 }
@@ -637,8 +698,8 @@ Static Public Member Functions - -

◆ Similar()

+ +

◆ Similar()

@@ -647,7 +708,7 @@ Static Public Member Functions - + @@ -672,13 +733,18 @@ Static Public Member Functions
static constexpr bool Eule::Math::Similar constexpr bool Eule::Math::Similar ( const double  a,
-staticconstexpr +inlinestaticconstexpr

Compares two double values with a given accuracy.

+

Definition at line 102 of file Math.h.

+
103  {
+
104  return Abs(a - b) <= epsilon;
+
105  }
+

The documentation for this class was generated from the following files: