From c3be883b1e4bb8d9797d124adf7a5370a50e9bf7 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Sun, 6 Nov 2022 17:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'src/MultiPlayer/multiplay?= =?UTF-8?q?mgr.cxx'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MultiPlayer/multiplaymgr.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index 3f1d371..0f5414c 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -729,11 +729,6 @@ namespace { bool verifyProperties(const xdr_data_t* data, const xdr_data_t* end) { - - //zhongjin - using namespace simgear; - FlightProperties ifce; - const xdr_data_t* xdr = data; while (xdr < end) { unsigned id = XDR_decode_uint32(*xdr); @@ -1349,7 +1344,9 @@ FGMultiplayMgr::isSane(const FGExternalMotionData& motionInfo) void FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo) { + //zhongjin using namespace simgear; + FlightProperties ifce; int protocolToUse = getProtocolToUse(); int transmitFilterPropertyBase = pMultiPlayTransmitPropertyBase->getIntValue(); @@ -1437,6 +1434,11 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo) //zhongjin // for (unsigned i = 0 ; i < 3; ++i) // PosMsg->angularAccel[i] = XDR_encode_float (motionInfo.angularAccel(i) * timeAccel * timeAccel); + + float heading = ifce.get_Psi(); + float pitch = ifce.get_Theta(); + float roll = ifce.get_Phi(); + PosMsg->angularAccel[0] = XDR_encode_float (motionInfo.angularAccel(0) * timeAccel * timeAccel); PosMsg->angularAccel[1] = XDR_encode_float (motionInfo.angularAccel(1) * timeAccel * timeAccel); PosMsg->angularAccel[2] = XDR_encode_float (motionInfo.angularAccel(2) * timeAccel * timeAccel);