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

Method packUpdate

Engine/source/T3D/pathCamera.cpp:417–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417U32 PathCamera::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
418{
419 Parent::packUpdate(con,mask,stream);
420
421 if (stream->writeFlag(mask & StateMask))
422 stream->writeInt(mState,StateBits);
423
424 if (stream->writeFlag(mask & PositionMask))
425 stream->write(mPosition);
426
427 if (stream->writeFlag(mask & TargetMask))
428 if (stream->writeFlag(mTargetSet))
429 stream->write(mTarget);
430
431 if (stream->writeFlag(mask & WindowMask)) {
432 stream->write(mNodeBase);
433 stream->write(mNodeCount);
434 for (S32 i = 0; i < mNodeCount; i++) {
435 CameraSpline::Knot *knot = mSpline.getKnot(i);
436 mathWrite(*stream, knot->mPosition);
437 mathWrite(*stream, knot->mRotation);
438 stream->write(knot->mSpeed);
439 stream->writeInt(knot->mType, CameraSpline::Knot::NUM_TYPE_BITS);
440 stream->writeInt(knot->mPath, CameraSpline::Knot::NUM_PATH_BITS);
441 }
442 }
443
444 // The rest of the data is part of the control object packet update.
445 // If we're controlled by this client, we don't need to send it.
446 if(stream->writeFlag(getControllingClient() == con && !(mask & InitialUpdateMask)))
447 return 0;
448
449 return 0;
450}
451
452void PathCamera::unpackUpdate(NetConnection *con, BitStream *stream)
453{

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