diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/CollisionSounds.cs | 101 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 3 |
2 files changed, 15 insertions, 89 deletions
diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs index de82ddc..a95e75a 100644 --- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs +++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs | |||
@@ -27,9 +27,11 @@ | |||
27 | // Ubit 2012 | 27 | // Ubit 2012 |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Reflection; | ||
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using log4net; | ||
33 | 35 | ||
34 | namespace OpenSim.Region.Framework.Scenes | 36 | namespace OpenSim.Region.Framework.Scenes |
35 | { | 37 | { |
@@ -42,9 +44,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
42 | 44 | ||
43 | public static class CollisionSounds | 45 | public static class CollisionSounds |
44 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
45 | private const int MaxMaterials = 7; | 49 | private const int MaxMaterials = 7; |
46 | // part part | 50 | // part part |
47 | /* | 51 | |
48 | private static UUID snd_StoneStone = new UUID("be7295c0-a158-11e1-b3dd-0800200c9a66"); | 52 | private static UUID snd_StoneStone = new UUID("be7295c0-a158-11e1-b3dd-0800200c9a66"); |
49 | private static UUID snd_StoneMetal = new UUID("be7295c0-a158-11e1-b3dd-0800201c9a66"); | 53 | private static UUID snd_StoneMetal = new UUID("be7295c0-a158-11e1-b3dd-0800201c9a66"); |
50 | private static UUID snd_StoneGlass = new UUID("be7295c0-a158-11e1-b3dd-0800202c9a66"); | 54 | private static UUID snd_StoneGlass = new UUID("be7295c0-a158-11e1-b3dd-0800202c9a66"); |
@@ -53,7 +57,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
53 | private static UUID snd_StonePlastic = new UUID("be7295c0-a158-11e1-b3dd-0800205c9a66"); | 57 | private static UUID snd_StonePlastic = new UUID("be7295c0-a158-11e1-b3dd-0800205c9a66"); |
54 | private static UUID snd_StoneRubber = new UUID("be7295c0-a158-11e1-b3dd-0800206c9a66"); | 58 | private static UUID snd_StoneRubber = new UUID("be7295c0-a158-11e1-b3dd-0800206c9a66"); |
55 | 59 | ||
56 | private static UUID snd_MetalStone = new UUID("be7295c0-a158-11e1-b3dd-0801200c9a66"); | ||
57 | private static UUID snd_MetalMetal = new UUID("be7295c0-a158-11e1-b3dd-0801201c9a66"); | 60 | private static UUID snd_MetalMetal = new UUID("be7295c0-a158-11e1-b3dd-0801201c9a66"); |
58 | private static UUID snd_MetalGlass = new UUID("be7295c0-a158-11e1-b3dd-0801202c9a66"); | 61 | private static UUID snd_MetalGlass = new UUID("be7295c0-a158-11e1-b3dd-0801202c9a66"); |
59 | private static UUID snd_MetalWood = new UUID("be7295c0-a158-11e1-b3dd-0801203c9a66"); | 62 | private static UUID snd_MetalWood = new UUID("be7295c0-a158-11e1-b3dd-0801203c9a66"); |
@@ -61,44 +64,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
61 | private static UUID snd_MetalPlastic = new UUID("be7295c0-a158-11e1-b3dd-0801205c9a66"); | 64 | private static UUID snd_MetalPlastic = new UUID("be7295c0-a158-11e1-b3dd-0801205c9a66"); |
62 | private static UUID snd_MetalRubber = new UUID("be7295c0-a158-11e1-b3dd-0801206c9a66"); | 65 | private static UUID snd_MetalRubber = new UUID("be7295c0-a158-11e1-b3dd-0801206c9a66"); |
63 | 66 | ||
64 | private static UUID snd_GlassStone = new UUID("be7295c0-a158-11e1-b3dd-0802200c9a66"); | ||
65 | private static UUID snd_GlassMetal = new UUID("be7295c0-a158-11e1-b3dd-0802201c9a66"); | ||
66 | private static UUID snd_GlassGlass = new UUID("be7295c0-a158-11e1-b3dd-0802202c9a66"); | 67 | private static UUID snd_GlassGlass = new UUID("be7295c0-a158-11e1-b3dd-0802202c9a66"); |
67 | private static UUID snd_GlassWood = new UUID("be7295c0-a158-11e1-b3dd-0802203c9a66"); | 68 | private static UUID snd_GlassWood = new UUID("be7295c0-a158-11e1-b3dd-0802203c9a66"); |
68 | private static UUID snd_GlassFlesh = new UUID("be7295c0-a158-11e1-b3dd-0802204c9a66"); | 69 | private static UUID snd_GlassFlesh = new UUID("be7295c0-a158-11e1-b3dd-0802204c9a66"); |
69 | private static UUID snd_GlassPlastic = new UUID("be7295c0-a158-11e1-b3dd-0802205c9a66"); | 70 | private static UUID snd_GlassPlastic = new UUID("be7295c0-a158-11e1-b3dd-0802205c9a66"); |
70 | private static UUID snd_GlassRubber = new UUID("be7295c0-a158-11e1-b3dd-0802206c9a66"); | 71 | private static UUID snd_GlassRubber = new UUID("be7295c0-a158-11e1-b3dd-0802206c9a66"); |
71 | 72 | ||
72 | private static UUID snd_WoodStone = new UUID("be7295c0-a158-11e1-b3dd-0803200c9a66"); | ||
73 | private static UUID snd_WoodMetal = new UUID("be7295c0-a158-11e1-b3dd-0803201c9a66"); | ||
74 | private static UUID snd_WoodGlass = new UUID("be7295c0-a158-11e1-b3dd-0803202c9a66"); | ||
75 | private static UUID snd_WoodWood = new UUID("be7295c0-a158-11e1-b3dd-0803203c9a66"); | 73 | private static UUID snd_WoodWood = new UUID("be7295c0-a158-11e1-b3dd-0803203c9a66"); |
76 | private static UUID snd_WoodFlesh = new UUID("be7295c0-a158-11e1-b3dd-0803204c9a66"); | 74 | private static UUID snd_WoodFlesh = new UUID("be7295c0-a158-11e1-b3dd-0803204c9a66"); |
77 | private static UUID snd_WoodPlastic = new UUID("be7295c0-a158-11e1-b3dd-0803205c9a66"); | 75 | private static UUID snd_WoodPlastic = new UUID("be7295c0-a158-11e1-b3dd-0803205c9a66"); |
78 | private static UUID snd_WoodRubber = new UUID("be7295c0-a158-11e1-b3dd-0803206c9a66"); | 76 | private static UUID snd_WoodRubber = new UUID("be7295c0-a158-11e1-b3dd-0803206c9a66"); |
79 | 77 | ||
80 | private static UUID snd_FleshStone = new UUID("be7295c0-a158-11e1-b3dd-0804200c9a66"); | ||
81 | private static UUID snd_FleshMetal = new UUID("be7295c0-a158-11e1-b3dd-0804201c9a66"); | ||
82 | private static UUID snd_FleshGlass = new UUID("be7295c0-a158-11e1-b3dd-0804202c9a66"); | ||
83 | private static UUID snd_FleshWood = new UUID("be7295c0-a158-11e1-b3dd-0804203c9a66"); | ||
84 | private static UUID snd_FleshFlesh = new UUID("be7295c0-a158-11e1-b3dd-0804204c9a66"); | 78 | private static UUID snd_FleshFlesh = new UUID("be7295c0-a158-11e1-b3dd-0804204c9a66"); |
85 | private static UUID snd_FleshPlastic = new UUID("be7295c0-a158-11e1-b3dd-0804205c9a66"); | 79 | private static UUID snd_FleshPlastic = new UUID("be7295c0-a158-11e1-b3dd-0804205c9a66"); |
86 | private static UUID snd_FleshRubber = new UUID("be7295c0-a158-11e1-b3dd-0804206c9a66"); | 80 | private static UUID snd_FleshRubber = new UUID("be7295c0-a158-11e1-b3dd-0804206c9a66"); |
87 | 81 | ||
88 | private static UUID snd_PlasticStone = new UUID("be7295c0-a158-11e1-b3dd-0805200c9a66"); | ||
89 | private static UUID snd_PlasticMetal = new UUID("be7295c0-a158-11e1-b3dd-0805201c9a66"); | ||
90 | private static UUID snd_PlasticGlass = new UUID("be7295c0-a158-11e1-b3dd-0805202c9a66"); | ||
91 | private static UUID snd_PlasticWood = new UUID("be7295c0-a158-11e1-b3dd-0805203c9a66"); | ||
92 | private static UUID snd_PlasticFlesh = new UUID("be7295c0-a158-11e1-b3dd-0805204c9a66"); | ||
93 | private static UUID snd_PlasticPlastic = new UUID("be7295c0-a158-11e1-b3dd-0805205c9a66"); | 82 | private static UUID snd_PlasticPlastic = new UUID("be7295c0-a158-11e1-b3dd-0805205c9a66"); |
94 | private static UUID snd_PlasticRubber = new UUID("be7295c0-a158-11e1-b3dd-0805206c9a66"); | 83 | private static UUID snd_PlasticRubber = new UUID("be7295c0-a158-11e1-b3dd-0805206c9a66"); |
95 | 84 | ||
96 | private static UUID snd_RubberStone = new UUID("be7295c0-a158-11e1-b3dd-0806200c9a66"); | ||
97 | private static UUID snd_RubberMetal = new UUID("be7295c0-a158-11e1-b3dd-0806201c9a66"); | ||
98 | private static UUID snd_RubberGlass = new UUID("be7295c0-a158-11e1-b3dd-0806202c9a66"); | ||
99 | private static UUID snd_RubberWood = new UUID("be7295c0-a158-11e1-b3dd-0806203c9a66"); | ||
100 | private static UUID snd_RubberFlesh = new UUID("be7295c0-a158-11e1-b3dd-0806204c9a66"); | ||
101 | private static UUID snd_RubberPlastic = new UUID("be7295c0-a158-11e1-b3dd-0806205c9a66"); | ||
102 | private static UUID snd_RubberRubber = new UUID("be7295c0-a158-11e1-b3dd-0806206c9a66"); | 85 | private static UUID snd_RubberRubber = new UUID("be7295c0-a158-11e1-b3dd-0806206c9a66"); |
103 | 86 | ||
104 | // terrain part | 87 | // terrain part |
@@ -109,50 +92,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
109 | private static UUID snd_TerrainFlesh = new UUID("be7295c0-a158-11e1-b3dd-0807200c9a66"); | 92 | private static UUID snd_TerrainFlesh = new UUID("be7295c0-a158-11e1-b3dd-0807200c9a66"); |
110 | private static UUID snd_TerrainPlastic = new UUID("be7295c0-a158-11e1-b3dd-0807200c9a66"); | 93 | private static UUID snd_TerrainPlastic = new UUID("be7295c0-a158-11e1-b3dd-0807200c9a66"); |
111 | private static UUID snd_TerrainRubber = new UUID("be7295c0-a158-11e1-b3dd-0807200c9a66"); | 94 | private static UUID snd_TerrainRubber = new UUID("be7295c0-a158-11e1-b3dd-0807200c9a66"); |
112 | */ | ||
113 | private static UUID snd_StoneStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
114 | private static UUID snd_StoneMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
115 | private static UUID snd_StoneGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
116 | private static UUID snd_StoneWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
117 | private static UUID snd_StoneFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
118 | private static UUID snd_StonePlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
119 | private static UUID snd_StoneRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
120 | |||
121 | private static UUID snd_MetalMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
122 | private static UUID snd_MetalGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
123 | private static UUID snd_MetalWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
124 | private static UUID snd_MetalFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
125 | private static UUID snd_MetalPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
126 | private static UUID snd_MetalRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
127 | |||
128 | private static UUID snd_GlassGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
129 | private static UUID snd_GlassWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
130 | private static UUID snd_GlassFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
131 | private static UUID snd_GlassPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
132 | private static UUID snd_GlassRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
133 | |||
134 | private static UUID snd_WoodWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
135 | private static UUID snd_WoodFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
136 | private static UUID snd_WoodPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
137 | private static UUID snd_WoodRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
138 | |||
139 | private static UUID snd_FleshFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
140 | private static UUID snd_FleshPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
141 | private static UUID snd_FleshRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
142 | |||
143 | private static UUID snd_PlasticPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
144 | private static UUID snd_PlasticRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
145 | |||
146 | private static UUID snd_RubberRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
147 | |||
148 | // terrain part | ||
149 | private static UUID snd_TerrainStone = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
150 | private static UUID snd_TerrainMetal = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
151 | private static UUID snd_TerrainGlass = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
152 | private static UUID snd_TerrainWood = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
153 | private static UUID snd_TerrainFlesh = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
154 | private static UUID snd_TerrainPlastic = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
155 | private static UUID snd_TerrainRubber = new UUID("c80260ba-41fd-8a46-768a-6bf236360e3a"); | ||
156 | 95 | ||
157 | public static UUID[] m_TerrainPart = { | 96 | public static UUID[] m_TerrainPart = { |
158 | snd_TerrainStone, | 97 | snd_TerrainStone, |
@@ -163,18 +102,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
163 | snd_TerrainPlastic, | 102 | snd_TerrainPlastic, |
164 | snd_TerrainRubber | 103 | snd_TerrainRubber |
165 | }; | 104 | }; |
166 | /* | 105 | |
167 | //full assimetric sounds | ||
168 | public static UUID[] m_PartPart = { | ||
169 | snd_StoneStone, snd_StoneMetal, snd_StoneGlass, snd_StoneWood, snd_StoneFlesh, snd_StonePlastic, snd_StoneRubber, | ||
170 | snd_MetalStone, snd_MetalMetal, snd_MetalGlass, snd_MetalWood, snd_MetalFlesh, snd_MetalPlastic, snd_MetalRubber, | ||
171 | snd_GlassStone, snd_GlassMetal, snd_GlassGlass, snd_GlassWood, snd_GlassFlesh, snd_GlassPlastic, snd_GlassRubber, | ||
172 | snd_WoodStone, snd_WoodMetal, snd_WoodGlass, snd_WoodWood, snd_WoodFlesh, snd_WoodPlastic, snd_WoodRubber, | ||
173 | snd_FleshStone, snd_FleshMetal, snd_FleshGlass, snd_FleshWood, snd_FleshFlesh, snd_FleshPlastic, snd_FleshRubber, | ||
174 | snd_PlasticStone, snd_PlasticMetal, snd_PlasticGlass, snd_PlasticWood, snd_PlasticFlesh, snd_PlasticPlastic, snd_PlasticRubber, | ||
175 | snd_RubberStone, snd_RubberMetal, snd_RubberGlass, snd_RubberWood, snd_RubberFlesh, snd_RubberPlastic, snd_RubberRubber | ||
176 | }; | ||
177 | */ | ||
178 | // simetric sounds | 106 | // simetric sounds |
179 | public static UUID[] m_PartPart = { | 107 | public static UUID[] m_PartPart = { |
180 | snd_StoneStone, snd_StoneMetal, snd_StoneGlass, snd_StoneWood, snd_StoneFlesh, snd_StonePlastic, snd_StoneRubber, | 108 | snd_StoneStone, snd_StoneMetal, snd_StoneGlass, snd_StoneWood, snd_StoneFlesh, snd_StonePlastic, snd_StoneRubber, |
@@ -188,9 +116,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
188 | 116 | ||
189 | public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist) | 117 | public static void PartCollisionSound(SceneObjectPart part, List<CollisionForSoundInfo> collidersinfolist) |
190 | { | 118 | { |
191 | // disable for now | ||
192 | return; | ||
193 | |||
194 | if (collidersinfolist.Count == 0 || part == null) | 119 | if (collidersinfolist.Count == 0 || part == null) |
195 | return; | 120 | return; |
196 | 121 | ||
@@ -300,9 +225,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
300 | 225 | ||
301 | public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist) | 226 | public static void AvatarCollisionSound(ScenePresence av, List<CollisionForSoundInfo> collidersinfolist) |
302 | { | 227 | { |
303 | // disable for now | ||
304 | return; | ||
305 | |||
306 | if (collidersinfolist.Count == 0 || av == null) | 228 | if (collidersinfolist.Count == 0 || av == null) |
307 | return; | 229 | return; |
308 | 230 | ||
@@ -346,10 +268,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
346 | volume = Math.Abs(colInfo.relativeVel); | 268 | volume = Math.Abs(colInfo.relativeVel); |
347 | if (volume < 0.2f) | 269 | if (volume < 0.2f) |
348 | continue; | 270 | continue; |
271 | m_log.DebugFormat("Collision speed was {0}", volume); | ||
349 | 272 | ||
350 | volume *= volume * .0625f; // 4m/s == full volume | 273 | // Cap to 0.2 times volume because climbing stairs should not be noisy |
351 | if (volume > 1.0f) | 274 | // Also changed scaling |
352 | volume = 1.0f; | 275 | volume *= volume * .0125f; // 4m/s == volume 0.2 |
276 | if (volume > 0.2f) | ||
277 | volume = 0.2f; | ||
353 | otherMaterial = (int)otherPart.Material; | 278 | otherMaterial = (int)otherPart.Material; |
354 | if (otherMaterial >= MaxMaterials) | 279 | if (otherMaterial >= MaxMaterials) |
355 | otherMaterial = 3; | 280 | otherMaterial = 3; |
@@ -374,4 +299,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
374 | } | 299 | } |
375 | } | 300 | } |
376 | } | 301 | } |
377 | } \ No newline at end of file | 302 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 46a7e3d..904c896 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3948,10 +3948,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3948 | scriptPosTarget target = m_targets[idx]; | 3948 | scriptPosTarget target = m_targets[idx]; |
3949 | if (Util.GetDistanceTo(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance) | 3949 | if (Util.GetDistanceTo(target.targetPos, m_rootPart.GroupPosition) <= target.tolerance) |
3950 | { | 3950 | { |
3951 | at_target = true; | ||
3952 | |||
3951 | // trigger at_target | 3953 | // trigger at_target |
3952 | if (m_scriptListens_atTarget) | 3954 | if (m_scriptListens_atTarget) |
3953 | { | 3955 | { |
3954 | at_target = true; | ||
3955 | scriptPosTarget att = new scriptPosTarget(); | 3956 | scriptPosTarget att = new scriptPosTarget(); |
3956 | att.targetPos = target.targetPos; | 3957 | att.targetPos = target.targetPos; |
3957 | att.tolerance = target.tolerance; | 3958 | att.tolerance = target.tolerance; |