Profile image

Gun bidirectional stabilizer

49.6k hfusiwjf29  4.7 years ago

This is my first post XD.

As the title,I builded a useful gun bidirectional stabilizer based on funky tree and @Leehopard 's Gatling, and I put it on Littlt Bugger.

Which case to use it in: cockpit on carriage body rather than on turret.

Link here: https://www.simpleplanes.com/a/Mjg2Wt/Little-Bugger2

You can use it on your own tank after modifying the angles and Speeds.

Angel: -12° to +60°
Speed: 0.5clamp01(Roll) ==> 0.5 sum(0.5clamp01(-Roll) ==> 0.5
pow(Pitch*0.6,3) ==> 0.6

Code here

y-axis rotato1:
Heading/180

y-axis rotato2:
sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll))))

x-axis rotato :
clamp((-(smooth(clamp(10Pitch,(-12+(-(RollAngle>0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1))+(-(RollAngle<0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading)RollAngle,-1,0))+(PitchAngle>0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),-1,0)+(PitchAngle<0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1))/180,(60+(RollAngle>0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1)+(RollAngle<0)RollAngleclamp(sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),-1,0)+(PitchAngle>0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),0,1)+(PitchAngle<0)PitchAngleclamp(cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading),-1,0))/180),abs(pow(Pitch0.6,3)))))+cos((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading)PitchAngle/180+sin((sum(0.5clamp01(Roll))+(-(sum(0.5clamp01(-Roll)))))180-Heading)*RollAngle/180,-60/180,12/180)

  • Log in to leave a comment
  • Profile image
    42.7k phrongus

    @TheRoboEli he means first forum post

    1.9 years ago
  • Profile image
    57.1k bjac0

    damn thats a big code

    +1 3.9 years ago
  • Profile image
    147k Pilotmario

    This is pretty awesome tbh. I made a few revisions to the code to inverse it, but that's mostly because of how I prefer to control turrets.

    4.6 years ago
  • Profile image

    Totally first post totally not creator of the most popular plane ever

    +3 4.6 years ago
  • Profile image
    23.1k Scratchoza

    I finally get it, N I C E

    4.7 years ago
  • Profile image
    13.9k ChrisPy

    Whoa dang man

    +1 4.7 years ago
  • Profile image
    26.7k Gameboi17

    I was thinking to use funky trees but after seeing that butt-load of coding, i change my mind

    +3 4.7 years ago
  • Profile image

    @hfusiwjf29
    OK, thanks!

    4.7 years ago
  • Profile image
    49.6k hfusiwjf29

    @ArcturusAerospace You can choose to change the speed or other, but it is not necessary.

    4.7 years ago
  • Profile image

    We have to edit the speed of whatever it is attached to?

    4.7 years ago
  • Profile image
    49.6k hfusiwjf29

    @FairFireFight thanks

    4.7 years ago
  • Profile image
    49.6k hfusiwjf29

    @DickBrazen thx,I did it!

    4.7 years ago
  • Profile image
    49.6k hfusiwjf29

    @SnoWFLakE0s But as you said, there's a lot of room for simplification.

    4.7 years ago
  • Profile image
    67.1k SnoWFLakE0s

    Cool, but the complexity is quite unnecessary.

    +1 4.7 years ago
  • Profile image

    Very cool

    4.7 years ago
  • Profile image

    ![](imageLinkHere)
    make sure to remove the "s" from "https"

    4.7 years ago