Exemple #1
0
        public void ChangeMode(ThrustMode newMode)
        {
            if (newMode == this.Mode)
            {
                return;
            }

            this.Mode     = newMode;
            this.Strafing = false;
            this.SetThrust(new Vector3I(0, 0, 0), new Vector3I(0, 0, 0));
        }
Exemple #2
0
        public ThrustSystem(IMyRemoteControl remoteControl)
        {
            AngleAllowedForForwardThrust    = 35;
            MaxVelocityAngleForSpeedControl = 5;
            AllowStrafing        = false;
            StrafeMinDurationMs  = 750;
            StrafeMaxDurationMs  = 1500;
            StrafeMinCooldownMs  = 1000;
            StrafeMaxCooldownMs  = 3000;
            StrafeSpeedCutOff    = 100;
            StrafeDistanceCutOff = 100;

            StrafeMinimumTargetDistance      = 250;
            StrafeMinimumSafeAngleFromTarget = 25;

            AllowedStrafingDirectionsSpace  = new Vector3I(1, 1, 1);
            AllowedStrafingDirectionsPlanet = new Vector3I(1, 1, 1);

            RemoteControl  = null;
            Mode           = ThrustMode.None;
            ThrustProfiles = new List <ThrustProfile>();
            Rnd            = new Random();

            CurrentAllowedThrust  = Vector3I.Zero;
            CurrentRequiredThrust = Vector3I.Zero;

            if (StrafeMinDurationMs >= StrafeMaxDurationMs)
            {
                StrafeMaxDurationMs = StrafeMinDurationMs + 1;
            }

            if (StrafeMinCooldownMs >= StrafeMaxCooldownMs)
            {
                StrafeMaxCooldownMs = StrafeMinCooldownMs + 1;
            }

            _referenceOrientation = new MyBlockOrientation(Base6Directions.Direction.Forward, Base6Directions.Direction.Up);

            Strafing = false;
            CurrentStrafeDirections        = Vector3I.Zero;
            CurrentAllowedStrafeDirections = Vector3I.Zero;
            ThisStrafeDuration             = Rnd.Next(StrafeMinDurationMs, StrafeMaxDurationMs);
            ThisStrafeCooldown             = Rnd.Next(StrafeMinCooldownMs, StrafeMaxCooldownMs);
            LastStrafeStartTime            = MyAPIGateway.Session.GameDateTime;
            LastStrafeEndTime = MyAPIGateway.Session.GameDateTime;

            _collisionStrafeAdjusted        = false;
            _minAngleDistanceStrafeAdjusted = false;
            _collisionStrafeDirection       = Vector3D.Zero;

            Setup(remoteControl);
        }
Exemple #3
0
 private void radThruster_CheckedChanged(object sender, EventArgs e)
 {
     if (radThrusterStandard.Checked)
     {
         _thrustMode = ThrustMode.Standard;
     }
     else if (radThrusterTwin.Checked)
     {
         _thrustMode = ThrustMode.Twin;
     }
     else if (radThrusterCustom.Checked)
     {
         _thrustMode = ThrustMode.Custom;
     }
     else
     {
         throw new ApplicationException("None of the thrust modes are selected");
     }
 }
Exemple #4
0
 private void Start()
 {
     activeThrustMode = ThrustMode.Off;
     modeLabel.text   = "Off";
 }
Exemple #5
0
 void SetReverse()
 {
     activeThrustMode = ThrustMode.Reverse;
     modeLabel.text   = "Reverse";
     sThrust          = 0.0f;
 }
Exemple #6
0
 void SetCruise()
 {
     activeThrustMode = ThrustMode.Cruise;
     modeLabel.text   = "Cruise";
     sThrust          = 0.0f;
 }
Exemple #7
0
 void SetHover()
 {
     activeThrustMode = ThrustMode.Hover;
     modeLabel.text   = "Hover";
 }
Exemple #8
0
 void SetFree()
 {
     activeThrustMode = ThrustMode.Free;
     modeLabel.text   = "Free";
     sThrust          = 0.0f;
 }
        private void radThruster_CheckedChanged(object sender, EventArgs e)
        {

            if (radThrusterStandard.Checked)
            {
                _thrustMode = ThrustMode.Standard;
            }
            else if (radThrusterTwin.Checked)
            {
                _thrustMode = ThrustMode.Twin;
            }
            else if (radThrusterCustom.Checked)
            {
                _thrustMode = ThrustMode.Custom;
            }
            else
            {
                throw new ApplicationException("None of the thrust modes are selected");
            }

        }