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

Method unpackUpdate

Engine/source/forest/forestWindEmitter.cpp:301–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void ForestWindEmitter::unpackUpdate(NetConnection * con, BitStream * stream)
302{
303 // Unpack Parent.
304 Parent::unpackUpdate( con, stream );
305
306 MatrixF xfm;
307 mathRead( *stream, &xfm );
308 Parent::setTransform( xfm );
309
310 U32 windMask = 0;
311
312 if ( stream->readFlag() ) // EnabledMask
313 mEnabled = stream->readFlag();
314
315 if ( stream->readFlag() ) // WindMask
316 {
317 stream->read( &mWindStrength );
318 stream->read( &mWindRadius );
319
320 mRadialEmitter = stream->readFlag();
321
322 stream->read( &mWindGustStrength );
323 stream->read( &mWindGustFrequency );
324
325 stream->read( &mWindGustYawAngle );
326 stream->read( &mWindGustYawFrequency );
327 stream->read( &mWindGustWobbleStrength );
328
329 stream->read( &mWindTurbulenceStrength );
330 stream->read( &mWindTurbulenceFrequency );
331
332 stream->readNormalVector( &mWindDirection, 8 );
333 windMask |= WindMask;
334
335 mHasMount = stream->readFlag();
336 }
337
338 // This does nothing if the masks are not set!
339 if ( windMask != 0 && isProperlyAdded() )
340 {
341 Point3F boxRad( 0, 0, 0 );
342
343 if ( !isRadialEmitter() )
344 boxRad.set( 10000.0f, 10000.0f, 10000.0f );
345 else
346 boxRad.set( mWindRadius, mWindRadius, mWindRadius );
347
348 mObjBox.set( -boxRad, boxRad );
349 resetWorldBox();
350
351 _initWind( windMask );
352 }
353}
354
355bool ForestWindEmitter::onAdd()
356{

Callers

nothing calls this directly

Calls 5

mathReadFunction · 0.85
readFlagMethod · 0.80
readNormalVectorMethod · 0.80
readMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected