improvement

This commit is contained in:
2026-07-20 01:00:50 +03:00
parent ecc9852cd8
commit ac57e8da9e
8 changed files with 16 additions and 24 deletions
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/cry_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::cry_engine
{
@@ -16,8 +15,8 @@ namespace omath::cry_engine
const Vector3<float>& look_at) noexcept
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(internal::asin(direction.z)),
YawAngle::from_radians(-internal::atan2(direction.x, direction.y)), RollAngle::from_radians(0.f)};
return {PitchAngle::from_asin(direction.z), -YawAngle::from_atan2(direction.x, direction.y),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/frostbite_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::frostbite_engine
@@ -18,8 +17,8 @@ namespace omath::frostbite_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(-internal::asin(direction.y)),
YawAngle::from_radians(internal::atan2(direction.x, direction.z)), RollAngle::from_radians(0.f)};
return {-PitchAngle::from_asin(direction.y), YawAngle::from_atan2(direction.x, direction.z),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/iw_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::iw_engine
@@ -18,8 +17,8 @@ namespace omath::iw_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(-internal::asin(direction.z)),
YawAngle::from_radians(internal::atan2(direction.y, direction.x)), RollAngle::from_radians(0.f)};
return {-PitchAngle::from_asin(direction.z), YawAngle::from_atan2(direction.y, direction.x),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/opengl_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::opengl_engine
@@ -18,8 +17,8 @@ namespace omath::opengl_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(internal::asin(direction.y)),
YawAngle::from_radians(-internal::atan2(direction.x, -direction.z)), RollAngle::from_radians(0.f)};
return {PitchAngle::from_asin(direction.y), -YawAngle::from_atan2(direction.x, -direction.z),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/rage_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::rage_engine
@@ -18,8 +17,8 @@ namespace omath::rage_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(internal::asin(direction.z)),
YawAngle::from_radians(-internal::atan2(direction.x, direction.y)), RollAngle::from_radians(0.f)};
return {PitchAngle::from_asin(direction.z), -YawAngle::from_atan2(direction.x, direction.y),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/source_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::source_engine
@@ -18,8 +17,8 @@ namespace omath::source_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(-internal::asin(direction.z)),
YawAngle::from_radians(internal::atan2(direction.y, direction.x)), RollAngle::from_radians(0.f)};
return {-PitchAngle::from_asin(direction.z),
YawAngle::from_atan2(direction.y, direction.x), RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/unity_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::unity_engine
@@ -18,8 +17,8 @@ namespace omath::unity_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(-internal::asin(direction.y)),
YawAngle::from_radians(internal::atan2(direction.x, direction.z)), RollAngle::from_radians(0.f)};
return {-PitchAngle::from_asin(direction.y), YawAngle::from_atan2(direction.x, direction.z),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]
@@ -4,7 +4,6 @@
#pragma once
#include "omath/engines/unreal_engine/formulas.hpp"
#include "omath/internal/constexpr_math.hpp"
#include "omath/projection/camera.hpp"
namespace omath::unreal_engine
@@ -18,8 +17,8 @@ namespace omath::unreal_engine
{
const auto direction = (look_at - cam_origin).normalized();
return {PitchAngle::from_radians(internal::asin(direction.z)),
YawAngle::from_radians(internal::atan2(direction.y, direction.x)), RollAngle::from_radians(0.f)};
return {PitchAngle::from_asin(direction.z), YawAngle::from_atan2(direction.y, direction.x),
RollAngle::from_radians(0.f)};
}
[[nodiscard("view matrix result should not be discarded")]]