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

Method unpackUpdate

Engine/source/environment/river.cpp:1045–1126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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