Exemple #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);
             */
        }