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

Method unpackUpdate

Engine/source/environment/meshRoad.cpp:1507–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1505}
1506
1507void MeshRoad::unpackUpdate(NetConnection * con, BitStream * stream)
1508{
1509 // Unpack Parent.
1510 Parent::unpackUpdate(con, stream);
1511
1512 // MeshRoadMask
1513 if(stream->readFlag())
1514 {
1515 MatrixF ObjectMatrix;
1516 stream->readAffineTransform(&ObjectMatrix);
1517 Parent::setTransform(ObjectMatrix);
1518
1519 UNPACK_ASSET(con, TopMaterial);
1520 UNPACK_ASSET(con, BottomMaterial);
1521 UNPACK_ASSET(con, SideMaterial);
1522
1523 if ( isProperlyAdded() )
1524 _initMaterial();
1525
1526 stream->read( &mTextureLength );
1527
1528 stream->read( &mBreakAngle );
1529
1530 stream->read( &mWidthSubdivisions );
1531 }
1532
1533 // ProfileMask
1534 if(stream->readFlag())
1535 {
1536 Point3F pos;
1537
1538 mSideProfile.mNodes.clear();
1539 mSideProfile.mSegMtrls.clear();
1540
1541 U32 count = stream->readInt( 16 );
1542
1543 for( U32 i = 0; i < count; i++)
1544 {
1545 mathRead( *stream, &pos );
1546 MeshRoadProfileNode node(pos);
1547 node.setSmoothing( stream->readFlag() );
1548 mSideProfile.mNodes.push_back(node);
1549
1550 if(i)
1551 mSideProfile.mSegMtrls.push_back(stream->readInt(3));
1552 else
1553 stream->readInt(3);
1554 }
1555
1556 mSideProfile.generateNormals();
1557 }
1558
1559 // NodeMask
1560 if ( stream->readFlag() )
1561 {
1562 if (stream->readFlag())
1563 {
1564 // Nodes have been passed in this update

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected