Beispiel #1
0
        private static void SetGyroTorqueRoll(MyGyro gyro, float rollValue)
        {
            var torque = gyro.m_gyroOverrideVelocity.Value;

            torque.Z = rollValue;
            gyro.SetGyroTorque(torque);
        }
Beispiel #2
0
        private static void SetGyroTorqueYaw(MyGyro gyro, float yawValue)
        {
            var torque = gyro.m_gyroOverrideVelocity.Value;

            torque.Y = yawValue;
            gyro.SetGyroTorque(torque);
        }
Beispiel #3
0
        private static void SetGyroTorquePitch(MyGyro gyro, float pitchValue)
        {
            var torque = gyro.m_gyroOverrideVelocity.Value;

            torque.X = pitchValue;
            gyro.SetGyroTorque(torque);
        }
Beispiel #4
0
 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;
        }
Beispiel #6
0
 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());
     }
 }
Beispiel #7
0
 private static void SetGyroTorqueRoll(MyGyro gyro, float rollValue)
 {
     var torque = gyro.m_gyroOverrideVelocity.Value;
     torque.Z = rollValue;
     gyro.SetGyroTorque(torque);
 }
Beispiel #8
0
 private static void SetGyroTorquePitch(MyGyro gyro, float pitchValue)
 {
     var torque = gyro.m_gyroOverrideVelocity.Value;
     torque.X = pitchValue;
     gyro.SetGyroTorque(torque);
 }
Beispiel #9
0
 private static void SetGyroTorqueYaw(MyGyro gyro, float yawValue)
 {
     var torque = gyro.m_gyroOverrideVelocity.Value;
     torque.Y = yawValue;
     gyro.SetGyroTorque(torque);
 }
 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;
        }
Beispiel #12
0
 public MySyncGyro(MyGyro block)
 {
     m_block = block;
 }
 public GyroWrapper( MySlimBlock block )
     : base(block)
 {
     Block = (MyGyro)block.FatBlock;
     IBlock = Block;
 }