Guest User

Simpleplanes Funky Trees Cannon Flak Turret

a guest
Sep 9th, 2020
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. Made by NumbersNumbersTheMan
  2. Highly Experimental Prototype
  3. Free License (No License at All)
  4.  
  5. No-Explanation FunkyTrees For "FLAK AA TURRET"
  6. https://www.simpleplanes.com/a/C3oN8V/Flak-AA-Autoturret
  7.  
  8. ===
  9. Azimuth Controls (180 Degree Rotator)
  10. (((TargetHeading - Heading) + (rate(TargetHeading) * ((TargetDistance) / GUNV)))/ 180) * clamp01(TargetDistance < MAXRANGE) * clamp01(TargetSelected)
  11.  
  12. GUNV - Muzzle Velocity of Cannon Part
  13. MAXRANGE - Max Range of the Turret (meters)
  14. ===
  15. Elevation Controls (90 Degree Rotator)
  16. 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
  17.  
  18. GUNV - Muzzle Velocity of Cannon Part
  19. Compensates for gravitational acceleration.
  20. ===
  21. fuseInput (Cannon XML Attribute)
  22. ((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))
  23.  
  24. GUNV - Muzzle Velocity of Cannon Part
  25. 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.
  26. ===
  27. End.
  28.  
  29.  
  30.  
Add Comment
Please, Sign In to add comment