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

Method packData

Engine/source/T3D/item.cpp:179–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void ItemData::packData(BitStream* stream)
180{
181 Parent::packData(stream);
182 stream->writeFloat(friction, 10);
183 stream->writeFloat(elasticity, 10);
184 stream->writeFlag(sticky);
185 if(stream->writeFlag(gravityMod != 1.0))
186 stream->writeFloat(gravityMod, 10);
187 if(stream->writeFlag(maxVelocity != -1))
188 stream->write(maxVelocity);
189
190 if(stream->writeFlag(lightType != Item::NoLight))
191 {
192 AssertFatal(Item::NumLightTypes < (1 << 2), "ItemData: light type needs more bits");
193 stream->writeInt(lightType, 2);
194 stream->writeFloat(lightColor.red, 7);
195 stream->writeFloat(lightColor.green, 7);
196 stream->writeFloat(lightColor.blue, 7);
197 stream->writeFloat(lightColor.alpha, 7);
198 stream->write(lightTime);
199 stream->write(lightRadius);
200 stream->writeFlag(lightOnlyStatic);
201 }
202
203 stream->writeFlag(simpleServerCollision);
204}
205
206void ItemData::unpackData(BitStream* stream)
207{

Callers

nothing calls this directly

Calls 4

writeFloatMethod · 0.80
writeIntMethod · 0.80
writeFlagMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected