Package mindustry.entities
Class Predict
java.lang.Object
mindustry.entities.Predict
Class for predicting shoot angles based on velocities of targets.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Vec2
intercept
(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v) Calculates of intercept of a stationary and moving target.static Vec2
static Vec2
static Vec2
intercept
(mindustry.gen.Hitboxc src, mindustry.gen.Hitboxc dst, float v)
-
Constructor Details
-
Predict
public Predict()
-
-
Method Details
-
intercept
public static Vec2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v) Calculates of intercept of a stationary and moving target. Do not call from multiple threads!- Parameters:
srcx
- X of shootersrcy
- Y of shooterdstx
- X of targetdsty
- Y of targetdstvx
- X velocity of target (subtract shooter X velocity if needed)dstvy
- Y velocity of target (subtract shooter Y velocity if needed)v
- speed of bullet- Returns:
- the intercept location
-
intercept
-
intercept
-
intercept
-