Jump to content

Phooge

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Phooge

  1. After playing around with it some more today, I came up with pretty much the same solution. And I also haven't got a clue what the manual lock is:) The mechjeb code also uses the Quaternation.Euler(90,0,0), so i gues that is the right way. I did find a way prevent the SAS to go mad when you set it: currentHeading = Quaternion.LookRotation(vessel.transform.up) * Quaternion.Euler(90,0,0); targetHeading = Quaternion.LookRotation(targetVector) * Quaternion.Euler(90,0,0); if (Quaternion.Angle(currentHeading, targetHeading) > 10) { target = Quaternion.RotateTowards(currentHeading, targetHeading, 2f); } else { target = Quaternion.LookRotation(targetHeading); } part.vessel.VesselSAS.LockHeading(target, true); Hope this makes sense.
  2. Hi Diazo, I've been looking at SAS aswell. You can create the quaternation in the direction of the vector using: quaternation.lookRotation(vector3). You can also look at the source of Mechjeb, MechJebModuleAttitudeController.cs. It has a bit with the stock SAS. I don't exactly get what they are doing, but maby you can figure it out:) Regards,
×
×
  • Create New...