Пример #1
0
        void DepartureCalcs()
        {
            //OrbitProcessor.InstantaneousOrbitalVelocityPolarCoordinate()

            _departureOrbitalVelocity = OrbitProcessor.GetOrbitalVector(_orderEntityOrbit, _departureDateTime);
            _departureOrbitalSpeed    = _departureOrbitalVelocity.Length();
            _departureAngle           = Math.Atan2(_departureOrbitalVelocity.Y, _departureOrbitalVelocity.X);
            _moveWidget.SetDepartureProgradeAngle(_departureAngle);
        }
 void OnSystemDateTimeChange(DateTime newDate)
 {
     if (_actionDateTime < newDate)
     {
         _actionDateTime     = newDate;
         _positonAtChange_AU = OrbitProcessor.GetPosition_AU(_orderEntityOrbit, _actionDateTime);
         var vector2 = OrbitProcessor.GetOrbitalVector(_orderEntityOrbit, _actionDateTime);
         _orbitalVelocityAtChange = new ECSLib.Vector3(vector2.X, vector2.Y, 0);
         _origionalAngle          = Math.Atan2(_orbitalVelocityAtChange.X, _orbitalVelocityAtChange.Y);
     }
 }
        void OnEntityChange(EntityState entity)
        {
            OrderingEntity    = entity;
            _actionDateTime   = _state.PrimarySystemDateTime;
            _orderEntityOrbit = entity.Entity.GetDataBlob <OrbitDB>();

            _massParentBody     = _orderEntityOrbit.Parent.GetDataBlob <MassVolumeDB>().Mass;
            _massOrderingEntity = OrderingEntity.Entity.GetDataBlob <MassVolumeDB>().Mass;
            _stdGravParam       = GameConstants.Science.GravitationalConstant * (_massParentBody + _massOrderingEntity) / 3.347928976e33;

            _positonAtChange_AU = OrbitProcessor.GetPosition_AU(_orderEntityOrbit, _actionDateTime);
            var velAtChange2d = OrbitProcessor.GetOrbitalVector(_orderEntityOrbit, _actionDateTime);

            _orbitalVelocityAtChange = new ECSLib.Vector3(velAtChange2d.X, velAtChange2d.Y, 0);
            _origionalAngle          = Math.Atan2(_orbitalVelocityAtChange.X, _orbitalVelocityAtChange.Y);
            IsActive = true;
        }