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

Method pack

Engine/source/scene/pathManager.cpp:99–121  ·  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.looping);
106 stream->write(path.positions.size());
107
108
109 // This is here for safety. You can remove it if you want to try your luck at bigger sizes. -- BJG
110 AssertWarn(path.positions.size() < 1500/40, "Warning! Path size is pretty big - may cause packet overrun!");
111
112 // Each one of these is about 8 floats and 2 ints
113 // so we'll say it's about 40 bytes in size, which is where the 40 in the above calc comes from.
114 for (U32 j = 0; j < path.positions.size(); j++)
115 {
116 mathWrite(*stream, path.positions[j]);
117 mathWrite(*stream, path.rotations[j]);
118 stream->write(path.msToNext[j]);
119 stream->write(path.smoothingType[j]);
120 }
121}
122
123void PathManagerEvent::write(NetConnection*nc, BitStream *stream)
124{

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