From ceea1285b63f62b02fd9b93b2e6cd522590ecc72 Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Mon, 7 Oct 2024 09:26:24 -0400 Subject: [PATCH] Fix incorrect vessel localCom when root part is not the control point -most notably this caused the camera to be anchored to the wrong place --- KSPCommunityFixes/Performance/FlightPerf.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KSPCommunityFixes/Performance/FlightPerf.cs b/KSPCommunityFixes/Performance/FlightPerf.cs index cac4582..8c61b48 100644 --- a/KSPCommunityFixes/Performance/FlightPerf.cs +++ b/KSPCommunityFixes/Performance/FlightPerf.cs @@ -117,7 +117,7 @@ private static bool VesselPrecalculate_CalculatePhysicsStats_Prefix(VesselPrecal vessel.rb_velocityD = velocity * vesselMassRecip; vessel.velocityD = vessel.rb_velocityD + Krakensbane.GetFrameVelocity(); vessel.CoM = vessel.CoMD; - vessel.localCoM = vesselInverseMatrix.MultiplyPoint3x4(vessel.CoMD); + vessel.localCoM = vessel.vesselTransform.InverseTransformPoint(vessel.CoM); vessel.rb_velocity = vessel.rb_velocityD; vessel.angularVelocityD = angularVelocity * vesselMassRecip; vessel.angularVelocity = vessel.angularVelocityD;