更新 'src/MultiPlayer/multiplaymgr.cxx'

This commit is contained in:
zhongjin 2022-11-06 17:08:02 +08:00
parent 1ed2656787
commit c3be883b1e

View File

@ -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);