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

Method unpackUpdate

Engine/source/forest/forestWindEmitter.cpp:304–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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