Merge pull request #11 from orange-cpp/u/orange_cpp/moved_to_hpp

moving to hpp & addition improvements
This commit is contained in:
2024-10-20 09:16:01 -07:00
committed by GitHub
34 changed files with 126 additions and 121 deletions

View File

@@ -4,9 +4,9 @@
#pragma once #pragma once
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
#include <cstdint> #include <cstdint>
#include "omath/Vector4.h" #include "omath/Vector4.hpp"
namespace omath namespace omath

View File

@@ -6,25 +6,24 @@
#include <array> #include <array>
#include <sstream> #include <sstream>
#include <utility> #include <utility>
#include "Vector3.h" #include "Vector3.hpp"
#include <stdexcept> #include <stdexcept>
#include "Angles.h" #include "Angles.hpp"
namespace omath namespace omath
{ {
template <size_t Rows, size_t Columns> template<size_t Rows, size_t Columns, class Type = float>
class Mat final class Mat final
{ {
public: public:
constexpr Mat() constexpr Mat()
{ {
Clear(); Clear();
} }
constexpr Mat(const std::initializer_list<std::initializer_list<float>>& rows) constexpr Mat(const std::initializer_list<std::initializer_list<Type> > &rows)
{ {
if (rows.size() != Rows) if (rows.size() != Rows)
throw std::invalid_argument("Initializer list rows size does not match template parameter Rows"); throw std::invalid_argument("Initializer list rows size does not match template parameter Rows");
@@ -33,7 +32,8 @@ namespace omath
for (size_t i = 0; i < Rows; ++i, ++rowIt) for (size_t i = 0; i < Rows; ++i, ++rowIt)
{ {
if (rowIt->size() != Columns) if (rowIt->size() != Columns)
throw std::invalid_argument("All rows must have the same number of columns as template parameter Columns"); throw std::invalid_argument(
"All rows must have the same number of columns as template parameter Columns");
auto colIt = rowIt->begin(); auto colIt = rowIt->begin();
for (size_t j = 0; j < Columns; ++j, ++colIt) for (size_t j = 0; j < Columns; ++j, ++colIt)
@@ -44,13 +44,13 @@ namespace omath
} }
constexpr Mat(const Mat& other) constexpr Mat(const Mat &other) noexcept
{ {
m_data = other.m_data; m_data = other.m_data;
} }
constexpr Mat(Mat&& other) noexcept constexpr Mat(Mat &&other) noexcept
{ {
m_data = std::move(other.m_data); m_data = std::move(other.m_data);
} }
@@ -62,24 +62,26 @@ namespace omath
static consteval size_t ColumnsCount() noexcept { return Columns; } static consteval size_t ColumnsCount() noexcept { return Columns; }
[[nodiscard]] [[nodiscard]]
static consteval std::pair<size_t, size_t> Size() noexcept { return { Rows, Columns }; } static consteval std::pair<size_t, size_t> Size() noexcept { return {Rows, Columns}; }
[[nodiscard]] constexpr const float& At(const size_t rowIndex, const size_t columnIndex) const [[nodiscard]] constexpr const Type &At(const size_t rowIndex, const size_t columnIndex) const
{ {
if (rowIndex >= Rows || columnIndex >= Columns) if (rowIndex >= Rows || columnIndex >= Columns)
throw std::out_of_range("Index out of range"); throw std::out_of_range("Index out of range");
return m_data[rowIndex * Columns + columnIndex]; return m_data[rowIndex * Columns + columnIndex];
} }
[[nodiscard]] constexpr float& At(const size_t rowIndex, const size_t columnIndex)
[[nodiscard]] constexpr Type &At(const size_t rowIndex, const size_t columnIndex)
{ {
return const_cast<float&>(std::as_const(*this).At(rowIndex, columnIndex)); return const_cast<Type &>(std::as_const(*this).At(rowIndex, columnIndex));
} }
[[nodiscard]] [[nodiscard]]
constexpr float Sum() const constexpr Type Sum() const noexcept
{ {
float sum = 0.f; Type sum = 0;
for (size_t i = 0; i < Rows; ++i) for (size_t i = 0; i < Rows; ++i)
for (size_t j = 0; j < Columns; ++j) for (size_t j = 0; j < Columns; ++j)
sum += At(i, j); sum += At(i, j);
@@ -87,25 +89,26 @@ namespace omath
return sum; return sum;
} }
constexpr void Clear() constexpr void Clear() noexcept
{ {
Set(0.f); Set(0);
} }
constexpr void Set(const float value) constexpr void Set(const Type &value) noexcept
{ {
std::ranges::fill(m_data, value); std::ranges::fill(m_data, value);
} }
// Operator overloading for multiplication with another Mat // Operator overloading for multiplication with another Mat
template <size_t OtherColumns> template<size_t OtherColumns>
constexpr Mat<Rows, OtherColumns> operator*(const Mat<Columns, OtherColumns>& other) const constexpr Mat<Rows, OtherColumns> operator*(const Mat<Columns, OtherColumns> &other) const
{ {
Mat<Rows, OtherColumns> result; Mat<Rows, OtherColumns> result;
for (size_t i = 0; i < Rows; ++i) for (size_t i = 0; i < Rows; ++i)
for (size_t j = 0; j < OtherColumns; ++j) for (size_t j = 0; j < OtherColumns; ++j)
{ {
float sum = 0.f; Type sum = 0;
for (size_t k = 0; k < Columns; ++k) for (size_t k = 0; k < Columns; ++k)
sum += At(i, k) * other.At(k, j); sum += At(i, k) * other.At(k, j);
result.At(i, j) = sum; result.At(i, j) = sum;
@@ -113,7 +116,7 @@ namespace omath
return result; return result;
} }
constexpr Mat& operator*=(float f) constexpr Mat &operator*=(Type f) noexcept
{ {
for (size_t i = 0; i < Rows; ++i) for (size_t i = 0; i < Rows; ++i)
for (size_t j = 0; j < Columns; ++j) for (size_t j = 0; j < Columns; ++j)
@@ -121,20 +124,20 @@ namespace omath
return *this; return *this;
} }
template <size_t OtherColumns> template<size_t OtherColumns>
constexpr Mat<Rows, OtherColumns> operator*=(const Mat<Columns, OtherColumns>& other) constexpr Mat<Rows, OtherColumns> operator*=(const Mat<Columns, OtherColumns> &other)
{ {
return *this = *this * other; return *this = *this * other;
} }
constexpr Mat operator*(float f) const constexpr Mat operator*(const Type &f) const noexcept
{ {
Mat result(*this); Mat result(*this);
result *= f; result *= f;
return result; return result;
} }
constexpr Mat& operator/=(float f) constexpr Mat &operator/=(const Type &f) noexcept
{ {
for (size_t i = 0; i < Rows; ++i) for (size_t i = 0; i < Rows; ++i)
for (size_t j = 0; j < Columns; ++j) for (size_t j = 0; j < Columns; ++j)
@@ -142,14 +145,14 @@ namespace omath
return *this; return *this;
} }
constexpr Mat operator/(float f) const constexpr Mat operator/(const Type &f) const noexcept
{ {
Mat result(*this); Mat result(*this);
result /= f; result /= f;
return result; return result;
} }
constexpr Mat& operator=(const Mat& other) constexpr Mat &operator=(const Mat &other) noexcept
{ {
if (this == &other) if (this == &other)
return *this; return *this;
@@ -159,7 +162,7 @@ namespace omath
return *this; return *this;
} }
constexpr Mat& operator=(Mat&& other) noexcept constexpr Mat &operator=(Mat &&other) noexcept
{ {
if (this == &other) if (this == &other)
return *this; return *this;
@@ -172,7 +175,7 @@ namespace omath
} }
[[nodiscard]] [[nodiscard]]
constexpr Mat<Columns, Rows> Transpose() const constexpr Mat<Columns, Rows> Transpose() const noexcept
{ {
Mat<Columns, Rows> transposed; Mat<Columns, Rows> transposed;
for (size_t i = 0; i < Rows; ++i) for (size_t i = 0; i < Rows; ++i)
@@ -183,7 +186,7 @@ namespace omath
} }
[[nodiscard]] [[nodiscard]]
constexpr float Determinant() const constexpr Type Determinant() const
{ {
static_assert(Rows == Columns, "Determinant is only defined for square matrices."); static_assert(Rows == Columns, "Determinant is only defined for square matrices.");
@@ -194,10 +197,10 @@ namespace omath
return At(0, 0) * At(1, 1) - At(0, 1) * At(1, 0); return At(0, 0) * At(1, 1) - At(0, 1) * At(1, 0);
else else
{ {
float det = 0.f; Type det = 0;
for (size_t i = 0; i < Columns; ++i) for (size_t i = 0; i < Columns; ++i)
{ {
const float cofactor = (i % 2 == 0 ? 1.f : -1.f) * At(0, i) * Minor(0, i).Determinant(); const Type cofactor = (i % 2 == 0 ? 1 : -1) * At(0, i) * Minor(0, i).Determinant();
det += cofactor; det += cofactor;
} }
return det; return det;
@@ -225,7 +228,7 @@ namespace omath
} }
[[nodiscard]] [[nodiscard]]
std::string ToString() const std::string ToString() const noexcept
{ {
std::ostringstream oss; std::ostringstream oss;
for (size_t i = 0; i < Rows; ++i) for (size_t i = 0; i < Rows; ++i)
@@ -243,58 +246,59 @@ namespace omath
// Static methods that return fixed-size matrices // Static methods that return fixed-size matrices
[[nodiscard]] [[nodiscard]]
constexpr static Mat<4, 4> ToScreenMat(const float screenWidth, const float screenHeight) constexpr static Mat<4, 4> ToScreenMat(const Type &screenWidth, const Type &screenHeight) noexcept
{ {
return return
{ {
{screenWidth / 2.f, 0.f, 0.f, 0.f}, {screenWidth / 2, 0, 0, 0},
{0.f, -screenHeight / 2.f, 0.f, 0.f}, {0, -screenHeight / 2, 0, 0},
{0.f, 0.f, 1.f, 0.f}, {0, 0, 1, 0},
{screenWidth / 2.f, screenHeight / 2.f, 0.f, 1.f}, {screenWidth / 2, screenHeight / 2, 0, 1},
};
}
[[nodiscard]]
constexpr static Mat<4, 4> TranslationMat(const Vector3& diff)
{
return
{
{1.f, 0.f, 0.f, 0.f},
{0.f, 1.f, 0.f, 0.f},
{0.f, 0.f, 1.f, 0.f},
{diff.x, diff.y, diff.z, 1.f},
}; };
} }
[[nodiscard]] [[nodiscard]]
constexpr static Mat<4, 4> OrientationMat(const Vector3& forward, const Vector3& right, const Vector3& up) constexpr static Mat<4, 4> TranslationMat(const Vector3 &diff) noexcept
{ {
return return
{ {
{right.x, up.x, forward.x, 0.f}, {1, 0, 0, 0},
{right.y, up.y, forward.y, 0.f}, {0, 1, 0, 0},
{right.z, up.z, forward.z, 0.f}, {0, 0, 1, 0},
{0.f, 0.f, 0.f, 1.f}, {diff.x, diff.y, diff.z, 1},
}; };
} }
[[nodiscard]] [[nodiscard]]
constexpr static Mat<4, 4> ProjectionMat(const float fieldOfView, const float aspectRatio, constexpr static Mat<4, 4> OrientationMat(const Vector3 &forward, const Vector3 &right,
const float near, const float far, const float lensZoom) const Vector3 &up) noexcept
{ {
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f); return
const float frustumHeight = far - near; {
{right.x, up.x, forward.x, 0},
{right.y, up.y, forward.y, 0},
{right.z, up.z, forward.z, 0},
{0, 0, 0, 1},
};
}
[[nodiscard]]
constexpr static Mat<4, 4> ProjectionMat(const Type &fieldOfView, const Type &aspectRatio,
const Type &near, const Type &far, const Type &lensZoom) noexcept
{
const Type &fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2);
const Type &frustumHeight = far - near;
return return
{ {
{-1.f / (aspectRatio * fovHalfTan) * lensZoom, 0.f, 0.f, 0.f}, {-1 / (aspectRatio * fovHalfTan) * lensZoom, 0, 0, 0},
{0.f, -1.f / fovHalfTan * lensZoom, 0.f, 0.f}, {0, -1 / fovHalfTan * lensZoom, 0, 0},
{0.f, 0.f, -far / frustumHeight, -1}, {0, 0, -far / frustumHeight, -1},
{0.f, 0.f, near * far / frustumHeight, 0.f} {0, 0, near * far / frustumHeight, 0}
}; };
} }
private: private:
std::array<float, Rows*Columns> m_data; std::array<Type, Rows * Columns> m_data;
}; };
} }

View File

@@ -18,7 +18,7 @@ namespace omath
// Constructors // Constructors
constexpr Vector2() : x(0.f), y(0.f) {} constexpr Vector2() : x(0.f), y(0.f) {}
constexpr Vector2(float x, float y) : x(x), y(y) {} constexpr Vector2(const float x, const float y) : x(x), y(y) {}
// Equality operators // Equality operators
[[nodiscard]] [[nodiscard]]

View File

@@ -6,7 +6,7 @@
#include <cstdint> #include <cstdint>
#include <functional> #include <functional>
#include "omath/Vector2.h" #include "omath/Vector2.hpp"
namespace omath namespace omath

View File

@@ -3,7 +3,7 @@
// //
#pragma once #pragma once
#include <omath/Vector3.h> #include <omath/Vector3.hpp>
#include <algorithm> #include <algorithm>

View File

@@ -4,8 +4,8 @@
#pragma once #pragma once
#include <vector> #include <vector>
#include "NavigationMesh.h" #include "NavigationMesh.hpp"
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
namespace omath::pathfinding namespace omath::pathfinding

View File

@@ -4,7 +4,7 @@
#pragma once #pragma once
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
#include <expected> #include <expected>
#include <vector> #include <vector>
#include <string> #include <string>

View File

@@ -5,9 +5,9 @@
#pragma once #pragma once
#include <optional> #include <optional>
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
#include "omath/prediction/Projectile.h" #include "omath/prediction/Projectile.hpp"
#include "omath/prediction/Target.h" #include "omath/prediction/Target.hpp"
namespace omath::prediction namespace omath::prediction

View File

@@ -3,7 +3,7 @@
// //
#pragma once #pragma once
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
namespace omath::prediction namespace omath::prediction

View File

@@ -3,7 +3,7 @@
// //
#pragma once #pragma once
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
namespace omath::prediction namespace omath::prediction

View File

@@ -5,10 +5,10 @@
#pragma once #pragma once
#include <expected> #include <expected>
#include <omath/Vector3.h> #include <omath/Vector3.hpp>
#include <omath/Mat.h> #include <omath/Mat.hpp>
#include <string_view> #include <string_view>
#include "ErrorCodes.h" #include "ErrorCodes.hpp"
namespace omath::projection namespace omath::projection

View File

@@ -1,6 +1,6 @@
#include "omath/Matrix.h" #include "omath/Matrix.hpp"
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
#include "omath/Angles.h" #include "omath/Angles.hpp"
#include <format> #include <format>

View File

@@ -1,7 +1,7 @@
// //
// Created by Vlad on 02.09.2024. // Created by Vlad on 02.09.2024.
// //
#include "omath/Vector2.h" #include "omath/Vector2.hpp"
#include <cmath> #include <cmath>

View File

@@ -2,9 +2,9 @@
// Created by vlad on 10/28/23. // Created by vlad on 10/28/23.
// //
#include <omath/Vector3.h> #include <omath/Vector3.hpp>
#include <cmath> #include <cmath>
#include <omath/Angles.h> #include <omath/Angles.hpp>
namespace omath namespace omath
{ {

View File

@@ -2,7 +2,7 @@
// Vector4.cpp // Vector4.cpp
// //
#include "omath/Vector4.h" #include "omath/Vector4.hpp"
#include <cmath> #include <cmath>

View File

@@ -2,7 +2,7 @@
// Created by vlad on 2/4/24. // Created by vlad on 2/4/24.
// //
#include "omath/Color.h" #include "omath/Color.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>

View File

@@ -1,7 +1,7 @@
// //
// Created by Vlad on 28.07.2024. // Created by Vlad on 28.07.2024.
// //
#include "omath/pathfinding/Astar.h" #include "omath/pathfinding/Astar.hpp"
#include <optional> #include <optional>
#include <unordered_map> #include <unordered_map>

View File

@@ -1,7 +1,7 @@
// //
// Created by Vlad on 28.07.2024. // Created by Vlad on 28.07.2024.
// //
#include "omath/pathfinding/NavigationMesh.h" #include "omath/pathfinding/NavigationMesh.hpp"
#include <stdexcept> #include <stdexcept>
#include <algorithm> #include <algorithm>

View File

@@ -3,19 +3,19 @@
// //
#include "omath/prediction/Engine.h" #include "omath/prediction/Engine.hpp"
#include <cmath> #include <cmath>
#include <omath/Angles.h> #include <omath/Angles.hpp>
namespace omath::prediction namespace omath::prediction
{ {
Engine::Engine(const float gravityConstant, const float simulationTimeStep, Engine::Engine(const float gravityConstant, const float simulationTimeStep,
const float maximumSimulationTime, const float distanceTolerance) const float maximumSimulationTime, const float distanceTolerance)
: m_gravityConstant(gravityConstant), : m_gravityConstant(gravityConstant),
m_simulationTimeStep(simulationTimeStep), m_simulationTimeStep(simulationTimeStep),
m_maximumSimulationTime(maximumSimulationTime), m_maximumSimulationTime(maximumSimulationTime),
m_distanceTolerance(distanceTolerance) m_distanceTolerance(distanceTolerance)
{ {
} }
@@ -28,7 +28,7 @@ namespace omath::prediction
const auto projectilePitch = MaybeCalculateProjectileLaunchPitchAngle(projectile, predictedTargetPosition); const auto projectilePitch = MaybeCalculateProjectileLaunchPitchAngle(projectile, predictedTargetPosition);
if (!projectilePitch.has_value()) [[unlikely]] if (!projectilePitch.has_value()) [[unlikely]]
continue; continue;
if (!IsProjectileReachedTarget(predictedTargetPosition, projectile, projectilePitch.value(), time)) if (!IsProjectileReachedTarget(predictedTargetPosition, projectile, projectilePitch.value(), time))
continue; continue;
@@ -42,19 +42,20 @@ namespace omath::prediction
} }
std::optional<float> Engine::MaybeCalculateProjectileLaunchPitchAngle(const Projectile &projectile, std::optional<float> Engine::MaybeCalculateProjectileLaunchPitchAngle(const Projectile &projectile,
const Vector3 &targetPosition) const const Vector3 &targetPosition) const
{ {
const auto bulletGravity = m_gravityConstant * projectile.m_gravityScale; const auto bulletGravity = m_gravityConstant * projectile.m_gravityScale;
const auto delta = targetPosition - projectile.m_origin; const auto delta = targetPosition - projectile.m_origin;
const auto distance2d = delta.Length2D(); const auto distance2d = delta.Length2D();
const auto distance2dSqr = distance2d * distance2d;
const auto launchSpeedSqr = projectile.m_launchSpeed * projectile.m_launchSpeed;
float root = launchSpeedSqr * launchSpeedSqr - bulletGravity * (bulletGravity *
float root = std::pow(projectile.m_launchSpeed, 4.f) - bulletGravity * (bulletGravity * distance2dSqr + 2.0f * delta.z * launchSpeedSqr);
std::pow(distance2d, 2.f) + 2.0f * delta.z * std::pow(projectile.m_launchSpeed, 2.f));
if (root < 0.0f) [[unlikely]] if (root < 0.0f) [[unlikely]]
return std::nullopt; return std::nullopt;
root = std::sqrt(root); root = std::sqrt(root);
const float angle = std::atan((std::pow(projectile.m_launchSpeed, 2.f) - root) / (bulletGravity * distance2d)); const float angle = std::atan((std::pow(projectile.m_launchSpeed, 2.f) - root) / (bulletGravity * distance2d));
@@ -63,7 +64,7 @@ namespace omath::prediction
} }
bool Engine::IsProjectileReachedTarget(const Vector3 &targetPosition, const Projectile &projectile, bool Engine::IsProjectileReachedTarget(const Vector3 &targetPosition, const Projectile &projectile,
const float pitch, const float time) const const float pitch, const float time) const
{ {
const auto yaw = projectile.m_origin.ViewAngleTo(targetPosition).y; const auto yaw = projectile.m_origin.ViewAngleTo(targetPosition).y;
const auto projectilePosition = projectile.PredictPosition(pitch, yaw, time, m_gravityConstant); const auto projectilePosition = projectile.PredictPosition(pitch, yaw, time, m_gravityConstant);

View File

@@ -2,7 +2,7 @@
// Created by Vlad on 6/9/2024. // Created by Vlad on 6/9/2024.
// //
#include "omath/prediction/Projectile.h" #include "omath/prediction/Projectile.hpp"
#include <cmath> #include <cmath>

View File

@@ -2,7 +2,7 @@
// Created by Vlad on 6/9/2024. // Created by Vlad on 6/9/2024.
// //
#include "omath/prediction/Target.h" #include "omath/prediction/Target.hpp"
namespace omath::prediction namespace omath::prediction

View File

@@ -1,11 +1,11 @@
// //
// Created by Vlad on 27.08.2024. // Created by Vlad on 27.08.2024.
// //
#include "omath/projection/Camera.h" #include "omath/projection/Camera.hpp"
#include <complex> #include <complex>
#include "omath/Angles.h" #include "omath/Angles.hpp"
namespace omath::projection namespace omath::projection

View File

@@ -2,7 +2,7 @@
// Created by Vlad on 18.08.2024. // Created by Vlad on 18.08.2024.
// //
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/pathfinding/Astar.h> #include <omath/pathfinding/Astar.hpp>
TEST(UnitTestAstar, FindingRightPath) TEST(UnitTestAstar, FindingRightPath)

View File

@@ -2,7 +2,7 @@
// Created by Vlad on 01.09.2024. // Created by Vlad on 01.09.2024.
// //
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/Color.h> #include <omath/Color.hpp>
using namespace omath; using namespace omath;

View File

@@ -1,7 +1,7 @@
// UnitTestMat.cpp // UnitTestMat.cpp
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "omath/Mat.h" #include "omath/Mat.hpp"
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
using namespace omath; using namespace omath;

View File

@@ -2,8 +2,8 @@
// Created by vlad on 5/18/2024. // Created by vlad on 5/18/2024.
// //
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/Matrix.h> #include <omath/Matrix.hpp>
#include "omath/Vector3.h" #include "omath/Vector3.hpp"
using namespace omath; using namespace omath;

View File

@@ -1,5 +1,5 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/prediction/Engine.h> #include <omath/prediction/Engine.hpp>
TEST(UnitTestPrediction, PredictionTest) TEST(UnitTestPrediction, PredictionTest)
{ {

View File

@@ -3,9 +3,9 @@
// //
#include <complex> #include <complex>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/Matrix.h> #include <omath/Matrix.hpp>
#include <print> #include <print>
#include <omath/projection/Camera.h> #include <omath/projection/Camera.hpp>
TEST(UnitTestProjection, Projection) TEST(UnitTestProjection, Projection)
{ {

View File

@@ -3,7 +3,7 @@
// //
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/Vector2.h> #include <omath/Vector2.hpp>
#include <cmath> // For std::isinf and std::isnan #include <cmath> // For std::isinf and std::isnan
#include <cfloat> // For FLT_MAX and FLT_MIN #include <cfloat> // For FLT_MAX and FLT_MIN

View File

@@ -3,7 +3,7 @@
// //
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/Vector3.h> #include <omath/Vector3.hpp>
#include <cmath> #include <cmath>
#include <cfloat> // For FLT_MAX, FLT_MIN #include <cfloat> // For FLT_MAX, FLT_MIN
#include <limits> // For std::numeric_limits #include <limits> // For std::numeric_limits

View File

@@ -6,7 +6,7 @@
// //
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <omath/Vector4.h> #include <omath/Vector4.hpp>
#include <limits> // For std::numeric_limits #include <limits> // For std::numeric_limits
using namespace omath; using namespace omath;