From 4111852e0ba3f4bde51ae500ffea66b3125efb96 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Mon, 7 Nov 2022 12:57:52 +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 | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index 2fcaedd..35f8faa 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -1433,18 +1433,23 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo) for (unsigned i = 0 ; i < 3; ++i) PosMsg->linearAccel[i] = XDR_encode_float (motionInfo.linearAccel(i) * timeAccel * timeAccel); -//zhongjin -// for (unsigned i = 0 ; i < 3; ++i) -// PosMsg->angularAccel[i] = XDR_encode_float (motionInfo.angularAccel(i) * timeAccel * timeAccel); + 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(); + //zhongjin - PosMsg->angularAccel[0] = XDR_encode_float (heading); - PosMsg->angularAccel[1] = XDR_encode_float (pitch); - PosMsg->angularAccel[2] = XDR_encode_float (roll); + float heading = ifce.get_Psi(); + float pitch = ifce.get_Theta(); + float roll = ifce.get_Phi(); + PosMsg->jwhtext[0] = XDR_encode_float (heading); + PosMsg->jwhtext[1] = XDR_encode_float (pitch); + PosMsg->jwhtext[2] = XDR_encode_float (roll); + + SGPropertyNode* n = fgGetNode("/sim/replay/log-raw-speed-multiplayer-values", true /*create*/); + float speed = n->getDoubleValue(speed); + PosMsg->jwhtext[3] = XDR_encode_float (speed); + } xdr_data_t* ptr = msgBuf.properties();