aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index c7862ec..a626fa3 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -201,6 +201,10 @@ namespace OpenSim.Region.Environment.Scenes
201 private Vector3 m_cameraAtOffset = new Vector3(0.0f, 0.0f, 0.0f); 201 private Vector3 m_cameraAtOffset = new Vector3(0.0f, 0.0f, 0.0f);
202 private bool m_forceMouselook = false; 202 private bool m_forceMouselook = false;
203 203
204 // TODO: Collision sound should have default.
205 private UUID m_collisionSound = UUID.Zero;
206 private float m_collisionSoundVolume = 0.0f;
207
204 #endregion Fields 208 #endregion Fields
205 209
206 #region Constructors 210 #region Constructors
@@ -952,6 +956,22 @@ if (m_shape != null) {
952 set { m_sitAnimation = value; } 956 set { m_sitAnimation = value; }
953 } 957 }
954 958
959 public UUID CollisionSound
960 {
961 get { return m_collisionSound; }
962 set
963 {
964 m_collisionSound = value;
965 aggregateScriptEvents();
966 }
967 }
968
969 public float CollisionSoundVolume
970 {
971 get { return m_collisionSoundVolume; }
972 set { m_collisionSoundVolume = value; }
973 }
974
955 #endregion Public Properties with only Get 975 #endregion Public Properties with only Get
956 976
957 977
@@ -1607,6 +1627,12 @@ if (m_shape != null) {
1607 if (m_parentGroup.IsDeleted) 1627 if (m_parentGroup.IsDeleted)
1608 return; 1628 return;
1609 1629
1630 // play the sound.
1631 if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f)
1632 {
1633 SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0);
1634 }
1635
1610 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) 1636 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0)
1611 { 1637 {
1612 // do event notification 1638 // do event notification
@@ -3233,7 +3259,8 @@ if (m_shape != null) {
3233 if ( 3259 if (
3234 ((AggregateScriptEvents & scriptEvents.collision) != 0) || 3260 ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
3235 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || 3261 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
3236 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) 3262 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
3263 (CollisionSound != null && CollisionSound != UUID.Zero)
3237 ) 3264 )
3238 { 3265 {
3239 // subscribe to physics updates. 3266 // subscribe to physics updates.
@@ -3252,6 +3279,13 @@ if (m_shape != null) {
3252 PhysActor.OnCollisionUpdate -= PhysicsCollision; 3279 PhysActor.OnCollisionUpdate -= PhysicsCollision;
3253 } 3280 }
3254 } 3281 }
3282
3283 if (m_parentGroup == null)
3284 {
3285 ScheduleFullUpdate();
3286 return;
3287 }
3288
3255 if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) 3289 if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
3256 { 3290 {
3257 m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; 3291 m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting;
@@ -3363,3 +3397,4 @@ if (m_shape != null) {
3363 3397
3364 3398
3365 3399
3400