Package mindustry.entities
Class Predict
java.lang.Object
mindustry.entities.Predict
Class for predicting shoot angles based on velocities of targets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic arc.math.geom.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 arc.math.geom.Vec2
intercept
(arc.math.geom.Position src, arc.math.geom.Position dst, float v) static arc.math.geom.Vec2
intercept
(arc.math.geom.Position src, arc.math.geom.Position dst, float offsetx, float offsety, float v) static arc.math.geom.Vec2
intercept
(mindustry.gen.Hitboxc src, mindustry.gen.Hitboxc dst, float v)
-
Constructor Details
-
Predict
public Predict()
-
-
Method Details
-
intercept
public static arc.math.geom.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
public static arc.math.geom.Vec2 intercept(arc.math.geom.Position src, arc.math.geom.Position dst, float v) -
intercept
public static arc.math.geom.Vec2 intercept(arc.math.geom.Position src, arc.math.geom.Position dst, float offsetx, float offsety, float v) -
intercept
public static arc.math.geom.Vec2 intercept(mindustry.gen.Hitboxc src, mindustry.gen.Hitboxc dst, float v)
-