| 766 | } |
| 767 | |
| 768 | void ExplosionData::unpackData(BitStream* stream) |
| 769 | { |
| 770 | Parent::unpackData(stream); |
| 771 | |
| 772 | UNPACKDATA_ASSET(ExplosionShape); |
| 773 | |
| 774 | UNPACKDATA_ASSET(Sound); |
| 775 | |
| 776 | if (stream->readFlag()) |
| 777 | particleEmitterId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast); |
| 778 | else |
| 779 | particleEmitterId = 0; |
| 780 | |
| 781 | particleDensity = stream->readInt(14); |
| 782 | stream->read(&particleRadius); |
| 783 | faceViewer = stream->readFlag(); |
| 784 | if(stream->readFlag()) |
| 785 | { |
| 786 | explosionScale.x = stream->readInt(16) / 100.0f; |
| 787 | explosionScale.y = stream->readInt(16) / 100.0f; |
| 788 | explosionScale.z = stream->readInt(16) / 100.0f; |
| 789 | } |
| 790 | else |
| 791 | explosionScale.set(1,1,1); |
| 792 | playSpeed = stream->readInt(14) / 20.0f; |
| 793 | debrisThetaMin = stream->readRangedU32(0, 180); |
| 794 | debrisThetaMax = stream->readRangedU32(0, 180); |
| 795 | debrisPhiMin = stream->readRangedU32(0, 360); |
| 796 | debrisPhiMax = stream->readRangedU32(0, 360); |
| 797 | debrisNum = stream->readRangedU32(0, 1000); |
| 798 | debrisNumVariance = stream->readRangedU32(0, 1000); |
| 799 | |
| 800 | debrisVelocity = stream->readInt(14) / 10.0f; |
| 801 | debrisVelocityVariance = stream->readRangedU32(0, 10000) / 10.0f; |
| 802 | delayMS = stream->readInt(16) << 5; |
| 803 | delayVariance = stream->readInt(16) << 5; |
| 804 | lifetimeMS = stream->readInt(16) << 5; |
| 805 | lifetimeVariance = stream->readInt(16) << 5; |
| 806 | |
| 807 | stream->read(&offset); |
| 808 | |
| 809 | shakeCamera = stream->readFlag(); |
| 810 | stream->read(&camShakeFreq.x); |
| 811 | stream->read(&camShakeFreq.y); |
| 812 | stream->read(&camShakeFreq.z); |
| 813 | stream->read(&camShakeAmp.x); |
| 814 | stream->read(&camShakeAmp.y); |
| 815 | stream->read(&camShakeAmp.z); |
| 816 | stream->read(&camShakeDuration); |
| 817 | stream->read(&camShakeRadius); |
| 818 | stream->read(&camShakeFalloff); |
| 819 | |
| 820 | |
| 821 | for( S32 j=0; j<EC_NUM_DEBRIS_TYPES; j++ ) |
| 822 | { |
| 823 | if( stream->readFlag() ) |
| 824 | { |
| 825 | debrisIDList[j] = (S32) stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); |