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

Method unpackUpdate

Engine/source/T3D/pathCamera.cpp:452–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void PathCamera::unpackUpdate(NetConnection *con, BitStream *stream)
453{
454 Parent::unpackUpdate(con,stream);
455
456 // StateMask
457 if (stream->readFlag())
458 mState = stream->readInt(StateBits);
459
460 // PositionMask
461 if (stream->readFlag())
462 {
463 stream->read(&mPosition);
464 delta.time = mPosition;
465 delta.timeVec = 0;
466 }
467
468 // TargetMask
469 if (stream->readFlag())
470 {
471 mTargetSet = stream->readFlag();
472 if (mTargetSet)
473 stream->read(&mTarget);
474 }
475
476 // WindowMask
477 if (stream->readFlag())
478 {
479 mSpline.removeAll();
480 stream->read(&mNodeBase);
481 stream->read(&mNodeCount);
482 for (S32 i = 0; i < mNodeCount; i++)
483 {
484 CameraSpline::Knot *knot = new CameraSpline::Knot();
485 mathRead(*stream, &knot->mPosition);
486 mathRead(*stream, &knot->mRotation);
487 stream->read(&knot->mSpeed);
488 knot->mType = (CameraSpline::Knot::Type)stream->readInt(CameraSpline::Knot::NUM_TYPE_BITS);
489 knot->mPath = (CameraSpline::Knot::Path)stream->readInt(CameraSpline::Knot::NUM_PATH_BITS);
490 mSpline.push_back(knot);
491 }
492 }
493
494 // Controlled by the client?
495 if (stream->readFlag())
496 return;
497
498}
499
500
501//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 6

mathReadFunction · 0.85
readFlagMethod · 0.80
readIntMethod · 0.80
readMethod · 0.45
removeAllMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected