// ReSharper disable once InconsistentNaming private static void InitPatch(MyGyro __instance) { var max = ((MyGyroDefinition)_gyroDefinition.GetValue(__instance)).CubeSize == MyCubeSize.Small ? MyGridPhysics.GetSmallShipMaxAngularVelocity() : MyGridPhysics.GetLargeShipMaxAngularVelocity(); _gyroOverrideVelocity.GetSync <Vector3>(__instance).ValueChangedInRange( new Vector3(-max, -max, -max), new Vector3(max, max, max) ); }
static float MaxAngularRadiansPerSecond(MyGyro gyro) { if (gyro.m_gyroDefinition.CubeSize == MyCubeSize.Small) { return(MyGridPhysics.GetSmallShipMaxAngularVelocity()); } else { Debug.Assert(gyro.m_gyroDefinition.CubeSize == MyCubeSize.Large, "Maximal grid velocity not defined for other grids than small/large"); return(MyGridPhysics.GetLargeShipMaxAngularVelocity()); } }