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

Method unpackUpdate

Engine/source/T3D/trigger.cpp:867–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867void Trigger::unpackUpdate(NetConnection* con, BitStream* stream)
868{
869 Parent::unpackUpdate(con, stream);
870
871 U32 i, size;
872
873 // Transform
874 if( stream->readFlag() )
875 {
876 MatrixF temp;
877 stream->readAffineTransform(&temp);
878 setTransform(temp);
879 }
880
881 // Read the polyhedron
882 if( stream->readFlag() )
883 {
884 Polyhedron tempPH;
885 stream->read(&size);
886 tempPH.mPointList.setSize(size);
887 for (i = 0; i < tempPH.mPointList.size(); i++)
888 mathRead(*stream, &tempPH.mPointList[i]);
889
890 stream->read(&size);
891 tempPH.mPlaneList.setSize(size);
892 for (i = 0; i < tempPH.mPlaneList.size(); i++)
893 mathRead(*stream, &tempPH.mPlaneList[i]);
894
895 stream->read(&size);
896 tempPH.mEdgeList.setSize(size);
897 for (i = 0; i < tempPH.mEdgeList.size(); i++) {
898 Polyhedron::Edge& rEdge = tempPH.mEdgeList[i];
899
900 stream->read(&rEdge.face[0]);
901 stream->read(&rEdge.face[1]);
902 stream->read(&rEdge.vertex[0]);
903 stream->read(&rEdge.vertex[1]);
904 }
905 setTriggerPolyhedron(tempPH);
906 }
907
908 if( stream->readFlag() )
909 {
910 char buf[CMD_SIZE];
911 stream->readLongString(CMD_SIZE-1, buf);
912 mEnterCommand = buf;
913 }
914 if( stream->readFlag() )
915 {
916 char buf[CMD_SIZE];
917 stream->readLongString(CMD_SIZE-1, buf);
918 mLeaveCommand = buf;
919 }
920 if( stream->readFlag() )
921 {
922 char buf[CMD_SIZE];
923 stream->readLongString(CMD_SIZE-1, buf);
924 mTickCommand = buf;

Callers

nothing calls this directly

Calls 7

mathReadFunction · 0.85
readFlagMethod · 0.80
readAffineTransformMethod · 0.80
readMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45
readLongStringMethod · 0.45

Tested by

no test coverage detected