| 357 | //---------------------------------------------------------------------------- |
| 358 | |
| 359 | void RigidShapeData::packData(BitStream* stream) |
| 360 | { |
| 361 | Parent::packData(stream); |
| 362 | |
| 363 | stream->write(body.restitution); |
| 364 | stream->write(body.friction); |
| 365 | for( U32 i = 0; i < Body::MaxSounds; ++ i ) |
| 366 | sfxWrite( stream, body.sound[ i ] ); |
| 367 | |
| 368 | stream->write(minImpactSpeed); |
| 369 | stream->write(softImpactSpeed); |
| 370 | stream->write(hardImpactSpeed); |
| 371 | stream->write(minRollSpeed); |
| 372 | |
| 373 | stream->write(maxDrag); |
| 374 | stream->write(minDrag); |
| 375 | stream->write(integration); |
| 376 | stream->write(collisionTol); |
| 377 | stream->write(contactTol); |
| 378 | mathWrite(*stream,massCenter); |
| 379 | mathWrite(*stream,massBox); |
| 380 | |
| 381 | stream->writeFlag(cameraRoll); |
| 382 | stream->write(cameraLag); |
| 383 | stream->write(cameraDecay); |
| 384 | stream->write(cameraOffset); |
| 385 | |
| 386 | stream->write( dustHeight ); |
| 387 | |
| 388 | stream->write(exitSplashSoundVel); |
| 389 | stream->write(softSplashSoundVel); |
| 390 | stream->write(medSplashSoundVel); |
| 391 | stream->write(hardSplashSoundVel); |
| 392 | |
| 393 | // write the water sound profiles |
| 394 | for( U32 i = 0; i < MaxSounds; ++ i ) |
| 395 | sfxWrite( stream, waterSound[ i ] ); |
| 396 | |
| 397 | if (stream->writeFlag( dustEmitter )) |
| 398 | stream->writeRangedU32( dustEmitter->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); |
| 399 | |
| 400 | for( U32 i = 0; i < VC_NUM_SPLASH_EMITTERS; ++ i ) |
| 401 | { |
| 402 | if( stream->writeFlag( splashEmitterList[i] != NULL ) ) |
| 403 | stream->writeRangedU32( splashEmitterList[i]->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); |
| 404 | } |
| 405 | |
| 406 | stream->write(splashFreqMod); |
| 407 | stream->write(splashVelEpsilon); |
| 408 | |
| 409 | stream->write(dragForce); |
| 410 | stream->write(vertFactor); |
| 411 | |
| 412 | if (stream->writeFlag( dustTrailEmitter )) |
| 413 | stream->writeRangedU32( dustTrailEmitter->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast ); |
| 414 | } |
| 415 | |
| 416 | void RigidShapeData::unpackData(BitStream* stream) |