mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-14 15:33:26 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dc43411bd2 | |||
| 8959161904 | |||
| 5d5bd215b2 | |||
| a48a257648 | |||
| ffba4e256a | |||
| d9219cdddb | |||
| 5a1014a239 | |||
| 74f2241bcf | |||
| 8977557a61 | |||
| 481d7b85df | |||
| 2b59fb6aa2 | |||
| 4f037a1952 | |||
| ef11183c3f | |||
| 326d8baaae | |||
| e46067b0b9 | |||
| 68ac7f7b3d | |||
| 17de6d407c | |||
| 59d686e252 | |||
| 713af1b772 | |||
| a8922230b3 | |||
| b8d79eb8b4 | |||
| 5acd166d8f | |||
| c7dda0ff10 | |||
| 2688d977a9 | |||
|
|
b9ac44a901 |
@@ -1,6 +1,6 @@
|
|||||||
<div align = center>
|
<div align = center>
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
project(examples)
|
project(examples)
|
||||||
|
|
||||||
add_executable(ExampleProjectionMatrixBuilder ExampleProjMatBuilder.cpp)
|
add_executable(ExampleProjectionMatrixBuilder example_proj_mat_builder.cpp)
|
||||||
target_link_libraries(ExampleProjectionMatrixBuilder PRIVATE omath::omath)
|
target_link_libraries(ExampleProjectionMatrixBuilder PRIVATE omath::omath)
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 3/19/2025.
|
// Created by Vlad on 3/19/2025.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <omath/engines/opengl_engine/Camera.hpp>
|
|
||||||
#include <omath/engines/opengl_engine/Formulas.hpp>
|
|
||||||
#include <omath/projection/Camera.hpp>
|
|
||||||
#include <print>
|
#include <print>
|
||||||
|
#include <omath/engines/opengl_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/Angles.hpp"
|
#include "omath/angles.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <numbers>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <numbers>
|
||||||
|
|
||||||
namespace omath::angles
|
namespace omath::angles
|
||||||
{
|
{
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/triangle.hpp"
|
||||||
#include "omath/Triangle.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::collision
|
namespace omath::collision
|
||||||
{
|
{
|
||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "omath/Vector3.hpp"
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "omath/Vector4.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
#include "omath/vector4.hpp"
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Constants.hpp"
|
#include "omath/engines/iw_engine/constants.hpp"
|
||||||
#include "omath/projection/Camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
{
|
{
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <omath/Vector3.hpp>
|
#include <omath/vector3.hpp>
|
||||||
#include <omath/Mat.hpp>
|
#include <omath/mat.hpp>
|
||||||
#include <omath/Angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/ViewAngles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Constants.hpp"
|
#include "omath/engines/iw_engine/constants.hpp"
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
{
|
{
|
||||||
@@ -21,4 +21,4 @@ namespace omath::iw_engine
|
|||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
Mat4x4 CalcPerspectiveProjectionMatrix(float fieldOfView, float aspectRatio, float near, float far);
|
Mat4x4 CalcPerspectiveProjectionMatrix(float fieldOfView, float aspectRatio, float near, float far);
|
||||||
} // namespace omath::source
|
} // namespace omath::iw_engine
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
// Created by Orange on 12/23/2024.
|
// Created by Orange on 12/23/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Constants.hpp"
|
#include "omath/engines/opengl_engine/constants.hpp"
|
||||||
#include "omath/projection/Camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
{
|
{
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <omath/Vector3.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/Mat.hpp>
|
#include <omath/mat.hpp>
|
||||||
#include <omath/Angle.hpp>
|
#include <omath/vector3.hpp>
|
||||||
#include <omath/ViewAngles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by Orange on 12/23/2024.
|
// Created by Orange on 12/23/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Constants.hpp"
|
#include "omath/engines/opengl_engine/constants.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
// Created by Orange on 12/4/2024.
|
// Created by Orange on 12/4/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Constants.hpp"
|
#include "omath/engines/source_engine/constants.hpp"
|
||||||
#include "omath/projection/Camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
{
|
{
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <omath/Vector3.hpp>
|
#include <omath/vector3.hpp>
|
||||||
#include <omath/Mat.hpp>
|
#include <omath/mat.hpp>
|
||||||
#include <omath/Angle.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/ViewAngles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by Orange on 12/4/2024.
|
// Created by Orange on 12/4/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Constants.hpp"
|
#include "omath/engines/source_engine/constants.hpp"
|
||||||
|
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
{
|
{
|
||||||
21
include/omath/engines/unity_engine/camera.hpp
Normal file
21
include/omath/engines/unity_engine/camera.hpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "omath/engines/unity_engine/constants.hpp"
|
||||||
|
#include "omath/projection/camera.hpp"
|
||||||
|
|
||||||
|
namespace omath::unity_engine
|
||||||
|
{
|
||||||
|
class Camera final : public projection::Camera<Mat4x4, ViewAngles>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Camera(const Vector3<float>& position, const ViewAngles& viewAngles, const projection::ViewPort& viewPort,
|
||||||
|
const Angle<float, 0.f, 180.f, AngleFlags::Clamped>& fov, float near, float far);
|
||||||
|
void LookAt(const Vector3<float>& target) override;
|
||||||
|
protected:
|
||||||
|
[[nodiscard]] Mat4x4 CalcViewMatrix() const override;
|
||||||
|
[[nodiscard]] Mat4x4 CalcProjectionMatrix() const override;
|
||||||
|
};
|
||||||
|
}
|
||||||
26
include/omath/engines/unity_engine/constants.hpp
Normal file
26
include/omath/engines/unity_engine/constants.hpp
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <omath/vector3.hpp>
|
||||||
|
#include <omath/mat.hpp>
|
||||||
|
#include <omath/angle.hpp>
|
||||||
|
#include <omath/view_angles.hpp>
|
||||||
|
|
||||||
|
namespace omath::unity_engine
|
||||||
|
{
|
||||||
|
constexpr Vector3<float> kAbsUp = {0, 1, 0};
|
||||||
|
constexpr Vector3<float> kAbsRight = {1, 0, 0};
|
||||||
|
constexpr Vector3<float> kAbsForward = {0, 0, 1};
|
||||||
|
|
||||||
|
using Mat4x4 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||||
|
using Mat3x3 = Mat<4, 4, float, MatStoreType::ROW_MAJOR>;
|
||||||
|
using Mat1x3 = Mat<1, 3, float, MatStoreType::ROW_MAJOR>;
|
||||||
|
using PitchAngle = Angle<float, -89.f, 89.f, AngleFlags::Clamped>;
|
||||||
|
using YawAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||||
|
using RollAngle = Angle<float, -180.f, 180.f, AngleFlags::Normalized>;
|
||||||
|
|
||||||
|
using ViewAngles = omath::ViewAngles<PitchAngle, YawAngle, RollAngle>;
|
||||||
|
} // namespace omath::source
|
||||||
24
include/omath/engines/unity_engine/formulas.hpp
Normal file
24
include/omath/engines/unity_engine/formulas.hpp
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "omath/engines/unity_engine/constants.hpp"
|
||||||
|
|
||||||
|
namespace omath::unity_engine
|
||||||
|
{
|
||||||
|
[[nodiscard]]
|
||||||
|
Vector3<float> ForwardVector(const ViewAngles& angles);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
Vector3<float> RightVector(const ViewAngles& angles);
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
Vector3<float> UpVector(const ViewAngles& angles);
|
||||||
|
|
||||||
|
[[nodiscard]] Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3<float>& cam_origin);
|
||||||
|
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
Mat4x4 CalcPerspectiveProjectionMatrix(float fieldOfView, float aspectRatio, float near, float far);
|
||||||
|
} // namespace omath::source
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <iomanip>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -430,4 +430,30 @@ namespace omath
|
|||||||
{
|
{
|
||||||
return MatRotationAxisZ(angles.yaw) * MatRotationAxisY(angles.pitch) * MatRotationAxisX(angles.roll);
|
return MatRotationAxisZ(angles.yaw) * MatRotationAxisY(angles.pitch) * MatRotationAxisX(angles.roll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||||
|
[[nodiscard]]
|
||||||
|
Mat<4, 4, Type, St> MatPerspectiveLeftHanded(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f);
|
||||||
|
|
||||||
|
return {{1.f / (aspectRatio * fovHalfTan), 0.f, 0.f, 0.f},
|
||||||
|
{0.f, 1.f / fovHalfTan, 0.f, 0.f},
|
||||||
|
{0.f, 0.f, (far + near) / (far - near), -(2.f * near * far) / (far - near)},
|
||||||
|
{0.f, 0.f, 1.f, 0.f}};
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class Type = float, MatStoreType St = MatStoreType::ROW_MAJOR>
|
||||||
|
[[nodiscard]]
|
||||||
|
Mat<4, 4, Type, St> MatPerspectiveRightHanded(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
|
const float far) noexcept
|
||||||
|
{
|
||||||
|
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f);
|
||||||
|
|
||||||
|
return {{1.f / (aspectRatio * fovHalfTan), 0.f, 0.f, 0.f},
|
||||||
|
{0.f, 1.f / fovHalfTan, 0.f, 0.f},
|
||||||
|
{0.f, 0.f, -(far + near) / (far - near), -(2.f * near * far) / (far - near)},
|
||||||
|
{0.f, 0.f, -1.f, 0.f}};
|
||||||
|
}
|
||||||
} // namespace omath
|
} // namespace omath
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "NavigationMesh.hpp"
|
#include "omath/pathfinding/navigation_mesh.hpp"
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::pathfinding
|
namespace omath::pathfinding
|
||||||
{
|
{
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "omath/Vector3.hpp"
|
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::pathfinding
|
namespace omath::pathfinding
|
||||||
{
|
{
|
||||||
@@ -20,19 +20,19 @@ namespace omath::pathfinding
|
|||||||
class NavigationMesh final
|
class NavigationMesh final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
std::expected<Vector3<float>, std::string> GetClosestVertex(const Vector3<float>& point) const;
|
std::expected<Vector3<float>, std::string> GetClosestVertex(const Vector3<float>& point) const;
|
||||||
|
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
const std::vector<Vector3<float>>& GetNeighbors(const Vector3<float>& vertex) const;
|
const std::vector<Vector3<float>>& GetNeighbors(const Vector3<float>& vertex) const;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool Empty() const;
|
bool Empty() const;
|
||||||
|
|
||||||
[[nodiscard]] std::vector<uint8_t> Serialize() const;
|
[[nodiscard]] std::vector<uint8_t> Serialize() const;
|
||||||
|
|
||||||
void Deserialize(const std::vector<uint8_t>& raw);
|
void Deserialize(const std::vector<uint8_t>& raw);
|
||||||
|
|
||||||
std::unordered_map<Vector3<float>, std::vector<Vector3<float>>> m_verTextMap;
|
std::unordered_map<Vector3<float>, std::vector<Vector3<float>>> m_verTextMap;
|
||||||
};
|
};
|
||||||
}
|
} // namespace omath::pathfinding
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
// Created by Vlad on 2/23/2025.
|
// Created by Vlad on 2/23/2025.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "Projectile.hpp"
|
#include "omath/projectile_prediction/projectile.hpp"
|
||||||
#include "Target.hpp"
|
#include "omath/projectile_prediction/target.hpp"
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by Vlad on 2/23/2025.
|
// Created by Vlad on 2/23/2025.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "ProjPredEngine.hpp"
|
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
@@ -5,10 +5,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||||
#include "omath/projectile_prediction/ProjPredEngine.hpp"
|
#include "omath/projectile_prediction/projectile.hpp"
|
||||||
#include "omath/projectile_prediction/Projectile.hpp"
|
#include "omath/projectile_prediction/target.hpp"
|
||||||
#include "omath/projectile_prediction/Target.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
@@ -5,11 +5,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <omath/Mat.hpp>
|
#include <omath/angle.hpp>
|
||||||
#include <omath/Vector3.hpp>
|
#include <omath/mat.hpp>
|
||||||
#include "ErrorCodes.hpp"
|
#include <omath/vector3.hpp>
|
||||||
#include <omath/Angle.hpp>
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include "omath/projection/error_codes.hpp"
|
||||||
|
|
||||||
namespace omath::projection
|
namespace omath::projection
|
||||||
{
|
{
|
||||||
@@ -36,8 +36,8 @@ namespace omath::projection
|
|||||||
m_viewPort(viewPort), m_fieldOfView(fov), m_farPlaneDistance(far), m_nearPlaneDistance(near),
|
m_viewPort(viewPort), m_fieldOfView(fov), m_farPlaneDistance(far), m_nearPlaneDistance(near),
|
||||||
m_viewAngles(viewAngles), m_origin(position)
|
m_viewAngles(viewAngles), m_origin(position)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void LookAt(const Vector3<float>& target) = 0;
|
virtual void LookAt(const Vector3<float>& target) = 0;
|
||||||
|
|
||||||
@@ -49,8 +49,8 @@ namespace omath::projection
|
|||||||
{
|
{
|
||||||
return CalcProjectionMatrix() * CalcViewMatrix();
|
return CalcProjectionMatrix() * CalcViewMatrix();
|
||||||
}
|
}
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
[[nodiscard]] const Mat4x4Type& GetViewProjectionMatrix() const
|
[[nodiscard]] const Mat4x4Type& GetViewProjectionMatrix() const
|
||||||
{
|
{
|
||||||
if (!m_viewProjectionMatrix.has_value())
|
if (!m_viewProjectionMatrix.has_value())
|
||||||
@@ -116,9 +116,19 @@ namespace omath::projection
|
|||||||
|
|
||||||
[[nodiscard]] std::expected<Vector3<float>, Error> WorldToScreen(const Vector3<float>& worldPosition) const
|
[[nodiscard]] std::expected<Vector3<float>, Error> WorldToScreen(const Vector3<float>& worldPosition) const
|
||||||
{
|
{
|
||||||
const auto& viewProjMatrix = GetViewProjectionMatrix();
|
auto normalizedCords = WorldToViewPort(worldPosition);
|
||||||
|
|
||||||
auto projected = viewProjMatrix * MatColumnFromVector<float, Mat4x4Type::GetStoreOrdering()>(worldPosition);
|
if (!normalizedCords.has_value())
|
||||||
|
return std::unexpected{normalizedCords.error()};
|
||||||
|
|
||||||
|
|
||||||
|
return NdcToScreenPosition(*normalizedCords);
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] std::expected<Vector3<float>, Error> WorldToViewPort(const Vector3<float>& worldPosition) const
|
||||||
|
{
|
||||||
|
auto projected = GetViewProjectionMatrix() *
|
||||||
|
MatColumnFromVector<float, Mat4x4Type::GetStoreOrdering()>(worldPosition);
|
||||||
|
|
||||||
if (projected.At(3, 0) == 0.0f)
|
if (projected.At(3, 0) == 0.0f)
|
||||||
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||||
@@ -128,10 +138,7 @@ namespace omath::projection
|
|||||||
if (IsNdcOutOfBounds(projected))
|
if (IsNdcOutOfBounds(projected))
|
||||||
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
return std::unexpected(Error::WORLD_POSITION_IS_OUT_OF_SCREEN_BOUNDS);
|
||||||
|
|
||||||
const auto screenPositionX = (projected.At(0,0)+1.f) / 2.f * m_viewPort.m_width;
|
return Vector3<float>{projected.At(0, 0), projected.At(1, 0), projected.At(2, 0)};
|
||||||
const auto screenPositionY = (-projected.At(1,0)+1) / 2.f * m_viewPort.m_height;
|
|
||||||
|
|
||||||
return Vector3{screenPositionX, screenPositionY, projected.At(2,0)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -152,7 +159,17 @@ namespace omath::projection
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr static bool IsNdcOutOfBounds(const Type& ndc)
|
constexpr static bool IsNdcOutOfBounds(const Type& ndc)
|
||||||
{
|
{
|
||||||
return std::ranges::any_of( ndc.RawArray(), [](const auto& val) { return val < -1 || val > 1; });
|
return std::ranges::any_of(ndc.RawArray(), [](const auto& val) { return val < -1 || val > 1; });
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] Vector3<float> NdcToScreenPosition(const Vector3<float>& ndc) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
{
|
||||||
|
(ndc.x + 1.f) / 2.f * m_viewPort.m_width,
|
||||||
|
(1.f - ndc.y) / 2.f * m_viewPort.m_height,
|
||||||
|
ndc.z
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace omath::projection
|
} // namespace omath::projection
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by Orange on 11/13/2024.
|
// Created by Orange on 11/13/2024.
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -4,12 +4,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Vector2.hpp"
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include "omath/Angle.hpp"
|
#include "omath/angle.hpp"
|
||||||
#include "omath/Vector2.hpp"
|
#include "omath/vector2.hpp"
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
{
|
{
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <omath/Vector3.hpp>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <omath/vector3.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace omath
|
namespace omath
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
target_sources(omath PRIVATE
|
target_sources(omath PRIVATE
|
||||||
Matrix.cpp
|
matrix.cpp
|
||||||
color.cpp
|
color.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
target_sources(omath PRIVATE
|
target_sources(omath PRIVATE
|
||||||
LineTracer.cpp
|
line_tracer.cpp
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 11/13/2024.
|
// Created by Orange on 11/13/2024.
|
||||||
//
|
//
|
||||||
#include "omath/collision/LineTracer.hpp"
|
#include "omath/collision/line_tracer.hpp"
|
||||||
|
|
||||||
namespace omath::collision
|
namespace omath::collision
|
||||||
{
|
{
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
add_subdirectory(source_engine)
|
add_subdirectory(source_engine)
|
||||||
add_subdirectory(opengl_engine)
|
add_subdirectory(opengl_engine)
|
||||||
add_subdirectory(iw_engine)
|
add_subdirectory(iw_engine)
|
||||||
|
add_subdirectory(unity_engine)
|
||||||
@@ -1 +1 @@
|
|||||||
target_sources(omath PRIVATE Camera.cpp Formulas.cpp)
|
target_sources(omath PRIVATE camera.cpp formulas.cpp)
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 3/17/2025.
|
// Created by Vlad on 3/17/2025.
|
||||||
//
|
//
|
||||||
#include "omath/engines/iw_engine/Camera.hpp"
|
#include "omath/engines/iw_engine/camera.hpp"
|
||||||
#include "omath/engines/iw_engine/Formulas.hpp"
|
#include "omath/engines/iw_engine/formulas.hpp"
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
{
|
{
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 3/19/2025.
|
// Created by Vlad on 3/19/2025.
|
||||||
//
|
//
|
||||||
#include "omath/engines/iw_engine/Formulas.hpp"
|
#include "omath/engines/iw_engine/formulas.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::iw_engine
|
namespace omath::iw_engine
|
||||||
@@ -26,22 +26,25 @@ namespace omath::iw_engine
|
|||||||
|
|
||||||
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3<float>& cam_origin)
|
Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3<float>& cam_origin)
|
||||||
{
|
{
|
||||||
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
|
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
const float far)
|
const float far)
|
||||||
{
|
{
|
||||||
// NOTE: Need magic number to fix fov calculation, since source inherit Quake proj matrix calculation
|
// NOTE: Need magic number to fix fov calculation, since IW engine inherit Quake proj matrix calculation
|
||||||
constexpr auto kMultiplyFactor = 0.75f;
|
constexpr auto kMultiplyFactor = 0.75f;
|
||||||
|
|
||||||
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f) * kMultiplyFactor;
|
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f) * kMultiplyFactor;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{1.f / (aspectRatio * fovHalfTan), 0, 0, 0},
|
{1.f / (aspectRatio * fovHalfTan), 0, 0, 0},
|
||||||
{0, 1.f / fovHalfTan, 0, 0},
|
{0, 1.f / (fovHalfTan), 0, 0},
|
||||||
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
||||||
{0, 0, 1, 0},
|
{0, 0, 1, 0},
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
} // namespace omath::iw_engine
|
} // namespace omath::iw_engine
|
||||||
@@ -1 +1 @@
|
|||||||
target_sources(omath PRIVATE Camera.cpp Formulas.cpp)
|
target_sources(omath PRIVATE camera.cpp formulas.cpp)
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 12/23/2024.
|
// Created by Orange on 12/23/2024.
|
||||||
//
|
//
|
||||||
#include "omath/engines/opengl_engine/Camera.hpp"
|
#include "omath/engines/opengl_engine/camera.hpp"
|
||||||
#include "omath/engines/opengl_engine/Formulas.hpp"
|
#include "omath/engines/opengl_engine/formulas.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 3/19/2025.
|
// Created by Vlad on 3/19/2025.
|
||||||
//
|
//
|
||||||
#include "omath/engines/opengl_engine/Formulas.hpp"
|
#include "omath/engines/opengl_engine/formulas.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::opengl_engine
|
namespace omath::opengl_engine
|
||||||
@@ -40,7 +40,6 @@ namespace omath::opengl_engine
|
|||||||
{0, 1.f / (fovHalfTan), 0, 0},
|
{0, 1.f / (fovHalfTan), 0, 0},
|
||||||
{0, 0, -(far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
{0, 0, -(far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
||||||
{0, 0, -1, 0},
|
{0, 0, -1, 0},
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} // namespace omath::opengl_engine
|
} // namespace omath::opengl_engine
|
||||||
@@ -1 +1 @@
|
|||||||
target_sources(omath PRIVATE Camera.cpp Formulas.cpp)
|
target_sources(omath PRIVATE camera.cpp formulas.cpp)
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 12/4/2024.
|
// Created by Orange on 12/4/2024.
|
||||||
//
|
//
|
||||||
#include "omath/engines/source_engine/Camera.hpp"
|
#include "omath/engines/source_engine/camera.hpp"
|
||||||
#include "omath/engines/source_engine/Formulas.hpp"
|
#include "omath/engines/source_engine/formulas.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 3/19/2025.
|
// Created by Vlad on 3/19/2025.
|
||||||
//
|
//
|
||||||
#include <omath/engines/source_engine/Formulas.hpp>
|
#include <omath/engines/source_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace omath::source_engine
|
namespace omath::source_engine
|
||||||
@@ -30,6 +30,7 @@ namespace omath::source_engine
|
|||||||
{
|
{
|
||||||
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
|
return MatCameraView(ForwardVector(angles), RightVector(angles), UpVector(angles), cam_origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
const float far)
|
const float far)
|
||||||
{
|
{
|
||||||
@@ -43,7 +44,6 @@ namespace omath::source_engine
|
|||||||
{0, 1.f / (fovHalfTan), 0, 0},
|
{0, 1.f / (fovHalfTan), 0, 0},
|
||||||
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
||||||
{0, 0, 1, 0},
|
{0, 0, 1, 0},
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} // namespace omath::source_engine
|
} // namespace omath::source_engine
|
||||||
1
source/engines/unity_engine/CMakeLists.txt
Normal file
1
source/engines/unity_engine/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
target_sources(omath PRIVATE formulas.cpp camera.cpp)
|
||||||
28
source/engines/unity_engine/camera.cpp
Normal file
28
source/engines/unity_engine/camera.cpp
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
#include <omath/engines/unity_engine/camera.hpp>
|
||||||
|
#include <omath/engines/unity_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace omath::unity_engine
|
||||||
|
{
|
||||||
|
Camera::Camera(const Vector3<float>& position, const ViewAngles& viewAngles, const projection::ViewPort& viewPort,
|
||||||
|
const projection::FieldOfView& fov, const float near, const float far) :
|
||||||
|
projection::Camera<Mat4x4, ViewAngles>(position, viewAngles, viewPort, fov, near, far)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void Camera::LookAt([[maybe_unused]] const Vector3<float>& target)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Not implemented");
|
||||||
|
}
|
||||||
|
Mat4x4 Camera::CalcViewMatrix() const
|
||||||
|
{
|
||||||
|
return unity_engine::CalcViewMatrix(m_viewAngles, m_origin);
|
||||||
|
}
|
||||||
|
Mat4x4 Camera::CalcProjectionMatrix() const
|
||||||
|
{
|
||||||
|
return CalcPerspectiveProjectionMatrix(m_fieldOfView.AsDegrees(), m_viewPort.AspectRatio(), m_nearPlaneDistance,
|
||||||
|
m_farPlaneDistance);
|
||||||
|
}
|
||||||
|
} // namespace omath::unity_engine
|
||||||
45
source/engines/unity_engine/formulas.cpp
Normal file
45
source/engines/unity_engine/formulas.cpp
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/22/2025.
|
||||||
|
//
|
||||||
|
#include "omath/engines/unity_engine/formulas.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace omath::unity_engine
|
||||||
|
{
|
||||||
|
Vector3<float> unity_engine::ForwardVector(const ViewAngles& angles)
|
||||||
|
{
|
||||||
|
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsForward);
|
||||||
|
|
||||||
|
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||||
|
}
|
||||||
|
Vector3<float> RightVector(const ViewAngles& angles)
|
||||||
|
{
|
||||||
|
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsRight);
|
||||||
|
|
||||||
|
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||||
|
}
|
||||||
|
Vector3<float> UpVector(const ViewAngles& angles)
|
||||||
|
{
|
||||||
|
const auto vec = MatRotation(angles) * MatColumnFromVector(kAbsUp);
|
||||||
|
|
||||||
|
return {vec.At(0, 0), vec.At(1, 0), vec.At(2, 0)};
|
||||||
|
}
|
||||||
|
Mat4x4 CalcViewMatrix(const ViewAngles& angles, const Vector3<float>& cam_origin)
|
||||||
|
{
|
||||||
|
return MatCameraView<float, MatStoreType::ROW_MAJOR>(ForwardVector(angles), -RightVector(angles),
|
||||||
|
UpVector(angles), cam_origin);
|
||||||
|
}
|
||||||
|
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
|
||||||
|
const float far)
|
||||||
|
{
|
||||||
|
const float fovHalfTan = std::tan(angles::DegreesToRadians(fieldOfView) / 2.f);
|
||||||
|
|
||||||
|
return {
|
||||||
|
{1.f / (aspectRatio * fovHalfTan), 0, 0, 0},
|
||||||
|
{0, 1.f / (fovHalfTan), 0, 0},
|
||||||
|
{0, 0, (far + near) / (far - near), -(2.f * far * near) / (far - near)},
|
||||||
|
{0, 0, -1.f, 0},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} // namespace omath::unity_engine
|
||||||
@@ -1 +1 @@
|
|||||||
target_sources(omath PRIVATE NavigationMesh.cpp Astar.cpp)
|
target_sources(omath PRIVATE navigation_mesh.cpp a_star.cpp)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 28.07.2024.
|
// Created by Vlad on 28.07.2024.
|
||||||
//
|
//
|
||||||
#include "omath/pathfinding/Astar.hpp"
|
#include "omath/pathfinding/a_star.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 28.07.2024.
|
// Created by Vlad on 28.07.2024.
|
||||||
//
|
//
|
||||||
#include "omath/pathfinding/NavigationMesh.hpp"
|
#include "omath/pathfinding/navigation_mesh.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <stdexcept>
|
||||||
namespace omath::pathfinding
|
namespace omath::pathfinding
|
||||||
{
|
{
|
||||||
std::expected<Vector3<float>, std::string> NavigationMesh::GetClosestVertex(const Vector3<float> &point) const
|
std::expected<Vector3<float>, std::string> NavigationMesh::GetClosestVertex(const Vector3<float> &point) const
|
||||||
@@ -1 +1 @@
|
|||||||
target_sources(omath PRIVATE ProjPredEngineLegacy.cpp Projectile.cpp Target.cpp ProjPredEngineAVX2.cpp ProjPredEngine.cpp)
|
target_sources(omath PRIVATE proj_pred_engine_legacy.cpp projectile.cpp target.cpp proj_pred_engine_avx2.cpp proj_pred_engine.cpp)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 2/23/2025.
|
// Created by Vlad on 2/23/2025.
|
||||||
//
|
//
|
||||||
#include "omath/projectile_prediction/ProjPredEngine.hpp"
|
#include "omath/projectile_prediction/proj_pred_engine.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 2/23/2025.
|
// Created by Vlad on 2/23/2025.
|
||||||
//
|
//
|
||||||
#include "omath/projectile_prediction/ProjPredEngineAVX2.hpp"
|
#include "omath/projectile_prediction/proj_pred_engine_avx2.hpp"
|
||||||
#include "source_location"
|
#include "source_location"
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "omath/projectile_prediction/ProjPredEngineLegacy.hpp"
|
#include "omath/projectile_prediction/proj_pred_engine_legacy.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <omath/Angles.hpp>
|
#include <omath/angles.hpp>
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
// Created by Vlad on 6/9/2024.
|
// Created by Vlad on 6/9/2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "omath/projectile_prediction/Projectile.hpp"
|
#include "omath/projectile_prediction/projectile.hpp"
|
||||||
|
|
||||||
#include <omath/engines/source_engine/Formulas.hpp>
|
#include <omath/engines/source_engine/formulas.hpp>
|
||||||
|
|
||||||
namespace omath::projectile_prediction
|
namespace omath::projectile_prediction
|
||||||
{
|
{
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// Created by Vlad on 6/9/2024.
|
// Created by Vlad on 6/9/2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "omath/projectile_prediction/Projectile.hpp"
|
#include "omath/projectile_prediction/projectile.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::prediction
|
namespace omath::prediction
|
||||||
@@ -1 +1 @@
|
|||||||
target_sources(omath PRIVATE Camera.cpp)
|
target_sources(omath PRIVATE camera.cpp)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Created by Vlad on 27.08.2024.
|
// Created by Vlad on 27.08.2024.
|
||||||
//
|
//
|
||||||
#include "omath/projection/Camera.hpp"
|
#include "omath/projection/camera.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace omath::projection
|
namespace omath::projection
|
||||||
@@ -4,25 +4,25 @@ project(unit-tests)
|
|||||||
|
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
add_executable(unit-tests
|
add_executable(unit-tests
|
||||||
general/UnitTestPrediction.cpp
|
general/unit_test_prediction.cpp
|
||||||
general/UnitTestMatrix.cpp
|
general/unit_test_matrix.cpp
|
||||||
general/UnitTestMat.cpp
|
general/unit_test_mat.cpp
|
||||||
general/UnitTestAstar.cpp
|
general/unit_test_a_star.cpp
|
||||||
general/UnitTestProjection.cpp
|
general/unit_test_projection.cpp
|
||||||
general/UnitTestVector3.cpp
|
general/unit_test_vector3.cpp
|
||||||
general/UnitTestVector2.cpp
|
general/unit_test_vector2.cpp
|
||||||
general/UnitTestColor.cpp
|
general/unit_test_color.cpp
|
||||||
general/UnitTestVector4.cpp
|
general/unit_test_vector4.cpp
|
||||||
general/UnitTestLineTrace.cpp
|
general/unit_test_line_trace.cpp
|
||||||
general/UnitTestAngles.cpp
|
general/unit_test_angles.cpp
|
||||||
general/UnitTestViewAngles.cpp
|
general/unit_test_view_angles.cpp
|
||||||
general/UnitTestAngle.cpp
|
general/unit_test_angle.cpp
|
||||||
general/UnitTestTriangle.cpp
|
general/unit_test_triangle.cpp
|
||||||
|
|
||||||
engines/UnitTestOpenGL.cpp
|
engines/unit_test_open_gl.cpp
|
||||||
engines/UnitTestUnityEngine.cpp
|
engines/unit_test_unity_engine.cpp
|
||||||
engines/UnitTestSourceEngine.cpp
|
engines/unit_test_source_engine.cpp
|
||||||
engines/UnitTestIwEngine.cpp
|
engines/unit_test_iw_engine.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Vlad on 3/17/2025.
|
|
||||||
//
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
#include <omath/engines/iw_engine/Camera.hpp>
|
|
||||||
#include <omath/engines/iw_engine/Constants.hpp>
|
|
||||||
#include <omath/engines/iw_engine/Formulas.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
TEST(UnitTestEwEngine, ForwardVector)
|
|
||||||
{
|
|
||||||
const auto forward = omath::source_engine::ForwardVector({});
|
|
||||||
|
|
||||||
EXPECT_EQ(forward, omath::source_engine::kAbsForward);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(UnitTestEwEngine, RightVector)
|
|
||||||
{
|
|
||||||
const auto right = omath::source_engine::RightVector({});
|
|
||||||
|
|
||||||
EXPECT_EQ(right, omath::source_engine::kAbsRight);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(UnitTestEwEngine, UpVector)
|
|
||||||
{
|
|
||||||
const auto up = omath::source_engine::UpVector({});
|
|
||||||
EXPECT_EQ(up, omath::source_engine::kAbsUp);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(UnitTestEwEngine, ProjectTargetMovedFromCamera)
|
|
||||||
{
|
|
||||||
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
|
||||||
const auto cam = omath::source_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
|
||||||
|
|
||||||
|
|
||||||
for (float distance = 0.02f; distance < 1000.f; distance += 0.01f)
|
|
||||||
{
|
|
||||||
const auto projected = cam.WorldToScreen({distance, 0, 0});
|
|
||||||
|
|
||||||
EXPECT_TRUE(projected.has_value());
|
|
||||||
|
|
||||||
if (!projected.has_value())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
EXPECT_NEAR(projected->x, 960, 0.00001f);
|
|
||||||
EXPECT_NEAR(projected->y, 540, 0.00001f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(UnitTestEwEngine, CameraSetAndGetFov)
|
|
||||||
{
|
|
||||||
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
|
||||||
auto cam = omath::source_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
|
||||||
|
|
||||||
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 90.f);
|
|
||||||
cam.SetFieldOfView(omath::projection::FieldOfView::FromDegrees(50.f));
|
|
||||||
|
|
||||||
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 50.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(UnitTestEwEngine, CameraSetAndGetOrigin)
|
|
||||||
{
|
|
||||||
auto cam = omath::source_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, {}, 0.01f, 1000.f);
|
|
||||||
|
|
||||||
EXPECT_EQ(cam.GetOrigin(), omath::Vector3<float>{});
|
|
||||||
cam.SetFieldOfView(omath::projection::FieldOfView::FromDegrees(50.f));
|
|
||||||
|
|
||||||
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 50.f);
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by Orange on 11/27/2024.
|
|
||||||
//
|
|
||||||
69
tests/engines/unit_test_iw_engine.cpp
Normal file
69
tests/engines/unit_test_iw_engine.cpp
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
//
|
||||||
|
// Created by Vlad on 3/17/2025.
|
||||||
|
//
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <omath/engines/iw_engine/camera.hpp>
|
||||||
|
#include <omath/engines/iw_engine/constants.hpp>
|
||||||
|
#include <omath/engines/iw_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
TEST(UnitTestIwEngine, ForwardVector)
|
||||||
|
{
|
||||||
|
const auto forward = omath::iw_engine::ForwardVector({});
|
||||||
|
|
||||||
|
EXPECT_EQ(forward, omath::iw_engine::kAbsForward);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestIwEngine, RightVector)
|
||||||
|
{
|
||||||
|
const auto right = omath::iw_engine::RightVector({});
|
||||||
|
|
||||||
|
EXPECT_EQ(right, omath::iw_engine::kAbsRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestIwEngine, UpVector)
|
||||||
|
{
|
||||||
|
const auto up = omath::iw_engine::UpVector({});
|
||||||
|
EXPECT_EQ(up, omath::iw_engine::kAbsUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestIwEngine, ProjectTargetMovedFromCamera)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
||||||
|
const auto cam = omath::iw_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
|
||||||
|
for (float distance = 0.02f; distance < 1000.f; distance += 0.01f)
|
||||||
|
{
|
||||||
|
const auto projected = cam.WorldToScreen({distance, 0, 0});
|
||||||
|
|
||||||
|
EXPECT_TRUE(projected.has_value());
|
||||||
|
|
||||||
|
if (!projected.has_value())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
EXPECT_NEAR(projected->x, 960, 0.00001f);
|
||||||
|
EXPECT_NEAR(projected->y, 540, 0.00001f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestIwEngine, CameraSetAndGetFov)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
||||||
|
auto cam = omath::iw_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 90.f);
|
||||||
|
cam.SetFieldOfView(omath::projection::FieldOfView::FromDegrees(50.f));
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 50.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestIwEngine, CameraSetAndGetOrigin)
|
||||||
|
{
|
||||||
|
auto cam = omath::iw_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, {}, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetOrigin(), omath::Vector3<float>{});
|
||||||
|
cam.SetFieldOfView(omath::projection::FieldOfView::FromDegrees(50.f));
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 50.f);
|
||||||
|
}
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
// Created by Orange on 11/23/2024.
|
// Created by Orange on 11/23/2024.
|
||||||
//
|
//
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/engines/opengl_engine//Camera.hpp>
|
#include <omath/engines/opengl_engine/camera.hpp>
|
||||||
#include <omath/engines/opengl_engine/Constants.hpp>
|
#include <omath/engines/opengl_engine/constants.hpp>
|
||||||
#include <omath/engines/opengl_engine/Formulas.hpp>
|
#include <omath/engines/opengl_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
TEST(UnitTestOpenGL, ForwardVector)
|
TEST(UnitTestOpenGL, ForwardVector)
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
// Created by Orange on 11/23/2024.
|
// Created by Orange on 11/23/2024.
|
||||||
//
|
//
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/engines/source_engine/Camera.hpp>
|
#include <omath/engines/source_engine/camera.hpp>
|
||||||
#include <omath/engines/source_engine/Constants.hpp>
|
#include <omath/engines/source_engine/constants.hpp>
|
||||||
#include <omath/engines/source_engine/Formulas.hpp>
|
#include <omath/engines/source_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
TEST(UnitTestSourceEngine, ForwardVector)
|
TEST(UnitTestSourceEngine, ForwardVector)
|
||||||
@@ -47,6 +47,26 @@ TEST(UnitTestSourceEngine, ProjectTargetMovedFromCamera)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestSourceEngine, ProjectTargetMovedUp)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
||||||
|
const auto cam = omath::source_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
auto prev = 1080.f;
|
||||||
|
for (float distance = 0.0f; distance < 10.f; distance += 1.f)
|
||||||
|
{
|
||||||
|
const auto projected = cam.WorldToScreen({100.f, 0, distance});
|
||||||
|
EXPECT_TRUE(projected.has_value());
|
||||||
|
|
||||||
|
if (!projected.has_value())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
EXPECT_TRUE(projected->y < prev);
|
||||||
|
|
||||||
|
prev = projected->y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST(UnitTestSourceEngine, CameraSetAndGetFov)
|
TEST(UnitTestSourceEngine, CameraSetAndGetFov)
|
||||||
{
|
{
|
||||||
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
||||||
77
tests/engines/unit_test_unity_engine.cpp
Normal file
77
tests/engines/unit_test_unity_engine.cpp
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
//
|
||||||
|
// Created by Orange on 11/27/2024.
|
||||||
|
//
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <omath/engines/unity_engine/camera.hpp>
|
||||||
|
#include <omath/engines/unity_engine/constants.hpp>
|
||||||
|
#include <omath/engines/unity_engine/formulas.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
TEST(UnitTestUnityEngine, ForwardVector)
|
||||||
|
{
|
||||||
|
const auto forward = omath::unity_engine::ForwardVector({});
|
||||||
|
|
||||||
|
EXPECT_EQ(forward, omath::unity_engine::kAbsForward);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestUnityEngine, RightVector)
|
||||||
|
{
|
||||||
|
const auto right = omath::unity_engine::RightVector({});
|
||||||
|
|
||||||
|
EXPECT_EQ(right, omath::unity_engine::kAbsRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestUnityEngine, UpVector)
|
||||||
|
{
|
||||||
|
const auto up = omath::unity_engine::UpVector({});
|
||||||
|
EXPECT_EQ(up, omath::unity_engine::kAbsUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestUnityEngine, ProjectTargetMovedFromCamera)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(60.f);
|
||||||
|
const auto cam = omath::unity_engine::Camera({0, 0, 0}, {}, {1280.f, 720.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
|
||||||
|
for (float distance = 0.02f; distance < 100.f; distance += 0.01f)
|
||||||
|
{
|
||||||
|
const auto projected = cam.WorldToScreen({0, 0, distance});
|
||||||
|
|
||||||
|
EXPECT_TRUE(projected.has_value());
|
||||||
|
|
||||||
|
if (!projected.has_value())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
EXPECT_NEAR(projected->x, 640, 0.00001f);
|
||||||
|
EXPECT_NEAR(projected->y, 360, 0.00001f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TEST(UnitTestUnityEngine, Project)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(60.f);
|
||||||
|
|
||||||
|
const auto cam = omath::unity_engine::Camera({0, 0, 0}, {}, {1280.f, 720.f}, fov, 0.03f, 1000.f);
|
||||||
|
const auto proj = cam.WorldToScreen({5.f, 3, 10.f});
|
||||||
|
std::println("{} {}", proj->x, proj->y);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestUnityEngine, CameraSetAndGetFov)
|
||||||
|
{
|
||||||
|
constexpr auto fov = omath::projection::FieldOfView::FromDegrees(90.f);
|
||||||
|
auto cam = omath::unity_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, fov, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 90.f);
|
||||||
|
cam.SetFieldOfView(omath::projection::FieldOfView::FromDegrees(50.f));
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 50.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(UnitTestUnityEngine, CameraSetAndGetOrigin)
|
||||||
|
{
|
||||||
|
auto cam = omath::unity_engine::Camera({0, 0, 0}, {}, {1920.f, 1080.f}, {}, 0.01f, 1000.f);
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetOrigin(), omath::Vector3<float>{});
|
||||||
|
cam.SetFieldOfView(omath::projection::FieldOfView::FromDegrees(50.f));
|
||||||
|
|
||||||
|
EXPECT_EQ(cam.GetFieldOfView().AsDegrees(), 50.f);
|
||||||
|
}
|
||||||
@@ -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.hpp>
|
#include <omath/pathfinding/a_star.hpp>
|
||||||
|
|
||||||
|
|
||||||
TEST(UnitTestAstar, FindingRightPath)
|
TEST(UnitTestAstar, FindingRightPath)
|
||||||
@@ -2,8 +2,7 @@
|
|||||||
// Created by Orange on 11/30/2024.
|
// Created by Orange on 11/30/2024.
|
||||||
//
|
//
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/Angles.hpp>
|
#include <omath/angles.hpp>
|
||||||
#include <omath/Angle.hpp>
|
|
||||||
|
|
||||||
TEST(UnitTestAngles, RadiansToDeg)
|
TEST(UnitTestAngles, RadiansToDeg)
|
||||||
{
|
{
|
||||||
@@ -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.hpp>
|
#include <omath/color.hpp>
|
||||||
|
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "omath/collision/LineTracer.hpp"
|
#include "omath/collision/line_tracer.hpp"
|
||||||
#include "omath/Triangle.hpp"
|
#include "omath/triangle.hpp"
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
using namespace omath::collision;
|
using namespace omath::collision;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// UnitTestMat.cpp
|
// UnitTestMat.cpp
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include "omath/Mat.hpp"
|
#include "omath/mat.hpp"
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
@@ -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.hpp>
|
#include <omath/matrix.hpp>
|
||||||
#include "omath/Vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/projectile_prediction/ProjPredEngineLegacy.hpp>
|
#include <omath/projectile_prediction/proj_pred_engine_legacy.hpp>
|
||||||
|
|
||||||
TEST(UnitTestPrediction, PredictionTest)
|
TEST(UnitTestPrediction, PredictionTest)
|
||||||
{
|
{
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
//
|
//
|
||||||
#include <complex>
|
#include <complex>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/engines/source_engine/Camera.hpp>
|
#include <omath/engines/source_engine/camera.hpp>
|
||||||
#include <omath/projection/Camera.hpp>
|
#include <omath/projection/camera.hpp>
|
||||||
#include <print>
|
#include <print>
|
||||||
|
|
||||||
TEST(UnitTestProjection, Projection)
|
TEST(UnitTestProjection, Projection)
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 1/6/2025.
|
// Created by Orange on 1/6/2025.
|
||||||
//
|
//
|
||||||
#include "omath/Triangle.hpp"
|
#include <cmath> // For std::sqrt, std::isinf, std::isnan
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/Vector3.hpp>
|
#include <omath/vector3.hpp>
|
||||||
#include <cmath> // For std::sqrt, std::isinf, std::isnan
|
#include "omath/triangle.hpp"
|
||||||
|
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
// Created by Vlad on 02.09.2024.
|
// Created by Vlad on 02.09.2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
#include <omath/Vector2.hpp>
|
|
||||||
#include <cmath> // For std::isinf and std::isnan
|
|
||||||
#include <cfloat> // For FLT_MAX and FLT_MIN
|
#include <cfloat> // For FLT_MAX and FLT_MIN
|
||||||
|
#include <cmath> // For std::isinf and std::isnan
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
#include <omath/vector2.hpp>
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
// Created by Vlad on 01.09.2024.
|
// Created by Vlad on 01.09.2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
#include <omath/Vector3.hpp>
|
|
||||||
#include <cmath>
|
|
||||||
#include <cfloat> // For FLT_MAX, FLT_MIN
|
#include <cfloat> // For FLT_MAX, FLT_MIN
|
||||||
|
#include <cmath>
|
||||||
|
#include <gtest/gtest.h>
|
||||||
#include <limits> // For std::numeric_limits
|
#include <limits> // For std::numeric_limits
|
||||||
|
#include <omath/vector3.hpp>
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <omath/Vector4.hpp>
|
|
||||||
#include <limits> // For std::numeric_limits
|
#include <limits> // For std::numeric_limits
|
||||||
|
#include <omath/vector4.hpp>
|
||||||
|
|
||||||
using namespace omath;
|
using namespace omath;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//
|
//
|
||||||
// Created by Orange on 11/30/2024.
|
// Created by Orange on 11/30/2024.
|
||||||
//
|
//
|
||||||
#include <omath/ViewAngles.hpp>
|
#include <omath/view_angles.hpp>
|
||||||
Reference in New Issue
Block a user