| 761 | } |
| 762 | |
| 763 | void Trigger::unpackUpdate(NetConnection* con, BitStream* stream) |
| 764 | { |
| 765 | Parent::unpackUpdate(con, stream); |
| 766 | |
| 767 | U32 i, size; |
| 768 | |
| 769 | // Transform |
| 770 | if( stream->readFlag() ) |
| 771 | { |
| 772 | MatrixF temp; |
| 773 | stream->readAffineTransform(&temp); |
| 774 | setTransform(temp); |
| 775 | } |
| 776 | |
| 777 | // Read the polyhedron |
| 778 | if( stream->readFlag() ) |
| 779 | { |
| 780 | Polyhedron tempPH; |
| 781 | stream->read(&size); |
| 782 | tempPH.pointList.setSize(size); |
| 783 | for (i = 0; i < tempPH.pointList.size(); i++) |
| 784 | mathRead(*stream, &tempPH.pointList[i]); |
| 785 | |
| 786 | stream->read(&size); |
| 787 | tempPH.planeList.setSize(size); |
| 788 | for (i = 0; i < tempPH.planeList.size(); i++) |
| 789 | mathRead(*stream, &tempPH.planeList[i]); |
| 790 | |
| 791 | stream->read(&size); |
| 792 | tempPH.edgeList.setSize(size); |
| 793 | for (i = 0; i < tempPH.edgeList.size(); i++) { |
| 794 | Polyhedron::Edge& rEdge = tempPH.edgeList[i]; |
| 795 | |
| 796 | stream->read(&rEdge.face[0]); |
| 797 | stream->read(&rEdge.face[1]); |
| 798 | stream->read(&rEdge.vertex[0]); |
| 799 | stream->read(&rEdge.vertex[1]); |
| 800 | } |
| 801 | setTriggerPolyhedron(tempPH); |
| 802 | } |
| 803 | |
| 804 | if( stream->readFlag() ) |
| 805 | { |
| 806 | char buf[CMD_SIZE]; |
| 807 | stream->readLongString(CMD_SIZE-1, buf); |
| 808 | mEnterCommand = buf; |
| 809 | } |
| 810 | if( stream->readFlag() ) |
| 811 | { |
| 812 | char buf[CMD_SIZE]; |
| 813 | stream->readLongString(CMD_SIZE-1, buf); |
| 814 | mLeaveCommand = buf; |
| 815 | } |
| 816 | if( stream->readFlag() ) |
| 817 | { |
| 818 | char buf[CMD_SIZE]; |
| 819 | stream->readLongString(CMD_SIZE-1, buf); |
| 820 | mTickCommand = buf; |
nothing calls this directly
no test coverage detected