Пример #1
0
        public void SendVesselPositionUpdate(Vessel vessel)
        {
            var msg = MessageToPositionTransfer.CreateMessageFromVessel(vessel);

            if (msg == null)
            {
                return;
            }

            msg.GameTime = Planetarium.GetUniversalTime();

            //Update our own values in the store aswell as otherwise if we leave the vessel it can still be in the safety bubble
            VesselsProtoStore.UpdateVesselProtoPosition(msg);

            SendMessage(msg);
        }
Пример #2
0
        public void SendVesselPositionUpdate(Vessel vessel)
        {
            var msg = MessageToPositionTransfer.CreateMessageFromVessel(vessel);

            if (msg == null)
            {
                return;
            }

            msg.GameTime = Planetarium.GetUniversalTime();

            if (!vessel.loaded)
            {
                vessel.orbit?.UpdateFromStateVectors(vessel.orbit.pos, vessel.orbit.vel, vessel.orbit.referenceBody, Planetarium.GetUniversalTime());
            }

            //Update our own values in the store aswell as otherwise if we leave the vessel it can still be in the safety bubble
            VesselsProtoStore.UpdateVesselProtoPosition(msg);

            SendMessage(msg);
        }