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

Method packUpdate

Engine/source/forest/forestWindEmitter.cpp:258–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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