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

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

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

            torque.X = pitchValue;
            gyro.SetGyroTorque(torque);
        }
示例#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();
     }
 }
示例#5
0
        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;
        }
示例#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());
     }
 }
示例#7
0
 private static void SetGyroTorqueRoll(MyGyro gyro, float rollValue)
 {
     var torque = gyro.m_gyroOverrideVelocity.Value;
     torque.Z = rollValue;
     gyro.SetGyroTorque(torque);
 }
示例#8
0
 private static void SetGyroTorquePitch(MyGyro gyro, float pitchValue)
 {
     var torque = gyro.m_gyroOverrideVelocity.Value;
     torque.X = pitchValue;
     gyro.SetGyroTorque(torque);
 }
示例#9
0
 private static void SetGyroTorqueYaw(MyGyro gyro, float yawValue)
 {
     var torque = gyro.m_gyroOverrideVelocity.Value;
     torque.Y = yawValue;
     gyro.SetGyroTorque(torque);
 }
示例#10
0
 private bool IsUsed(MyGyro gyro)
 {
     return gyro.Enabled && gyro.IsFunctional;
 }
示例#11
0
        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;
        }
示例#12
0
 public MySyncGyro(MyGyro block)
 {
     m_block = block;
 }
示例#13
0
 public GyroWrapper( MySlimBlock block )
     : base(block)
 {
     Block = (MyGyro)block.FatBlock;
     IBlock = Block;
 }