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)
@TheRoboEli he means first forum post
damn thats a big code
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.
Totally first post totally not creator of the most popular plane ever
I finally get it, N I C E
Whoa dang man
I was thinking to use funky trees but after seeing that butt-load of coding, i change my mind
@hfusiwjf29
OK, thanks!
@ArcturusAerospace You can choose to change the speed or other, but it is not necessary.
We have to edit the speed of whatever it is attached to?
@FairFireFight thanks
@DickBrazen thx,I did it!
@SnoWFLakE0s But as you said, there's a lot of room for simplification.
Cool, but the complexity is quite unnecessary.
Very cool
![](imageLinkHere)
make sure to remove the "s" from "https"