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

Method unpackUpdate

Engine/source/environment/meshRoad.cpp:1058–1142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056}
1057
1058void MeshRoad::unpackUpdate(NetConnection * con, BitStream * stream)
1059{
1060 // Unpack Parent.
1061 Parent::unpackUpdate(con, stream);
1062
1063 // MeshRoadMask
1064 if(stream->readFlag())
1065 {
1066 MatrixF ObjectMatrix;
1067 stream->readAffineTransform(&ObjectMatrix);
1068 Parent::setTransform(ObjectMatrix);
1069
1070 // Read Materials...
1071 Material *pMat = NULL;
1072
1073 for ( U32 i = 0; i < SurfaceCount; i++ )
1074 {
1075 stream->read( &mMaterialName[i] );
1076
1077 if ( !Sim::findObject( mMaterialName[i], pMat ) )
1078 Con::printf( "DecalRoad::unpackUpdate, failed to find Material of name %s", mMaterialName[i].c_str() );
1079 else
1080 mMaterial[i] = pMat;
1081 }
1082
1083 if ( isProperlyAdded() )
1084 _initMaterial();
1085
1086 stream->read( &mTextureLength );
1087
1088 stream->read( &mBreakAngle );
1089
1090 stream->read( &mWidthSubdivisions );
1091 }
1092
1093 // NodeMask
1094 if ( stream->readFlag() )
1095 {
1096 if (stream->readFlag())
1097 {
1098 // Nodes have been passed in this update
1099 U32 count = stream->readInt( 16 );
1100
1101 mNodes.clear();
1102
1103 Point3F pos, normal;
1104 F32 width, depth;
1105 for ( U32 i = 0; i < count; i++ )
1106 {
1107 mathRead( *stream, &pos );
1108 stream->read( &width );
1109 stream->read( &depth );
1110 mathRead( *stream, &normal );
1111 _addNode( pos, width, depth, normal );
1112 }
1113 }
1114 else
1115 {

Callers

nothing calls this directly

Calls 11

printfFunction · 0.85
mathReadFunction · 0.85
readFlagMethod · 0.80
readAffineTransformMethod · 0.80
readIntMethod · 0.80
findListByIdMethod · 0.80
registerNotificationMethod · 0.80
findObjectFunction · 0.50
readMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected