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

Method unpackUpdate

Engine/source/environment/river.cpp:1040–1121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1038}
1039
1040void River::unpackUpdate(NetConnection * con, BitStream * stream)
1041{
1042 // Unpack Parent.
1043 Parent::unpackUpdate(con, stream);
1044
1045 // RiverMask
1046 if(stream->readFlag())
1047 {
1048 MatrixF ObjectMatrix;
1049 stream->readAffineTransform(&ObjectMatrix);
1050 Parent::setTransform(ObjectMatrix);
1051
1052 stream->read( &mMetersPerSegment );
1053 stream->read( &mSegmentsPerBatch );
1054 stream->read( &mDepthScale );
1055 stream->read( &mMaxDivisionSize );
1056 stream->read( &mColumnCount );
1057
1058 stream->read( &mFlowMagnitude );
1059 stream->read( &mLodDistance );
1060 }
1061
1062 // NodeMask
1063 if ( stream->readFlag() )
1064 {
1065 if (stream->readFlag())
1066 {
1067 // Nodes have been passed in this update
1068 U32 count = stream->readInt( 16 );
1069
1070 mNodes.clear();
1071
1072 Point3F pos;
1073 VectorF normal;
1074 F32 width,depth;
1075
1076 for ( U32 i = 0; i < count; i++ )
1077 {
1078 mathRead( *stream, &pos );
1079 stream->read( &width );
1080 stream->read( &depth );
1081 mathRead( *stream, &normal );
1082 _addNode( pos, width, depth, normal );
1083 }
1084 }
1085 else
1086 {
1087 // Nodes will arrive as events
1088 U32 id;
1089 stream->read( &id );
1090
1091 // Check if the road's nodes made it here before we did.
1092 NodeListManager::NodeList* list = NULL;
1093 if ( gClientNodeListManager->findListById( id, &list, true) )
1094 {
1095 // Work with the completed list
1096 RiverNodeList* riverList = dynamic_cast<RiverNodeList*>( list );
1097 if (riverList)

Callers

nothing calls this directly

Calls 8

mathReadFunction · 0.85
readFlagMethod · 0.80
readAffineTransformMethod · 0.80
readIntMethod · 0.80
findListByIdMethod · 0.80
registerNotificationMethod · 0.80
readMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected