aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 7ea4686..a9014e1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2342,12 +2342,31 @@ namespace OpenSim.Region.Environment.Scenes
2342 //Gesture 2342 //Gesture
2343 client.OnActivateGesture += ActivateGesture; 2343 client.OnActivateGesture += ActivateGesture;
2344 client.OnDeactivateGesture += DeactivateGesture; 2344 client.OnDeactivateGesture += DeactivateGesture;
2345 //sound
2346 client.OnSoundTrigger += SoundTrigger;
2345 2347
2346 client.OnObjectOwner += ObjectOwner; 2348 client.OnObjectOwner += ObjectOwner;
2347 2349
2348 // EventManager.TriggerOnNewClient(client); 2350 // EventManager.TriggerOnNewClient(client);
2349 } 2351 }
2350 2352
2353 // Sound
2354 public virtual void SoundTrigger( UUID soundId, UUID ownerID, UUID objectID, UUID parentID,
2355 float gain, Vector3 position, UInt64 handle)
2356 {
2357 foreach (ScenePresence p in GetAvatars())
2358 {
2359 double dis = Util.GetDistanceTo(p.AbsolutePosition, position);
2360 if (dis > 100.0) // Max audio distance
2361 continue;
2362
2363 // Scale by distance
2364 gain = (float)((double)gain*((100.0 - dis) / 100.0));
2365 p.ControllingClient.SendTriggeredSound(soundId, ownerID, objectID, parentID, handle, position, (float)gain);
2366 }
2367
2368 }
2369
2351 // Gesture 2370 // Gesture
2352 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) 2371 public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
2353 { 2372 {