更新 'src/MultiPlayer/multiplaymgr.cxx'
This commit is contained in:
@@ -729,11 +729,6 @@ namespace
|
|||||||
{
|
{
|
||||||
bool verifyProperties(const xdr_data_t* data, const xdr_data_t* end)
|
bool verifyProperties(const xdr_data_t* data, const xdr_data_t* end)
|
||||||
{
|
{
|
||||||
|
|
||||||
//zhongjin
|
|
||||||
using namespace simgear;
|
|
||||||
FlightProperties ifce;
|
|
||||||
|
|
||||||
const xdr_data_t* xdr = data;
|
const xdr_data_t* xdr = data;
|
||||||
while (xdr < end) {
|
while (xdr < end) {
|
||||||
unsigned id = XDR_decode_uint32(*xdr);
|
unsigned id = XDR_decode_uint32(*xdr);
|
||||||
@@ -1349,7 +1344,9 @@ FGMultiplayMgr::isSane(const FGExternalMotionData& motionInfo)
|
|||||||
void
|
void
|
||||||
FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
|
FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
|
||||||
{
|
{
|
||||||
|
//zhongjin
|
||||||
using namespace simgear;
|
using namespace simgear;
|
||||||
|
FlightProperties ifce;
|
||||||
|
|
||||||
int protocolToUse = getProtocolToUse();
|
int protocolToUse = getProtocolToUse();
|
||||||
int transmitFilterPropertyBase = pMultiPlayTransmitPropertyBase->getIntValue();
|
int transmitFilterPropertyBase = pMultiPlayTransmitPropertyBase->getIntValue();
|
||||||
@@ -1437,6 +1434,11 @@ FGMultiplayMgr::SendMyPosition(const FGExternalMotionData& motionInfo)
|
|||||||
//zhongjin
|
//zhongjin
|
||||||
// for (unsigned i = 0 ; i < 3; ++i)
|
// for (unsigned i = 0 ; i < 3; ++i)
|
||||||
// PosMsg->angularAccel[i] = XDR_encode_float (motionInfo.angularAccel(i) * timeAccel * timeAccel);
|
// 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[0] = XDR_encode_float (motionInfo.angularAccel(0) * timeAccel * timeAccel);
|
||||||
PosMsg->angularAccel[1] = XDR_encode_float (motionInfo.angularAccel(1) * timeAccel * timeAccel);
|
PosMsg->angularAccel[1] = XDR_encode_float (motionInfo.angularAccel(1) * timeAccel * timeAccel);
|
||||||
PosMsg->angularAccel[2] = XDR_encode_float (motionInfo.angularAccel(2) * timeAccel * timeAccel);
|
PosMsg->angularAccel[2] = XDR_encode_float (motionInfo.angularAccel(2) * timeAccel * timeAccel);
|
||||||
|
|||||||
Reference in New Issue
Block a user