From 8a3b26d378a6aec518621bc658bb4f99a8eac63d Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 29 Jul 2026 00:20:41 +0800 Subject: [PATCH 1/2] fixed MOI calculation to match stock values --- src/kOS/Control/SteeringManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kOS/Control/SteeringManager.cs b/src/kOS/Control/SteeringManager.cs index 3938b6200..3a0e2e088 100644 --- a/src/kOS/Control/SteeringManager.cs +++ b/src/kOS/Control/SteeringManager.cs @@ -788,7 +788,9 @@ public Vector3 FindMoI() { KSPUtil.ToDiagonalMatrix2(part.rb.inertiaTensor, ref partTensor); - Quaternion rot = Quaternion.Inverse(vesselRotation) * part.transform.rotation * part.rb.inertiaTensorRotation; + // Quaternion.Euler(90, 0, 0) is to recover vesselRotation from kOS reference frame to Unity frame. + // To keep concensus with shared.Vessel.MOI + Quaternion rot = Quaternion.Inverse(vesselRotation * Quaternion.Euler(90, 0, 0)) * part.transform.rotation * part.rb.inertiaTensorRotation; Quaternion inv = Quaternion.Inverse(rot); Matrix4x4 rotMatrix = Matrix4x4.TRS(Vector3.zero, rot, Vector3.one); From 23a040c65112bb71460b06cd0d30c5dc7f4fbff8 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 17 Aug 2026 23:11:21 +0800 Subject: [PATCH 2/2] switch to stock MOI API --- src/kOS/Control/SteeringManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kOS/Control/SteeringManager.cs b/src/kOS/Control/SteeringManager.cs index 3a0e2e088..18dc4d0ea 100644 --- a/src/kOS/Control/SteeringManager.cs +++ b/src/kOS/Control/SteeringManager.cs @@ -591,8 +591,9 @@ public void UpdateStateVectors() // TODO: If stock vessel.MOI stops being so weird, we might be able to change the following line // into this instead. (See the comment on FindMOI()'s header): - // momentOfInertia = shared.Vessel.MOI; - momentOfInertia = FindMoI(); + // 20260817: According to Lamont, this issue has long been fixed, so we switch to stock vessel.MOI + momentOfInertia = shared.Vessel.MOI; + // momentOfInertia = FindMoI(); adjustTorque = Vector3d.zero; measuredTorque = Vector3d.Scale(momentOfInertia, angularAcceleration);