示例#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);
             */
        }
示例#2
0
        public GraphicDebugWidget(Vector3 positionM) : base(positionM)
        {
            SDL.SDL_Color[] reflineColour =
            { new SDL.SDL_Color()
              {
                  r = 255, g = 0, b = 0, a = 100
              } };
            SDL.SDL_Color[] reflineHighlight =
            { new SDL.SDL_Color()
              {
                  r = 255, g = 0, b = 0, a = 255
              }, };
            ElementItem refline = new ElementItem()
            {
                NameString      = "Reference Line. ",
                Colour          = reflineColour,
                HighlightColour = reflineHighlight,

                DataString = "This should be from center to + x",
                Shape      = new ComplexShape()
                {
                    Points = new PointD[]
                    {
                        new PointD(),
                        new PointD()
                        {
                            X = 256
                        }
                    },
                    Colors        = reflineColour,
                    ColourChanges = new (int pointIndex, int colourIndex)[]