Exemplo n.º 1
0
        private void SetFlightPath()
        {
            float    speed    = (float)Rc.GetShipSpeed();
            Vector3D velocity = Rc.GetShipVelocities().LinearVelocity;

            if (speed > 5)
            {
                Vector3D endpoint = GridPosition + (Vector3D.Normalize(velocity) * 1000000);
            }
            else
            {
                Vector3D endpoint = GridPosition + (Rc.WorldMatrix.Forward * 1000000);
            }

            if (Math.Abs(_freighterSetup.CruiseSpeed - default(float)) > 0)
            {
                (Rc as MyRemoteControl)?.SetAutoPilotSpeedLimit(_freighterSetup.CruiseSpeed);
            }
            else
            {
                (Rc as MyRemoteControl)?.SetAutoPilotSpeedLimit(speed > 5 ? speed : 30);
            }

            (Rc as MyRemoteControl)?.SetCollisionAvoidance(true);
        }