public MechJebModuleScriptActionDockingAutopilot(MechJebModuleScript scriptModule, MechJebCore core) : base(scriptModule, core, NAME) { this.autopilot = core.GetComputerModule <MechJebModuleDockingAutopilot>();; this.moduleGuidance = core.GetComputerModule <MechJebModuleDockingGuidance>();; this.speedLimit = autopilot.speedLimit; this.rol = autopilot.rol; this.forceRol = autopilot.forceRol; this.overridenSafeDistance = autopilot.overridenSafeDistance; this.overrideSafeDistance = autopilot.overrideSafeDistance; this.overrideTargetSize = autopilot.overrideTargetSize; this.overridenTargetSize = autopilot.overridenTargetSize; this.safeDistance = autopilot.safeDistance; this.targetSize = autopilot.targetSize; this.drawBoundingBox = autopilot.drawBoundingBox; }
public static void DrawBoundingBox(CelestialBody mainBody, Vessel vessel, MechJebModuleDockingAutopilot.Box3d box, Color c ) { //Vector3d origin = vessel.GetWorldPos3D() - vessel.GetTransform().rotation * box.center ; //Vector3d origin = vessel.GetTransform().TransformPoint(box.center); Vector3d origin = vessel.transform.TransformPoint(box.center); Vector3d A1 = origin + vessel.transform.rotation * new Vector3d(+box.size.x, +box.size.y, +box.size.z); Vector3d A2 = origin + vessel.transform.rotation * new Vector3d(+box.size.x, -box.size.y, +box.size.z); Vector3d A3 = origin + vessel.transform.rotation * new Vector3d(-box.size.x, -box.size.y, +box.size.z); Vector3d A4 = origin + vessel.transform.rotation * new Vector3d(-box.size.x, +box.size.y, +box.size.z); Vector3d B1 = origin + vessel.transform.rotation * new Vector3d(+box.size.x, +box.size.y, -box.size.z); Vector3d B2 = origin + vessel.transform.rotation * new Vector3d(+box.size.x, -box.size.y, -box.size.z); Vector3d B3 = origin + vessel.transform.rotation * new Vector3d(-box.size.x, -box.size.y, -box.size.z); Vector3d B4 = origin + vessel.transform.rotation * new Vector3d(-box.size.x, +box.size.y, -box.size.z); GL.PushMatrix(); material.SetPass(0); GL.LoadOrtho(); GL.Begin(GL.LINES); GL.Color(c); GLVertexMap(A1); GLVertexMap(A2); GLVertexMap(A2); GLVertexMap(A3); GLVertexMap(A3); GLVertexMap(A4); GLVertexMap(A4); GLVertexMap(A1); GLVertexMap(B1); GLVertexMap(B2); GLVertexMap(B2); GLVertexMap(B3); GLVertexMap(B3); GLVertexMap(B4); GLVertexMap(B4); GLVertexMap(B1); GLVertexMap(A1); GLVertexMap(B1); GLVertexMap(A2); GLVertexMap(B2); GLVertexMap(A3); GLVertexMap(B3); GLVertexMap(A4); GLVertexMap(B4); GL.End(); GL.PopMatrix(); }
public override void OnStart(PartModule.StartState state) { autopilot = core.GetComputerModule <MechJebModuleDockingAutopilot>(); }
public override void OnStart(PartModule.StartState state) { autopilot = core.GetComputerModule<MechJebModuleDockingAutopilot>(); }