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

Method packUpdate

Engine/source/T3D/pathShape.cpp:367–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365//----------------------------------------------------------------------------
366
367U32 PathShape::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
368{
369
370 Parent::packUpdate(con,mask,stream);
371
372 if (stream->writeFlag(mask & StateMask))
373 stream->writeInt(mState,StateBits);
374
375 if (stream->writeFlag(mask & PositionMask))
376 stream->write(mPosition);
377
378 if (stream->writeFlag(mask & TargetMask))
379 if (stream->writeFlag(mTargetSet))
380 stream->write(mTarget);
381
382 if (stream->writeFlag(mask & WindowMask)) {
383 stream->write(mNodeBase);
384 stream->write(mNodeCount);
385 for (S32 i = 0; i < mNodeCount; i++) {
386 CameraSpline::Knot *knot = mSpline.getKnot(i);
387 mathWrite(*stream, knot->mPosition);
388 mathWrite(*stream, knot->mRotation);
389 stream->write(knot->mSpeed);
390 stream->writeInt(knot->mType, CameraSpline::Knot::NUM_TYPE_BITS);
391 stream->writeInt(knot->mPath, CameraSpline::Knot::NUM_PATH_BITS);
392 }
393 }
394
395 // The rest of the data is part of the control object packet update.
396 // If we're controlled by this client, we don't need to send it.
397 if(stream->writeFlag(getControllingClient() == con && !(mask & InitialUpdateMask)))
398 return 0;
399
400 return 0;
401}
402
403void PathShape::unpackUpdate(NetConnection *con, BitStream *stream)
404{

Callers

nothing calls this directly

Calls 5

mathWriteFunction · 0.85
writeIntMethod · 0.80
getKnotMethod · 0.80
writeFlagMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected