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

Method pack

Engine/source/scene/pathManager.cpp:99–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97};
98
99void PathManagerEvent::pack(NetConnection*, BitStream* stream)
100{
101 // Write out the modified path...
102 stream->write(modifiedPath);
103 stream->writeFlag(clearPaths);
104 stream->write(path.totalTime);
105 stream->write(path.positions.size());
106
107
108 // This is here for safety. You can remove it if you want to try your luck at bigger sizes. -- BJG
109 AssertWarn(path.positions.size() < 1500/40, "Warning! Path size is pretty big - may cause packet overrun!");
110
111 // Each one of these is about 8 floats and 2 ints
112 // so we'll say it's about 40 bytes in size, which is where the 40 in the above calc comes from.
113 for (U32 j = 0; j < path.positions.size(); j++)
114 {
115 mathWrite(*stream, path.positions[j]);
116 mathWrite(*stream, path.rotations[j]);
117 stream->write(path.msToNext[j]);
118 stream->write(path.smoothingType[j]);
119 }
120}
121
122void PathManagerEvent::write(NetConnection*nc, BitStream *stream)
123{

Callers

nothing calls this directly

Calls 4

mathWriteFunction · 0.85
writeMethod · 0.45
writeFlagMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected