Esempio n. 1
0
        void InsertionCalcs()
        {
            _deltaV_MS = _newtonUI.DeltaV;
            OrbitDB targetOrbit = TargetEntity.Entity.GetDataBlob <OrbitDB>();

            (Vector3 position, DateTime eti)targetIntercept = OrbitProcessor.GetInterceptPosition_m(OrderingEntityState.Entity, TargetEntity.Entity.GetDataBlob <OrbitDB>(), _departureDateTime);

            DateTime estArivalDateTime = targetIntercept.eti;                                                                                  //rough calc.

            Vector3 insertionVector = OrbitProcessor.GetOrbitalInsertionVector_m(_departureOrbitalVelocity_m, targetOrbit, estArivalDateTime); //_departureOrbitalVelocity - parentOrbitalVector;

            _insertionOrbitalVelocity_m = insertionVector;

            _insertionOrbitalVelocity_m += _deltaV_MS;
            _insertionOrbitalSpeed_m     = _insertionOrbitalVelocity_m.Length();
            _insertionAngle              = Math.Atan2(_insertionOrbitalVelocity_m.Y, _insertionOrbitalVelocity_m.X);
            _moveWidget.SetArivalProgradeAngle(_insertionAngle);

            /*
             * var sgpCBAU = GameConstants.Science.GravitationalConstant * (_massCurrentBody + _massOrderingEntity) / 3.347928976e33;// (149597870700 * 149597870700 * 149597870700);
             * var ralPosCBAU = OrderingEntity.Entity.GetDataBlob<PositionDB>().RelativePosition_AU;
             * var smaCurrOrbtAU = OrderingEntity.Entity.GetDataBlob<OrbitDB>().SemiMajorAxis;
             * var velAU = OrbitProcessor.PreciseOrbitalVector(sgpCBAU, ralPosCBAU, smaCurrOrbtAU);
             */
        }
Esempio n. 2
0
 internal override void MapClicked(ECSLib.Vector3 worldPos_m, MouseButtons button)
 {
     if (button == MouseButtons.Primary)
     {
         fsm[(byte)CurrentState, (byte)Events.SelectedPosition].Invoke();
     }
     if (button == MouseButtons.Alt)
     {
         fsm[(byte)CurrentState, (byte)Events.AltClicked].Invoke();
     }
 }
Esempio n. 3
0
        void DepartureCalcs()
        {
            //OrbitProcessor.InstantaneousOrbitalVelocityPolarCoordinate()


            if (OrbitProcessor.UseRalitiveVelocity)
            {
                _departureOrbitalVelocity_m = Entity.GetRalitiveFutureVelocity(OrderingEntityState.Entity, _departureDateTime);
            }
            else
            {
                _departureOrbitalVelocity_m = Entity.GetAbsoluteFutureVelocity(OrderingEntityState.Entity, _departureDateTime);
            }

            _departureOrbitalSpeed_m = _departureOrbitalVelocity_m.Length();
            _departureAngle          = Math.Atan2(_departureOrbitalVelocity_m.Y, _departureOrbitalVelocity_m.X);
            _moveWidget.SetDepartureProgradeAngle(_departureAngle);
            if (_newtonUI != null)
            {
                _newtonUI.DepartureAngle = _departureAngle;
            }
        }