Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Made by NumbersNumbersTheMan
- Highly Experimental Prototype
- Free License (No License at All)
- No-Explanation FunkyTrees For "FLAK AA TURRET"
- https://www.simpleplanes.com/a/C3oN8V/Flak-AA-Autoturret
- ===
- Azimuth Controls (180 Degree Rotator)
- (((TargetHeading - Heading) + (rate(TargetHeading) * ((TargetDistance) / GUNV)))/ 180) * clamp01(TargetDistance < MAXRANGE) * clamp01(TargetSelected)
- GUNV - Muzzle Velocity of Cannon Part
- MAXRANGE - Max Range of the Turret (meters)
- ===
- Elevation Controls (90 Degree Rotator)
- TargetSelected?(atan(((pow(GUNV,2)) - (sqrt((pow(GUNV,4)) - (9.81 * ((9.81 * pow((cos(TargetElevation) * TargetDistance), 2)) + ((2 * ((sin(TargetElevation) * TargetDistance))) * pow(GUNV,2)))))))/(9.81 * (cos(TargetElevation) * TargetDistance))) + rate(TargetElevation) * (TargetDistance / GUNV)) / 90:0
- GUNV - Muzzle Velocity of Cannon Part
- Compensates for gravitational acceleration.
- ===
- fuseInput (Cannon XML Attribute)
- ((cos(TargetElevation) * TargetDistance)/(cos((atan(((pow(GUNV,2)) - (sqrt((pow(GUNV,4)) - (9.81 * ((9.81 * pow((cos(TargetElevation) * TargetDistance), 2)) + ((2 * ((sin(TargetElevation) * TargetDistance))) * pow(GUNV,2)))))))/(9.81 * (cos(TargetElevation) * TargetDistance))) + rate(TargetElevation) * (TargetDistance / GUNV)) / 1) * GUNV))
- GUNV - Muzzle Velocity of Cannon Part
- Takes into account the fact that the cannon projectile does not follow a linear trajectory and attempts to explode it next to the target by finding the projectile's horizontal component and the horizontal distance of the Target.
- ===
- End.
Add Comment
Please, Sign In to add comment