Created
August 13, 2025 01:09
-
-
Save lamont-granquist/b47bd1a121c718c17d98c3c993cd827c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FlightCtrlState ctrlState = base.part.vessel.ctrlState; | |
inputVector = new Vector3(ignorePitch ? 0f : ctrlState.pitch, ignoreRoll ? 0f : ctrlState.roll, ignoreYaw ? 0f : ctrlState.yaw); | |
float num = actuatorSpeed * TimeWarp.fixedDeltaTime / ctrlSurfaceRange; | |
if (!useExponentialSpeed) | |
{ | |
rotatingControlInput.x = Mathf.MoveTowards(rotatingControlInput.x, inputVector.x, num); | |
rotatingControlInput.y = Mathf.MoveTowards(rotatingControlInput.y, inputVector.y, num); | |
rotatingControlInput.z = Mathf.MoveTowards(rotatingControlInput.z, inputVector.z, num); | |
} | |
else | |
{ | |
rotatingControlInput.x = Mathf.Lerp(rotatingControlInput.x, inputVector.x, num); | |
rotatingControlInput.y = Mathf.Lerp(rotatingControlInput.y, inputVector.y, num); | |
rotatingControlInput.z = Mathf.Lerp(rotatingControlInput.z, inputVector.z, num); | |
} | |
action = Vector3.Dot(rotatingControlInput, zero); | |
deflection = ctrlSurfaceRange * action * authorityLimiter * 0.01f; | |
if (deploy) | |
{ | |
currentDeployAngle = (deployInvert ? (-1f) : 1f) * (partDeployInvert ? (-1f) : 1f) * deployAngle * deflectionDirection; | |
deflection += currentDeployAngle; | |
} | |
deflection = Mathf.Clamp(deflection, -1.5f * ctrlSurfaceRange, 1.5f * ctrlSurfaceRange); | |
ctrlSurface.localRotation = neutral * Quaternion.AngleAxis(0f - deflection, Vector3.right); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment