private static void SetGyroTorqueRoll(MyGyro gyro, float rollValue) { var torque = gyro.m_gyroOverrideVelocity.Value; torque.Z = rollValue; gyro.SetGyroTorque(torque); }
private static void SetGyroTorqueYaw(MyGyro gyro, float yawValue) { var torque = gyro.m_gyroOverrideVelocity.Value; torque.Y = yawValue; gyro.SetGyroTorque(torque); }
private static void SetGyroTorquePitch(MyGyro gyro, float pitchValue) { var torque = gyro.m_gyroOverrideVelocity.Value; torque.X = pitchValue; gyro.SetGyroTorque(torque); }
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(); } }
public void Register(MyGyro gyro) { MyDebug.AssertDebug(gyro != null); MyDebug.AssertDebug(!m_gyros.Contains(gyro)); m_gyros.Add(gyro); m_gyrosChanged = true; gyro.EnabledChanged += gyro_EnabledChanged; gyro.SlimBlock.ComponentStack.IsFunctionalChanged += ComponentStack_IsFunctionalChanged; gyro.PropertiesChanged += gyro_PropertiesChanged; }
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()); } }
private bool IsUsed(MyGyro gyro) { return gyro.Enabled && gyro.IsFunctional; }
public void Unregister(MyGyro gyro) { MyDebug.AssertDebug(gyro != null); MyDebug.AssertDebug(m_gyros.Contains(gyro)); m_gyros.Remove(gyro); m_gyrosChanged = true; gyro.EnabledChanged -= gyro_EnabledChanged; gyro.SlimBlock.ComponentStack.IsFunctionalChanged -= ComponentStack_IsFunctionalChanged; }
public MySyncGyro(MyGyro block) { m_block = block; }
public GyroWrapper( MySlimBlock block ) : base(block) { Block = (MyGyro)block.FatBlock; IBlock = Block; }