mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
initial commit
This commit is contained in:
36
include/uml/ProjectilePredictor.h
Normal file
36
include/uml/ProjectilePredictor.h
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Created by vlad on 11/6/23.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <optional>
|
||||
|
||||
namespace uml
|
||||
{
|
||||
class Vector3;
|
||||
}
|
||||
|
||||
namespace uml::prediction
|
||||
{
|
||||
class ProjectilePredictor
|
||||
{
|
||||
public:
|
||||
[[nodiscard]]
|
||||
static std::optional<Vector3> CalculateViewAngles(const Vector3& origin,
|
||||
const Vector3& target,
|
||||
const Vector3& targetVelocity,
|
||||
float gravity,
|
||||
float bulletSpeed,
|
||||
float bulletGravity,
|
||||
bool inAir);
|
||||
|
||||
private:
|
||||
[[nodiscard]]
|
||||
static std::optional<float> CalculateAimPitch(const Vector3& origin,
|
||||
const Vector3& target,
|
||||
float bulletSpeed,
|
||||
float bulletGravity);
|
||||
[[nodiscard]] static float ProjectileTravelTime(float distance, float angle, float speed);
|
||||
};
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user