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

Method unpackUpdate

Engine/source/scene/sceneObject.cpp:960–1028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958//-----------------------------------------------------------------------------
959
960void SceneObject::unpackUpdate( NetConnection* conn, BitStream* stream )
961{
962 Parent::unpackUpdate( conn, stream );
963
964 // FlagMask
965 if ( stream->readFlag() )
966 mObjectFlags = stream->readRangedU32( 0, getObjectFlagMax() );
967
968 // PATHSHAPE
969 // begin of attachment
970 if (stream->readFlag())
971 {
972 MatrixF m;
973 stream->readAffineTransform(&m);
974 mGraph.objToParent = m;
975 }
976 if (stream->readFlag())
977 {
978 // Check to see if we need to read an object ID
979 if (stream->readFlag())
980 {
981 // Check to see if we can actually ghost this...
982 if (stream->readFlag())
983 {
984 GameBase *newParent = static_cast<GameBase*>(conn->resolveGhost(stream->readRangedU32(0, NetConnection::MaxGhostCount)));
985 MatrixF m;
986 stream->readAffineTransform(&m);
987
988 if (getParent() != newParent)
989 {
990 clearProcessAfter();
991 processAfter(newParent);
992 }
993
994 attachToParent(newParent, &m);
995 //Con::errorf("%d: got mounted on %d", getId(), mParentObject->getId());
996 }
997 }
998 else
999 {
1000 attachToParent(NULL);
1001 }
1002 }
1003 // End of attachment
1004 // PATHSHAPE END
1005
1006 // MountedMask
1007 if ( stream->readFlag() )
1008 {
1009 if ( stream->readFlag() )
1010 {
1011 S32 gIndex = stream->readInt( NetConnection::GhostIdBitSize );
1012 SceneObject* obj = dynamic_cast<SceneObject*>( conn->resolveGhost( gIndex ) );
1013 S32 node = -1;
1014 if ( stream->readFlag() ) // node != -1
1015 node = stream->readInt( NumMountPointBits );
1016 MatrixF xfm;
1017 mathRead( *stream, &xfm );

Callers

nothing calls this directly

Calls 8

mathReadFunction · 0.85
readFlagMethod · 0.80
readRangedU32Method · 0.80
readAffineTransformMethod · 0.80
resolveGhostMethod · 0.80
readIntMethod · 0.80
setLastErrorMethod · 0.45
mountObjectMethod · 0.45

Tested by

no test coverage detected