MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / packUpdate

Method packUpdate

Engine/source/T3D/rigidShape.cpp:1553–1579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1551//----------------------------------------------------------------------------
1552
1553U32 RigidShape::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
1554{
1555 U32 retMask = Parent::packUpdate(con, mask, stream);
1556
1557 // The rest of the data is part of the control object packet update.
1558 // If we're controlled by this client, we don't need to send it.
1559 if (stream->writeFlag(getControllingClient() == con && !(mask & InitialUpdateMask)))
1560 return retMask;
1561
1562 mDelta.move.pack(stream);
1563
1564 if (stream->writeFlag(mask & PositionMask))
1565 {
1566 stream->writeFlag(mask & ForceMoveMask);
1567
1568 stream->writeCompressedPoint(mRigid.linPosition);
1569 mathWrite(*stream, mRigid.angPosition);
1570 mathWrite(*stream, mRigid.linMomentum);
1571 mathWrite(*stream, mRigid.angMomentum);
1572 stream->writeFlag(mRigid.atRest);
1573 }
1574
1575 if(stream->writeFlag(mask & FreezeMask))
1576 stream->writeFlag(mDisableMove);
1577
1578 return retMask;
1579}
1580
1581void RigidShape::unpackUpdate(NetConnection *con, BitStream *stream)
1582{

Callers

nothing calls this directly

Calls 4

mathWriteFunction · 0.85
writeCompressedPointMethod · 0.80
writeFlagMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected