public void ThrusterAngularBurn(Vector3 axis, float throttle, Space space) { if (thrusters != null) { if (throttle < 0) { axis = -axis; throttle = -throttle; } if (space == Space.Self) { axis = transform.rotation * axis; } foreach (var thruster in thrusters) { var force = thruster.transform.forward; var centre = SGT_Helper.ClosestPointToLineB(rigidbody.worldCenterOfMass, axis, thruster.transform.position); var displacement = thruster.transform.position - centre; var torque = Vector3.Cross(displacement, force); if (Mathf.Abs(Vector3.Dot(displacement.normalized, force)) < 0.9f) { if (Vector3.Dot(torque.normalized, axis) < -0.9f) { thruster.ThrusterThrottle += throttle; } } } } }