Deflection (ballistics) Formula's icon

Deflection (ballistics) Formula 1.0.0 Scripts 4.0 Community

Submitted by user neclor; MIT; 2024-06-09

Function on GDScript for calculating the vector of an “intercepting” shot, considering “external” accelerations.

Using
Function take bullet speed, target position, target velocity and optional(target_acceleration, bullet_acceleration), and returns an vector of length bullet speed.
If a hit is not possible, the function will return a zero vector.

Warning
Also used an addon for solving equations. (https://godotengine.org/asset-library/asset/2998)

Functions in current version
vector2(bullet_speed: float, target_position: Vector2, target_velocity: Vector2, target_acceleration: Vector2 = Vector2.ZERO, bullet_acceleration: Vector2 = Vector2.ZERO) -> Vector2
vector3(bullet_speed: float, target_position: Vector3, target_velocity: Vector3, target_acceleration: Vector3 = Vector3.ZERO, bullet_acceleration: Vector3 = Vector3.ZERO) -> Vector3


View files Download Submit an issue Recent Edits