mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Moves camera and prediction engine implementations into traits for each engine, decoupling the engine-specific logic from the core classes, promoting code reuse and maintainability. This change allows for easier addition of new engines and customization of existing ones.
24 lines
758 B
C++
24 lines
758 B
C++
//
|
|
// Created by Vlad on 8/10/2025.
|
|
//
|
|
|
|
#pragma once
|
|
#include "omath/engines/unity_engine/formulas.hpp"
|
|
#include "omath/projection/camera.hpp"
|
|
|
|
namespace omath::unity_engine
|
|
{
|
|
class CameraTrait final
|
|
{
|
|
public:
|
|
[[nodiscard]]
|
|
static ViewAngles calc_look_at_angle(const Vector3<float>& cam_origin, const Vector3<float>& look_at) noexcept;
|
|
|
|
[[nodiscard]]
|
|
static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept;
|
|
[[nodiscard]]
|
|
static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port,
|
|
float near, float far) noexcept;
|
|
};
|
|
|
|
} // namespace omath::unity_engine
|