Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
UYasiuMathFL_Ballistics Class Reference

Function library used for projectile prediction and missile interception calculations. More...

#include <BPFunLib_Ballistic.h>

Inheritance diagram for UYasiuMathFL_Ballistics:
UYasiuMathFunctionLibrary

Static Public Member Functions

static FBallisticObject DiscreteStep (const FBallisticObject &Ob, const float DeltaStep)
 Single iterative step.
static FBallisticObject AutoStep (const FBallisticObject &Ob, const float PredictTime, const float DeltaStep)
 Predict multiple steps in loop. Optimized for AirDrag=0, see details...
static bool Intercept_Linear (const FVector &TargetPosition, const FVector &TargetVelocity, double InterceptSpeed, FVector &HitLocation, double &HitTime)
 Prediction function for linear objects. Works only for objects with constant speeds, can not accelerate or be affected by air resistance.
static bool Intercept_Dynamic (const FBallisticObject &Target, const FBallisticInterceptor Interceptor, double MaxQueryTime, double StepTime, double AccurateStepTime, FVector &HitLocation, double &HitTime)
 Prediction function for objects with variable speed and resistance.

Detailed Description

Function library used for projectile prediction and missile interception calculations.

Member Function Documentation

◆ AutoStep()

FBallisticObject UYasiuMathFL_Ballistics::AutoStep ( const FBallisticObject & Ob,
const float PredictTime,
const float DeltaStep )
static

Predict multiple steps in loop. Optimized for AirDrag=0, see details...

Parameters
ObStruct with ballistic parameters
PredictTimeTimeRange to predict
DeltaStepSingle calculation time. Keep in small range <0.01, 1> (for accuracy). Used only when calculating air drag.
Returns
New Object state
Note
Normally function uses DiscreteStep, but switchest to fast calculation when AirDrag is 0, effectively being O(1)
YasiuMath::Ballistics::ProjectileDynamicState::AutoStep

◆ DiscreteStep()

FBallisticObject UYasiuMathFL_Ballistics::DiscreteStep ( const FBallisticObject & Ob,
const float DeltaStep )
static

Single iterative step.

Parameters
ObStruct with ballistic parameters
DeltaStepSingle calculation time. Keep in small range <0.01, 1> (for accuracy)
Returns
New Object state

◆ Intercept_Dynamic()

bool UYasiuMathFL_Ballistics::Intercept_Dynamic ( const FBallisticObject & Target,
const FBallisticInterceptor Interceptor,
double MaxQueryTime,
double StepTime,
double AccurateStepTime,
FVector & HitLocation,
double & HitTime )
static

Prediction function for objects with variable speed and resistance.

Parameters
TargetStruct with dynamic parameters of target
InterceptorStruct with dynamic parameters of interceptor
MaxQueryTimeTime range used to find solution.
StepTimeSingle calculation time. Keep in small range <0.1, 1> (for accuracy, but can use higher values).
AccurateStepTimeAccurate step time to reduce overshoot error. 0=Ignore
HitLocationOutput intercept location
HitTimeEstimated time to hit
Returns
Flag indicating if output location is valid.

◆ Intercept_Linear()

bool UYasiuMathFL_Ballistics::Intercept_Linear ( const FVector & TargetPosition,
const FVector & TargetVelocity,
double InterceptSpeed,
FVector & HitLocation,
double & HitTime )
static

Prediction function for linear objects. Works only for objects with constant speeds, can not accelerate or be affected by air resistance.

Parameters
TargetPositionTarget input position
TargetVelocityTarget input velocity
InterceptSpeedInterceptor speed in any direction
HitLocationOutput intercept location
HitTime
Returns
Flag indicating if output location is valid.

The documentation for this class was generated from the following file: