mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
patch
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
"binaryDir": "${sourceDir}/cmake-build/build/${presetName}",
|
||||||
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
"installDir": "${sourceDir}/cmake-build/install/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER": "clang.exe",
|
"CMAKE_C_COMPILER": "cl.exe",
|
||||||
"CMAKE_CXX_COMPILER": "clang++.exe"
|
"CMAKE_CXX_COMPILER": "cl.exe"
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"type": "equals",
|
"type": "equals",
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
namespace omath::projectile_prediction
|
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
|
[[maybe_unused]] const Target& target) const
|
||||||
{
|
{
|
||||||
#ifdef OMATH_USE_AVX2
|
#ifdef OMATH_USE_AVX2
|
||||||
@@ -111,8 +112,9 @@ namespace omath::projectile_prediction
|
|||||||
m_maximumSimulationTime(simulationTimeStep)
|
m_maximumSimulationTime(simulationTimeStep)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
std::optional<float> ProjPredEngineAVX2::CalculatePitch(const Vector3<float>& projOrigin, const Vector3<float>& targetPos,
|
std::optional<float> ProjPredEngineAVX2::CalculatePitch(const Vector3<float>& projOrigin,
|
||||||
const float bulletGravity, const float v0, const float time)
|
const Vector3<float>& targetPos, const float bulletGravity,
|
||||||
|
const float v0, const float time)
|
||||||
{
|
{
|
||||||
if (time <= 0.0f)
|
if (time <= 0.0f)
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
@@ -135,7 +137,9 @@ namespace omath::projectile_prediction
|
|||||||
const float d = std::sqrt(dSqr);
|
const float d = std::sqrt(dSqr);
|
||||||
const float tanTheta = term / d;
|
const float tanTheta = term / d;
|
||||||
return angles::RadiansToDegrees(std::atan(tanTheta));
|
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
|
#endif
|
||||||
throw std::runtime_error(std::format("{} AVX2 feature is not enabled!", std::source_location::current().function_name()));
|
|
||||||
}
|
}
|
||||||
} // namespace omath::projectile_prediction
|
} // namespace omath::projectile_prediction
|
||||||
|
|||||||
Reference in New Issue
Block a user