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

Method packUpdate

Engine/source/forest/forestWindEmitter.cpp:261–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261U32 ForestWindEmitter::packUpdate(NetConnection * con, U32 mask, BitStream * stream)
262{
263 U32 retMask = Parent::packUpdate( con, mask, stream );
264
265 mathWrite( *stream, mObjToWorld );
266
267 if ( stream->writeFlag( mask & EnabledMask ) )
268 stream->writeFlag( mEnabled );
269
270 if ( stream->writeFlag( mask & WindMask ) )
271 {
272 stream->write( mWindStrength );
273
274 stream->write( mWindRadius );
275 stream->writeFlag( mRadialEmitter );
276
277 stream->write( mWindGustStrength );
278 stream->write( mWindGustFrequency );
279
280 stream->write( mWindGustYawAngle );
281 stream->write( mWindGustYawFrequency );
282 stream->write( mWindGustWobbleStrength );
283
284 stream->write( mWindTurbulenceStrength );
285 stream->write( mWindTurbulenceFrequency );
286
287 // The wind direction should be normalized!
288 if ( mWindDirection.isZero() )
289 {
290 VectorF forwardVec( 0, 0, 0 );
291 mWorldToObj.getColumn( 1, &mWindDirection );
292 }
293 else
294 mWindDirection.normalize();
295
296 stream->writeNormalVector( mWindDirection, 8 );
297
298 stream->writeFlag( mHasMount );
299 }
300
301 return retMask;
302}
303
304void ForestWindEmitter::unpackUpdate(NetConnection * con, BitStream * stream)
305{

Callers

nothing calls this directly

Calls 7

mathWriteFunction · 0.85
getColumnMethod · 0.80
writeNormalVectorMethod · 0.80
writeFlagMethod · 0.45
writeMethod · 0.45
isZeroMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected