now template

This commit is contained in:
Vladislav Alpatov
2025-03-01 21:11:46 +03:00
parent 9ba3bc754a
commit 6d0d267743
43 changed files with 224 additions and 256 deletions

View File

@@ -6,7 +6,7 @@
namespace omath::projectile_prediction
{
std::optional<Vector3> ProjPredEngineAVX2::MaybeCalculateAimPoint(const Projectile& projectile,
std::optional<Vector3<float>> ProjPredEngineAVX2::MaybeCalculateAimPoint(const Projectile& projectile,
const Target& target) const
{
const float bulletGravity = m_gravityConstant * projectile.m_gravityScale;
@@ -110,7 +110,7 @@ namespace omath::projectile_prediction
m_maximumSimulationTime(simulationTimeStep)
{
}
std::optional<float> ProjPredEngineAVX2::CalculatePitch(const Vector3& projOrigin, const Vector3& targetPos,
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)

View File

@@ -11,7 +11,7 @@ namespace omath::projectile_prediction
{
}
std::optional<Vector3> ProjPredEngineLegacy::MaybeCalculateAimPoint(const Projectile& projectile,
std::optional<Vector3<float>> ProjPredEngineLegacy::MaybeCalculateAimPoint(const Projectile& projectile,
const Target& target) const
{
for (float time = 0.f; time < m_maximumSimulationTime; time += m_simulationTimeStep)
@@ -36,7 +36,7 @@ namespace omath::projectile_prediction
std::optional<float>
ProjPredEngineLegacy::MaybeCalculateProjectileLaunchPitchAngle(const Projectile& projectile,
const Vector3& targetPosition) const
const Vector3<float>& targetPosition) const
{
const auto bulletGravity = m_gravityConstant * projectile.m_gravityScale;
const auto delta = targetPosition - projectile.m_origin;
@@ -57,7 +57,7 @@ namespace omath::projectile_prediction
return angles::RadiansToDegrees(angle);
}
bool ProjPredEngineLegacy::IsProjectileReachedTarget(const Vector3& targetPosition, const Projectile& projectile,
bool ProjPredEngineLegacy::IsProjectileReachedTarget(const Vector3<float>& targetPosition, const Projectile& projectile,
const float pitch, const float time) const
{
const auto yaw = projectile.m_origin.ViewAngleTo(targetPosition).y;

View File

@@ -8,7 +8,7 @@
namespace omath::projectile_prediction
{
Vector3 Projectile::PredictPosition(const float pitch, const float yaw, const float time, const float gravity) const
Vector3<float> Projectile::PredictPosition(const float pitch, const float yaw, const float time, const float gravity) const
{
auto currentPos = m_origin + source::ForwardVector({source::PitchAngle::FromDegrees(-pitch),
source::YawAngle::FromDegrees(yaw),