This commit is contained in:
Vladislav Alpatov
2025-03-01 21:32:02 +03:00
parent 39ab9d065d
commit c3202a3bc3
2 changed files with 13 additions and 9 deletions

View File

@@ -8,8 +8,8 @@
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang.exe",
"CMAKE_CXX_COMPILER": "clang++.exe"
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"condition": {
"type": "equals",

View File

@@ -6,7 +6,8 @@
namespace omath::projectile_prediction
{
std::optional<Vector3<float>> ProjPredEngineAVX2::MaybeCalculateAimPoint([[maybe_unused]] const Projectile& projectile,
std::optional<Vector3<float>>
ProjPredEngineAVX2::MaybeCalculateAimPoint([[maybe_unused]] const Projectile& projectile,
[[maybe_unused]] const Target& target) const
{
#ifdef OMATH_USE_AVX2
@@ -111,8 +112,9 @@ namespace omath::projectile_prediction
m_maximumSimulationTime(simulationTimeStep)
{
}
std::optional<float> ProjPredEngineAVX2::CalculatePitch(const Vector3<float>& projOrigin, const Vector3<float>& targetPos,
const float bulletGravity, const float v0, const float time)
std::optional<float> ProjPredEngineAVX2::CalculatePitch(const Vector3<float>& projOrigin,
const Vector3<float>& targetPos, const float bulletGravity,
const float v0, const float time)
{
if (time <= 0.0f)
return std::nullopt;
@@ -135,7 +137,9 @@ namespace omath::projectile_prediction
const float d = std::sqrt(dSqr);
const float tanTheta = term / d;
return angles::RadiansToDegrees(std::atan(tanTheta));
#else
throw std::runtime_error(
std::format("{} AVX2 feature is not enabled!", std::source_location::current().function_name()));
#endif
throw std::runtime_error(std::format("{} AVX2 feature is not enabled!", std::source_location::current().function_name()));
}
} // namespace omath::projectile_prediction