I'm trying to simulate aerodynamic compression at high speeds; I've already written a code for my elevons right here: clamp(clamp(Pitch*1, -1, 0.5) + -Roll*0.5, -1, 1)
It restricts the maximum deflection angle in a downwards pitch half to that of the upwards pitch, AND restricts the maximum overall deflection angle together with the roll angle. I did find a line of code that closely simulates aerodynamic compression right here: Pitch/(1+pow(IAS/150,2))
I want to retain the downwards pitch and roll angle restriction while also implementing the compression code, but I haven't managed to do so just yet.
Is it even possible?
@Hellsverg Just use what you wrote for pitch for roll. About the issue at high speeds, just tweak the values a bit.
@PlaneFlightX YES, it works beautifully! But I also want the compression to affect the roll angle too. I've written this line but the effect is way too strong if I'm being honest. Too much compression at high speeds but just fine at 500-600kph:
clamp(clamp(Pitch/(1+pow(IAS/343,2)), -1, 0.5) + -Roll/(1+pow(IAS/343,2))*0.5, -1, 1)
From your first code, take the
Pitch*1
. Replace it with the second code. That should work.