Пример #1
0
            public void Init(Connection conn, Service sc, Vessel active_vessel)
            {
                var flight = active_vessel.Flight();
                var orbit  = active_vessel.Orbit;
                var body   = orbit.Body;

                // Environment
                StaticAirTemperature = conn.AddStream(() => flight.StaticAirTemperature);
                StaticPressure       = conn.AddStream(() => flight.StaticPressure);
                // Orbit
                Apoapsis       = conn.AddStream(() => orbit.Apoapsis);
                Periapsis      = conn.AddStream(() => orbit.Periapsis);
                TimeToApoapsis = conn.AddStream(() => orbit.TimeToApoapsis);
                // Vessel
                Altitude           = conn.AddStream(() => flight.MeanAltitude);
                AngularVelocity    = conn.AddStream(() => active_vessel.AngularVelocity(body.ReferenceFrame));
                AvailablePosTorque = conn.AddStream(() => active_vessel.AvailablePosTorque);
                AvailableRCSForce  = conn.AddStream(() => active_vessel.AvailableRCSForce);
                AvailableThrust    = conn.AddStream(() => active_vessel.AvailableThrust);
                AvailableTorque    = conn.AddStream(() => active_vessel.AvailableTorque);
                Direction          = conn.AddStream(() => active_vessel.Direction(body.ReferenceFrame));
                DryMass            = conn.AddStream(() => active_vessel.DryMass);
                Forward            = conn.AddStream(() => sc.TransformDirection(
                                                        new Tuple <double, double, double>(0, 1, 0),
                                                        active_vessel.ReferenceFrame, body.ReferenceFrame));
                Mass            = conn.AddStream(() => active_vessel.Mass);
                MaxVacuumThrust = conn.AddStream(() => active_vessel.MaxVacuumThrust);
                MomentOfInertia = conn.AddStream(() => active_vessel.MomentOfInertia);
                Position        = conn.AddStream(() => active_vessel.Position(body.ReferenceFrame));
                Right           = conn.AddStream(() => sc.TransformDirection(
                                                     new Tuple <double, double, double>(1, 0, 0),
                                                     active_vessel.ReferenceFrame, body.ReferenceFrame));
                Thrust = conn.AddStream(() => active_vessel.Thrust);
                Up     = conn.AddStream(() => sc.TransformDirection(
                                            new Tuple <double, double, double>(0, 0, -1),
                                            active_vessel.ReferenceFrame, body.ReferenceFrame));
                VacuumSpecificImpulse = conn.AddStream(() => active_vessel.VacuumSpecificImpulse);
                Velocity = conn.AddStream(() => active_vessel.Velocity(body.ReferenceFrame));
            }
Пример #2
0
 public Vector3 getDirection()
 {
     return(tupleToVec3(Vessel.Direction(refFrame)));
 }