| 7061 | } |
| 7062 | |
| 7063 | void Player:: playImpactSound() |
| 7064 | { |
| 7065 | if( mWaterCoverage == 0.0f ) |
| 7066 | { |
| 7067 | Point3F pos; |
| 7068 | RayInfo rInfo; |
| 7069 | MatrixF mat = getTransform(); |
| 7070 | mat.mulP(Point3F(mDataBlock->decalOffset,0.0f,0.0f), &pos); |
| 7071 | |
| 7072 | if( gClientContainer.castRay( Point3F( pos.x, pos.y, pos.z + 0.01f ), |
| 7073 | Point3F( pos.x, pos.y, pos.z - 2.0f ), |
| 7074 | STATIC_COLLISION_TYPEMASK | VehicleObjectType, |
| 7075 | &rInfo ) ) |
| 7076 | { |
| 7077 | Material* material = ( rInfo.material ? dynamic_cast< Material* >( rInfo.material->getMaterial() ) : 0 ); |
| 7078 | |
| 7079 | if( material && material->getCustomImpactSoundProfile() ) |
| 7080 | SFX->playOnce( material->getCustomImpactSoundProfile(), &getTransform() ); |
| 7081 | else |
| 7082 | { |
| 7083 | S32 sound = -1; |
| 7084 | if (material && (material->mImpactSoundId > -1 && material->mImpactSoundId < PlayerData::WaterStart)) |
| 7085 | sound = material->mImpactSoundId; |
| 7086 | else if( rInfo.object->getTypeMask() & VehicleObjectType ) |
| 7087 | sound = 2; // Play metal; |
| 7088 | |
| 7089 | if (sound >= 0) |
| 7090 | SFX->playOnce(mDataBlock->getPlayerSoundProfile(PlayerData::ImpactSoft + sound), &getTransform()); |
| 7091 | } |
| 7092 | } |
| 7093 | } |
| 7094 | |
| 7095 | mImpactSound = 0; |
| 7096 | } |
| 7097 | |
| 7098 | //-------------------------------------------------------------------------- |
| 7099 | // Update splash |
nothing calls this directly
no test coverage detected