diff options
author | Justin Clarke Casey | 2008-12-19 21:03:56 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-12-19 21:03:56 +0000 |
commit | db0c65ea568d208d0017e466f67275036b5544b4 (patch) | |
tree | 24b7354ff98c1c9e10aa542c5651f39ff69cc01e /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | Stop prims that get non-physical. Fixes Mantis#2859. (diff) | |
download | opensim-SC-db0c65ea568d208d0017e466f67275036b5544b4.zip opensim-SC-db0c65ea568d208d0017e466f67275036b5544b4.tar.gz opensim-SC-db0c65ea568d208d0017e466f67275036b5544b4.tar.bz2 opensim-SC-db0c65ea568d208d0017e466f67275036b5544b4.tar.xz |
* refactor: move sound trigger from scene into sepearate SoundModule
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index dededd4..1476f88 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2341,31 +2341,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
2341 | client.OnDeactivateGesture += gesturesModule.DeactivateGesture; | 2341 | client.OnDeactivateGesture += gesturesModule.DeactivateGesture; |
2342 | } | 2342 | } |
2343 | 2343 | ||
2344 | //sound | 2344 | ISoundModule soundModule = RequestModuleInterface<ISoundModule>(); |
2345 | client.OnSoundTrigger += SoundTrigger; | 2345 | if (soundModule != null) |
2346 | client.OnSoundTrigger += soundModule.TriggerSound; | ||
2346 | 2347 | ||
2347 | client.OnObjectOwner += ObjectOwner; | 2348 | client.OnObjectOwner += ObjectOwner; |
2348 | 2349 | ||
2349 | // EventManager.TriggerOnNewClient(client); | 2350 | // EventManager.TriggerOnNewClient(client); |
2350 | } | 2351 | } |
2351 | 2352 | ||
2352 | // Sound | ||
2353 | public virtual void SoundTrigger( UUID soundId, UUID ownerID, UUID objectID, UUID parentID, | ||
2354 | float gain, Vector3 position, UInt64 handle) | ||
2355 | { | ||
2356 | foreach (ScenePresence p in GetAvatars()) | ||
2357 | { | ||
2358 | double dis = Util.GetDistanceTo(p.AbsolutePosition, position); | ||
2359 | if (dis > 100.0) // Max audio distance | ||
2360 | continue; | ||
2361 | |||
2362 | // Scale by distance | ||
2363 | gain = (float)((double)gain*((100.0 - dis) / 100.0)); | ||
2364 | p.ControllingClient.SendTriggeredSound(soundId, ownerID, objectID, parentID, handle, position, (float)gain); | ||
2365 | } | ||
2366 | |||
2367 | } | ||
2368 | |||
2369 | /// <summary> | 2353 | /// <summary> |
2370 | /// Teleport an avatar to their home region | 2354 | /// Teleport an avatar to their home region |
2371 | /// </summary> | 2355 | /// </summary> |