From d15d71a7efd2e1d3510111cbc9e617fc113fc29c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 30 Oct 2012 01:28:03 +0000 Subject: [PATCH] Put back the collision sound shim into SOP --- .../Framework/Scenes/SceneObjectPart.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b7f4291563..5714fdd6c3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2864,6 +2864,35 @@ namespace OpenSim.Region.Framework.Scenes SendLandCollisionEvent(scriptEvents.land_collision_end, ParentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd); } + // The Collision sounds code calls this + public void SendCollisionSound(UUID soundID, double volume, Vector3 position) + { + if (soundID == UUID.Zero) + return; + + ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface(); + if (soundModule == null) + return; + + if (volume > 1) + volume = 1; + if (volume < 0) + volume = 0; + + int now = Util.EnvironmentTickCount(); + if(Util.EnvironmentTickCountSubtract(now,LastColSoundSentTime) <200) + return; + + LastColSoundSentTime = now; + + UUID ownerID = OwnerID; + UUID objectID = ParentGroup.RootPart.UUID; + UUID parentID = ParentGroup.UUID; + ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; + + soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, 0 ); + } + public void PhysicsOutOfBounds(Vector3 pos) { m_log.Error("[PHYSICS]: Physical Object went out of bounds.");