aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-05-17 04:14:13 +0100
committerUbitUmarov2012-05-17 04:14:13 +0100
commit038986baffff3d2a6b2ec4f10ae8c40635b5398b (patch)
tree23f505e51ece853d6cd6440f35feef42dd6d8c37 /OpenSim/Region/Framework/Scenes/CollisionSounds.cs
parentdefault colisionVolume is 0, use it only for user specified sound (diff)
downloadopensim-SC-038986baffff3d2a6b2ec4f10ae8c40635b5398b.zip
opensim-SC-038986baffff3d2a6b2ec4f10ae8c40635b5398b.tar.gz
opensim-SC-038986baffff3d2a6b2ec4f10ae8c40635b5398b.tar.bz2
opensim-SC-038986baffff3d2a6b2ec4f10ae8c40635b5398b.tar.xz
add avatar colision sounds. Changed test sound UUID
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/CollisionSounds.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/CollisionSounds.cs180
1 files changed, 118 insertions, 62 deletions
diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
index 65c8012..a22ee10 100644
--- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
+++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs
@@ -40,70 +40,70 @@ namespace OpenSim.Region.Framework.Scenes
40 40
41 private const int MaxMaterials = 7; 41 private const int MaxMaterials = 7;
42 // part part 42 // part part
43 private static UUID snd_StoneStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 43 private static UUID snd_StoneStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
44 private static UUID snd_StoneMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 44 private static UUID snd_StoneMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
45 private static UUID snd_StoneGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 45 private static UUID snd_StoneGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
46 private static UUID snd_StoneWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 46 private static UUID snd_StoneWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
47 private static UUID snd_StoneFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 47 private static UUID snd_StoneFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
48 private static UUID snd_StonePlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 48 private static UUID snd_StonePlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
49 private static UUID snd_StoneRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 49 private static UUID snd_StoneRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
50 50
51 private static UUID snd_MetalStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 51 private static UUID snd_MetalStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
52 private static UUID snd_MetalMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 52 private static UUID snd_MetalMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
53 private static UUID snd_MetalGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 53 private static UUID snd_MetalGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
54 private static UUID snd_MetalWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 54 private static UUID snd_MetalWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
55 private static UUID snd_MetalFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 55 private static UUID snd_MetalFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
56 private static UUID snd_MetalPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 56 private static UUID snd_MetalPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
57 private static UUID snd_MetalRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 57 private static UUID snd_MetalRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
58 58
59 private static UUID snd_GlassStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 59 private static UUID snd_GlassStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
60 private static UUID snd_GlassMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 60 private static UUID snd_GlassMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
61 private static UUID snd_GlassGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 61 private static UUID snd_GlassGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
62 private static UUID snd_GlassWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 62 private static UUID snd_GlassWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
63 private static UUID snd_GlassFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 63 private static UUID snd_GlassFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
64 private static UUID snd_GlassPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 64 private static UUID snd_GlassPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
65 private static UUID snd_GlassRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 65 private static UUID snd_GlassRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
66 66
67 private static UUID snd_WoodStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 67 private static UUID snd_WoodStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
68 private static UUID snd_WoodMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 68 private static UUID snd_WoodMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
69 private static UUID snd_WoodGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 69 private static UUID snd_WoodGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
70 private static UUID snd_WoodWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 70 private static UUID snd_WoodWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
71 private static UUID snd_WoodFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 71 private static UUID snd_WoodFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
72 private static UUID snd_WoodPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 72 private static UUID snd_WoodPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
73 private static UUID snd_WoodRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 73 private static UUID snd_WoodRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
74 74
75 private static UUID snd_FleshStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 75 private static UUID snd_FleshStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
76 private static UUID snd_FleshMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 76 private static UUID snd_FleshMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
77 private static UUID snd_FleshGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 77 private static UUID snd_FleshGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
78 private static UUID snd_FleshWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 78 private static UUID snd_FleshWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
79 private static UUID snd_FleshFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 79 private static UUID snd_FleshFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
80 private static UUID snd_FleshPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 80 private static UUID snd_FleshPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
81 private static UUID snd_FleshRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 81 private static UUID snd_FleshRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
82 82
83 private static UUID snd_PlasticStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 83 private static UUID snd_PlasticStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
84 private static UUID snd_PlasticMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 84 private static UUID snd_PlasticMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
85 private static UUID snd_PlasticGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 85 private static UUID snd_PlasticGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
86 private static UUID snd_PlasticWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 86 private static UUID snd_PlasticWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
87 private static UUID snd_PlasticFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 87 private static UUID snd_PlasticFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
88 private static UUID snd_PlasticPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 88 private static UUID snd_PlasticPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
89 private static UUID snd_PlasticRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 89 private static UUID snd_PlasticRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
90 90
91 private static UUID snd_RubberStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 91 private static UUID snd_RubberStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
92 private static UUID snd_RubberMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 92 private static UUID snd_RubberMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
93 private static UUID snd_RubberGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 93 private static UUID snd_RubberGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
94 private static UUID snd_RubberWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 94 private static UUID snd_RubberWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
95 private static UUID snd_RubberFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 95 private static UUID snd_RubberFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
96 private static UUID snd_RubberPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 96 private static UUID snd_RubberPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
97 private static UUID snd_RubberRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 97 private static UUID snd_RubberRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
98 98
99 // terrain part 99 // terrain part
100 private static UUID snd_TerrainStone = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 100 private static UUID snd_TerrainStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
101 private static UUID snd_TerrainMetal = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 101 private static UUID snd_TerrainMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
102 private static UUID snd_TerrainGlass = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 102 private static UUID snd_TerrainGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
103 private static UUID snd_TerrainWood = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 103 private static UUID snd_TerrainWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
104 private static UUID snd_TerrainFlesh = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 104 private static UUID snd_TerrainFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
105 private static UUID snd_TerrainPlastic = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 105 private static UUID snd_TerrainPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
106 private static UUID snd_TerrainRubber = new UUID("be582e5d-b123-41a2-a150-454c39e961c8"); 106 private static UUID snd_TerrainRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a");
107 107
108 public static UUID[] m_TerrainPart = { 108 public static UUID[] m_TerrainPart = {
109 snd_TerrainStone, 109 snd_TerrainStone,
@@ -187,6 +187,7 @@ namespace OpenSim.Region.Framework.Scenes
187 } 187 }
188 } 188 }
189 } 189 }
190/* avatars get notification let them trigger the sound
190 else if (!doneownsound) 191 else if (!doneownsound)
191 { 192 {
192 ScenePresence av = part.ParentGroup.Scene.GetScenePresence(Id); 193 ScenePresence av = part.ParentGroup.Scene.GetScenePresence(Id);
@@ -198,7 +199,62 @@ namespace OpenSim.Region.Framework.Scenes
198 doneownsound = true; 199 doneownsound = true;
199 } 200 }
200 } 201 }
202 */
203 }
204 }
205
206 public static void AvatarCollisionSound(ScenePresence av, List<uint> Colliders)
207 {
208 if (Colliders.Count == 0 || av == null)
209 return;
210
211 UUID soundID;
212 int otherMaterial;
213
214 int thisMaterial = 3;
215
216 int thisMatScaled = thisMaterial * MaxMaterials;
217 int index;
218// bool doneownsound = false;
219
220 foreach (uint Id in Colliders)
221 {
222 if (Id == 0)
223 {
224 continue;
225 }
226
227 SceneObjectPart otherPart = av.Scene.GetSceneObjectPart(Id);
228 if (otherPart != null)
229 {
230 if (otherPart.CollisionSound == otherPart.invalidCollisionSoundUUID)
231 continue;
232 if (otherPart.CollisionSound != UUID.Zero)
233 otherPart.SendCollisionSound(otherPart.CollisionSound, otherPart.CollisionSoundVolume);
234 else
235 {
236 otherMaterial = (int)otherPart.Material;
237 if (otherMaterial >= MaxMaterials)
238 otherMaterial = 3;
239 index = thisMatScaled + otherMaterial;
240 soundID = m_PartPart[index];
241 otherPart.SendCollisionSound(soundID, 1.0);
242 }
243 }
244/*
245 else if (!doneownsound)
246 {
247 ScenePresence otherav = av.Scene.GetScenePresence(Id);
248 if (otherav != null && (!otherav.IsChildAgent))
249 {
250 soundID = snd_FleshFlesh;
251 av.SendCollisionSound(soundID, 1.0);
252 doneownsound = true;
253 }
254 }
255 */
201 } 256 }
202 } 257 }
258
203 } 259 }
204} \ No newline at end of file 260} \ No newline at end of file