Disable default collision sounds until they can be uploaded, but enable custom ones

avinationmerge
Melanie 2012-06-07 17:59:38 +02:00
parent 91557f18cd
commit 64aefe9c28
1 changed files with 56 additions and 55 deletions

View File

@ -188,9 +188,6 @@ namespace OpenSim.Region.Framework.Scenes
public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist) public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist)
{ {
// disable for now
return;
if (collidersinfolist.Count == 0 || part == null) if (collidersinfolist.Count == 0 || part == null)
return; return;
@ -238,17 +235,19 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (!HaveSound) if (!HaveSound)
{ {
volume = Math.Abs(colInfo.relativeVel); // TODO: Import real collision sounds and uncomment this
if (volume < 0.2f) // volume = Math.Abs(colInfo.relativeVel);
continue; // if (volume < 0.2f)
// continue;
volume *= volume * .0625f; // 4m/s == full volume //
if (volume > 1.0f) // volume *= volume * .0625f; // 4m/s == full volume
volume = 1.0f; // if (volume > 1.0f)
// volume = 1.0f;
soundID = m_TerrainPart[thisMaterial]; //
// soundID = m_TerrainPart[thisMaterial];
} }
part.SendCollisionSound(soundID, volume, colInfo.position); else // Remove this else when uncommenting the above
part.SendCollisionSound(soundID, volume, colInfo.position);
doneownsound = true; doneownsound = true;
} }
continue; continue;
@ -269,40 +268,41 @@ namespace OpenSim.Region.Framework.Scenes
if (volume == 0.0f) if (volume == 0.0f)
continue; continue;
} }
// TODO: Import real collision sounds and uncomment this
// else
// {
// volume = Math.Abs(colInfo.relativeVel);
// if (volume < 0.2f)
// continue;
//
// volume *= volume * .0625f; // 4m/s == full volume
// if (volume > 1.0f)
// volume = 1.0f;
//
// int otherMaterial = (int)otherPart.Material;
// if (otherMaterial >= MaxMaterials)
// otherMaterial = 3;
//
// soundID = m_PartPart[thisMatScaled + otherMaterial];
// }
}
if (soundID != UUID.Zero) // Remove when sounds are there
{ // Remove when sounds are there
if (doneownsound)
otherPart.SendCollisionSound(soundID, volume, colInfo.position);
else else
{ {
volume = Math.Abs(colInfo.relativeVel); part.SendCollisionSound(soundID, volume, colInfo.position);
if (volume < 0.2f) doneownsound = true;
continue;
volume *= volume * .0625f; // 4m/s == full volume
if (volume > 1.0f)
volume = 1.0f;
int otherMaterial = (int)otherPart.Material;
if (otherMaterial >= MaxMaterials)
otherMaterial = 3;
soundID = m_PartPart[thisMatScaled + otherMaterial];
} }
} } // Remove when sounds are there
if (doneownsound)
otherPart.SendCollisionSound(soundID, volume, colInfo.position);
else
{
part.SendCollisionSound(soundID, volume, colInfo.position);
doneownsound = true;
}
} }
} }
} }
public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist) public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist)
{ {
// disable for now
return;
if (collidersinfolist.Count == 0 || av == null) if (collidersinfolist.Count == 0 || av == null)
return; return;
@ -341,22 +341,23 @@ namespace OpenSim.Region.Framework.Scenes
continue; continue;
if (otherPart.CollisionSoundType > 0 && otherPart.CollisionSoundVolume > 0f) if (otherPart.CollisionSoundType > 0 && otherPart.CollisionSoundVolume > 0f)
otherPart.SendCollisionSound(otherPart.CollisionSound, otherPart.CollisionSoundVolume, colInfo.position); otherPart.SendCollisionSound(otherPart.CollisionSound, otherPart.CollisionSoundVolume, colInfo.position);
else //TODO: uncomment below when sounds are uploaded
{ // else
volume = Math.Abs(colInfo.relativeVel); // {
if (volume < 0.2f) // volume = Math.Abs(colInfo.relativeVel);
continue; // if (volume < 0.2f)
// continue;
volume *= volume * .0625f; // 4m/s == full volume //
if (volume > 1.0f) // volume *= volume * .0625f; // 4m/s == full volume
volume = 1.0f; // if (volume > 1.0f)
otherMaterial = (int)otherPart.Material; // volume = 1.0f;
if (otherMaterial >= MaxMaterials) // otherMaterial = (int)otherPart.Material;
otherMaterial = 3; // if (otherMaterial >= MaxMaterials)
// otherMaterial = 3;
soundID = m_PartPart[thisMatScaled + otherMaterial]; //
otherPart.SendCollisionSound(soundID, volume, colInfo.position); // soundID = m_PartPart[thisMatScaled + otherMaterial];
} // otherPart.SendCollisionSound(soundID, volume, colInfo.position);
// }
continue; continue;
} }
/* /*
@ -374,4 +375,4 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
} }