Jump to content

About adding yaw stability to a single part aircraft


Recommended Posts

I am making a single part aircraft add-on and find it is quite hard to add yaw stability to it.

What I want to do is adding a force(torque) depends the deviation angle(velocity) between aircraft direction and surface velocity.

But I find it is a little tricky to use part.TransformDirection to figure out the deviation angle(velocity) and how to use Rigidbody.AddForce/torque in the right way.

I would be thankful for any help.:)

Link to comment
Share on other sites

So, this is what I have

Vector3 srfVelocity = vessel.GetSrfVelocity();

Vector3 Airspeed = part.transform.InverseTransformDirection(srfVelocity);

double rho = FlightGlobals.getAtmDensity(FlightGlobals.getStaticPressure(transform.position)); ;

{

if (Airspeed.x >= 0)

part.rigidbody.AddForce((float)rho * Airspeed.x * yaws, 0, 0);

else

part.rigidbody.AddForce((float)rho * -Airspeed.x * yaws, 0, 0);

}

These one could add force to slow down the aircraft but not depends on the deviation angle(velocity) between aircraft direction and surface velocity, the force is depends on the deviation angle(velocity) between surface direction (which is 90°) and surface velocity.

I would be thankful for any help.

Edited by flywlyx
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...