예제 #1
0
        void OnEntityChange(EntityState entity)
        {
            OrderingEntity    = entity;
            _actionDateTime   = _uiState.PrimarySystemDateTime;
            _orderEntityOrbit = entity.Entity.GetDataBlob <OrbitDB>();

            _massParentBody     = _orderEntityOrbit.Parent.GetDataBlob <MassVolumeDB>().Mass;
            _massOrderingEntity = OrderingEntity.Entity.GetDataBlob <MassVolumeDB>().Mass;
            _stdGravParam_m     = OrbitMath.CalculateStandardGravityParameterInM3S2(_massOrderingEntity, _massParentBody);

            _positonAtChange_m = OrbitProcessor.GetPosition_m(_orderEntityOrbit, _actionDateTime);
            var velAtChange2d = OrbitProcessor.GetOrbitalVector_m(_orderEntityOrbit, _actionDateTime);

            _orbitalVelocityAtChange_m = new Vector3(velAtChange2d.X, velAtChange2d.Y, 0);
            _origionalAngle            = Math.Atan2(_orbitalVelocityAtChange_m.X, _orbitalVelocityAtChange_m.Y);


            var newtondb = entity.Entity.GetDataBlob <NewtonThrustAbilityDB>();

            _newtonUI = new NewtonionOrderUI(newtondb, _massOrderingEntity);



            IsActive = true;
        }
예제 #2
0
 public override void OnSystemTickChange(DateTime newDate)
 {
     if (_actionDateTime < newDate)
     {
         _actionDateTime    = newDate;
         _positonAtChange_m = OrbitProcessor.GetPosition_m(_orderEntityOrbit, _actionDateTime);
         var vector2 = OrbitProcessor.GetOrbitalVector_m(_orderEntityOrbit, _actionDateTime);
         _orbitalVelocityAtChange_m = new Vector3(vector2.X, vector2.Y, 0);
         _origionalAngle            = Math.Atan2(_orbitalVelocityAtChange_m.X, _orbitalVelocityAtChange_m.Y);
     }
 }