| 299 | } |
| 300 | |
| 301 | void 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 | |
| 355 | bool ForestWindEmitter::onAdd() |
| 356 | { |
nothing calls this directly
no test coverage detected