|
Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
|
Linear and dynamic objects simulation / prediction. More...
Classes | |
| struct | ProjectileDynamicState |
| Ballistic state. Can move in time with DiscreteStep function. More... | |
| struct | InterceptorParams |
| Params used for ballistics predictions. More... | |
Functions | |
| template<typename T> | |
| bool | InterceptMissile_Linear (const Types::Vec3< T > &MissilePosition, const Types::Vec3< T > &MissileVelocity, const T BulletSpeed, Types::Vec3< T > &InterceptLocation, T &ImpactTime) |
| Linear movement with linear velocity, Fast: O(1). | |
| template<typename T> | |
| bool | InterceptMissile_Linear (const Vec3< T > &TargetPosition, const Vec3< T > &TargetVelocity, const T BulletSpeed, Vec3< T > &InterceptLocation) |
| Linear movement with linear velocity, Fast: O(1). | |
| template<typename T> | |
| bool | InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, Types::Vec3< T > &PredictedLocation) |
| Iterative state prediction. Returns first possible intercept location and time. | |
| template<typename T> | |
| bool | InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, Types::Vec3< T > &HitLocation, T &HitTime) |
| Iterative state prediction. Returns first possible intercept location and time. | |
| template<typename T> | |
| bool | InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, const T AccurateStepTime, Types::Vec3< T > &HitLocation) |
| Iterative state prediction. Returns first possible intercept location and time. | |
| template<typename T> | |
| bool | InterceptMissile_Dynamic (ProjectileDynamicState< T > Target, const InterceptorParams< T > &Interceptor, const T MaxQueryTime, const T StepTime, const T AccurateStepTime, Types::Vec3< T > &HitLocation, T &HitTime) |
| FULL IMPL. | |
Linear and dynamic objects simulation / prediction.
| bool YasiuMath::Ballistics::InterceptMissile_Dynamic | ( | ProjectileDynamicState< T > | Target, |
| const InterceptorParams< T > & | Interceptor, | ||
| const T | MaxQueryTime, | ||
| const T | StepTime, | ||
| const T | AccurateStepTime, | ||
| Types::Vec3< T > & | HitLocation ) |
Iterative state prediction. Returns first possible intercept location and time.
Accuracy is based on DeltaTime.
| Target | State of missile |
| Interceptor | Params of interceptor |
| MaxQueryTime | Prediction time to intercept |
| StepTime | Prediction resolution, how big steps to make. Smaller steps = more steps. |
| AccurateStepTime | Stepsize used in last phase to determine accurate result, 0=Skip accurate phase |
| HitLocation | Predicted intercept location |
| bool YasiuMath::Ballistics::InterceptMissile_Dynamic | ( | ProjectileDynamicState< T > | Target, |
| const InterceptorParams< T > & | Interceptor, | ||
| const T | MaxQueryTime, | ||
| const T | StepTime, | ||
| const T | AccurateStepTime, | ||
| Types::Vec3< T > & | HitLocation, | ||
| T & | HitTime ) |
FULL IMPL.
Iterative state prediction. Returns first possible intercept location and time.
Accuracy is based on StepTime and slightly overshoot position.
AccurateStepTime will iterate positon in last step to evaluate more precise hit. AccurateStepTime=0 will not do better estimation.
Implementation with all arguments.
| Target | State of missile |
| Interceptor | Params of interceptor |
| MaxQueryTime | Prediction time to intercept |
| StepTime | Prediction resolution, how big steps to make. Smaller steps = more steps. |
| AccurateStepTime | SmallStep used to estimate more accurate results |
| HitLocation | Predicted intercept location |
| HitTime | Estimated time |
| bool YasiuMath::Ballistics::InterceptMissile_Dynamic | ( | ProjectileDynamicState< T > | Target, |
| const InterceptorParams< T > & | Interceptor, | ||
| const T | MaxQueryTime, | ||
| const T | StepTime, | ||
| Types::Vec3< T > & | HitLocation, | ||
| T & | HitTime ) |
Iterative state prediction. Returns first possible intercept location and time.
Accuracy is based on DeltaTime.
Return HitTime arguments.
| Target | State of missile |
| Interceptor | Params of interceptor |
| MaxQueryTime | Prediction time to intercept |
| StepTime | Prediction resolution, how big steps to make. Smaller steps = more steps. |
| HitLocation | Predicted intercept location |
| HitTime | Estimated time |
| bool YasiuMath::Ballistics::InterceptMissile_Dynamic | ( | ProjectileDynamicState< T > | Target, |
| const InterceptorParams< T > & | Interceptor, | ||
| const T | MaxQueryTime, | ||
| const T | StepTime, | ||
| Types::Vec3< T > & | PredictedLocation ) |
Iterative state prediction. Returns first possible intercept location and time.
Accuracy is based on DeltaTime.
Minimal arguments.
| Target | State of missile |
| Interceptor | Params of interceptor |
| MaxQueryTime | Prediction time to intercept |
| StepTime | Prediction resolution, how big steps to make. Smaller steps = more steps. |
| PredictedLocation | Predicted intercept location |
| bool YasiuMath::Ballistics::InterceptMissile_Linear | ( | const Types::Vec3< T > & | MissilePosition, |
| const Types::Vec3< T > & | MissileVelocity, | ||
| const T | BulletSpeed, | ||
| Types::Vec3< T > & | InterceptLocation, | ||
| T & | ImpactTime ) |
Linear movement with linear velocity, Fast: O(1).
| MissilePosition | Current Relative position |
| MissileVelocity | Current Vector |
| BulletSpeed | Maximal bullet speed |
| InterceptLocation | Position relative to bullet starting position |
| ImpactTime | Predicted time |
| bool YasiuMath::Ballistics::InterceptMissile_Linear | ( | const Vec3< T > & | TargetPosition, |
| const Vec3< T > & | TargetVelocity, | ||
| const T | BulletSpeed, | ||
| Vec3< T > & | InterceptLocation ) |
Linear movement with linear velocity, Fast: O(1).
| TargetPosition | Current Relative position |
| TargetVelocity | Current Vector |
| BulletSpeed | Maximal bullet speed |
| InterceptLocation | Position relative to bullet starting position |