void Main()
        {
            var blocks = new List <IMyTerminalBlock>();

            GridTerminalSystem.GetBlocksOfType <IMyShipController>(blocks, NoPassenger);
            if (blocks.Count == 0)
            {
                throw new Exception("No ship controller (cockpit, etc.) available.");
            }

            controller = blocks[0] as IMyShipController;
            blocks     = new List <IMyTerminalBlock>();
            GridTerminalSystem.GetBlocksOfType <IMyGyro>(blocks);

            Gyroscopes gyros = new Gyroscopes(controller, blocks);

            debug.Append(gyros.Min).AppendLine();
            debug.Append(gyros.Max).AppendLine();
            debug.Append(gyros.Default).AppendLine();

            gyros.Yaw(gyros.Default);
            gyros.Pitch(gyros.Default);
            gyros.Roll(gyros.Default);

            gyros.Yaw(VRageMath.MathHelper.RPMToRadiansPerSecond);
            gyros.Pitch(VRageMath.MathHelper.RPMToRadiansPerSecond);
            gyros.Roll(VRageMath.MathHelper.RPMToRadiansPerSecond);

            Debug(debug.ToString());
            debug.Clear();
        }
Beispiel #2
0
        public void AddGyroskopes(List <IMyTerminalBlock> blocks)
        {
            if (gyros == null)
            {
                gyros = new Gyroscopes(ReferenceBlock, blocks);
            }

            gyros.UpdateGyroscopes(blocks);
        }