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,16 +235,18 @@ 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];
} }
else // Remove this else when uncommenting the above
part.SendCollisionSound(soundID, volume, colInfo.position); part.SendCollisionSound(soundID, volume, colInfo.position);
doneownsound = true; doneownsound = true;
} }
@ -269,24 +268,27 @@ namespace OpenSim.Region.Framework.Scenes
if (volume == 0.0f) if (volume == 0.0f)
continue; continue;
} }
else // TODO: Import real collision sounds and uncomment this
{ // 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)
// volume = 1.0f;
int otherMaterial = (int)otherPart.Material; //
if (otherMaterial >= MaxMaterials) // int otherMaterial = (int)otherPart.Material;
otherMaterial = 3; // if (otherMaterial >= MaxMaterials)
// otherMaterial = 3;
soundID = m_PartPart[thisMatScaled + otherMaterial]; //
} // soundID = m_PartPart[thisMatScaled + otherMaterial];
// }
} }
if (soundID != UUID.Zero) // Remove when sounds are there
{ // Remove when sounds are there
if (doneownsound) if (doneownsound)
otherPart.SendCollisionSound(soundID, volume, colInfo.position); otherPart.SendCollisionSound(soundID, volume, colInfo.position);
else else
@ -294,15 +296,13 @@ namespace OpenSim.Region.Framework.Scenes
part.SendCollisionSound(soundID, volume, colInfo.position); part.SendCollisionSound(soundID, volume, colInfo.position);
doneownsound = true; doneownsound = true;
} }
} // Remove when sounds are there
} }
} }
} }
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;
} }
/* /*