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)); }
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); }
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"); } }
private void Start() { activeThrustMode = ThrustMode.Off; modeLabel.text = "Off"; }
void SetReverse() { activeThrustMode = ThrustMode.Reverse; modeLabel.text = "Reverse"; sThrust = 0.0f; }
void SetCruise() { activeThrustMode = ThrustMode.Cruise; modeLabel.text = "Cruise"; sThrust = 0.0f; }
void SetHover() { activeThrustMode = ThrustMode.Hover; modeLabel.text = "Hover"; }
void SetFree() { activeThrustMode = ThrustMode.Free; modeLabel.text = "Free"; sThrust = 0.0f; }