diff options
author | Charles Krinke | 2008-11-19 18:41:10 +0000 |
---|---|---|
committer | Charles Krinke | 2008-11-19 18:41:10 +0000 |
commit | 164ed57ad35b4496dcd8da6fb8ec6546300c9036 (patch) | |
tree | 923d8023fb5dbdcbb7b897e1816b8d302e663de1 /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | Mantis#2657. Thank you kindly, StrawberryFride for a patch that: (diff) | |
download | opensim-SC_OLD-164ed57ad35b4496dcd8da6fb8ec6546300c9036.zip opensim-SC_OLD-164ed57ad35b4496dcd8da6fb8ec6546300c9036.tar.gz opensim-SC_OLD-164ed57ad35b4496dcd8da6fb8ec6546300c9036.tar.bz2 opensim-SC_OLD-164ed57ad35b4496dcd8da6fb8ec6546300c9036.tar.xz |
Mantis#2638. Thank you kindly, Sacha Magne for a patch that:
Implementing "Play sound inworld". Currently a WIP .
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 19 |
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 | { |