diff options
6 files changed, 32 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs index 078449b..84817a0 100644 --- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs +++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs | |||
@@ -129,8 +129,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
129 | return; | 129 | return; |
130 | 130 | ||
131 | float volume = part.CollisionSoundVolume; | 131 | float volume = part.CollisionSoundVolume; |
132 | if (volume == 0.0f) | ||
133 | return; | ||
134 | 132 | ||
135 | UUID soundID = part.CollisionSound; | 133 | UUID soundID = part.CollisionSound; |
136 | 134 | ||
@@ -150,6 +148,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
150 | break; | 148 | break; |
151 | } | 149 | } |
152 | 150 | ||
151 | if (volume == 0.0f) | ||
152 | return; | ||
153 | |||
153 | bool doneownsound = false; | 154 | bool doneownsound = false; |
154 | 155 | ||
155 | int thisMaterial = (int)part.Material; | 156 | int thisMaterial = (int)part.Material; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9b7374c..b7c5b6b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2112,6 +2112,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2112 | d.AddActiveScripts(count); | 2112 | d.AddActiveScripts(count); |
2113 | } | 2113 | } |
2114 | 2114 | ||
2115 | private const scriptEvents PhysicsNeeedSubsEvents = ( | ||
2116 | scriptEvents.collision | scriptEvents.collision_start | scriptEvents.collision_end | | ||
2117 | scriptEvents.land_collision | scriptEvents.land_collision_start | scriptEvents.land_collision_end); | ||
2118 | |||
2119 | private scriptEvents lastRootPartPhysEvents = 0; | ||
2120 | |||
2115 | public void aggregateScriptEvents() | 2121 | public void aggregateScriptEvents() |
2116 | { | 2122 | { |
2117 | PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags(); | 2123 | PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags(); |
@@ -2148,6 +2154,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
2148 | m_scene.RemoveGroupTarget(this); | 2154 | m_scene.RemoveGroupTarget(this); |
2149 | } | 2155 | } |
2150 | 2156 | ||
2157 | scriptEvents rootPartPhysEvents = RootPart.AggregateScriptEvents; | ||
2158 | rootPartPhysEvents &= PhysicsNeeedSubsEvents; | ||
2159 | if (rootPartPhysEvents != lastRootPartPhysEvents) | ||
2160 | { | ||
2161 | lastRootPartPhysEvents = rootPartPhysEvents; | ||
2162 | for (int i = 0; i < parts.Length; i++) | ||
2163 | { | ||
2164 | SceneObjectPart part = parts[i]; | ||
2165 | if (part == null) | ||
2166 | continue; | ||
2167 | part.UpdatePhysicsSubscribedEvents(); | ||
2168 | } | ||
2169 | } | ||
2170 | |||
2151 | ScheduleGroupForFullUpdate(); | 2171 | ScheduleGroupForFullUpdate(); |
2152 | } | 2172 | } |
2153 | 2173 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dd20a2f..fcc3463 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1534,7 +1534,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1534 | else | 1534 | else |
1535 | m_collisionSoundType = 1; | 1535 | m_collisionSoundType = 1; |
1536 | 1536 | ||
1537 | aggregateScriptEvents(); | ||
1538 | } | 1537 | } |
1539 | } | 1538 | } |
1540 | 1539 | ||
@@ -5033,7 +5032,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5033 | } | 5032 | } |
5034 | 5033 | ||
5035 | 5034 | ||
5036 | private void UpdatePhysicsSubscribedEvents() | 5035 | internal void UpdatePhysicsSubscribedEvents() |
5037 | { | 5036 | { |
5038 | PhysicsActor pa = PhysActor; | 5037 | PhysicsActor pa = PhysActor; |
5039 | if (pa == null) | 5038 | if (pa == null) |
@@ -5107,8 +5106,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5107 | objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop; | 5106 | objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop; |
5108 | } | 5107 | } |
5109 | 5108 | ||
5110 | UpdatePhysicsSubscribedEvents(); | ||
5111 | |||
5112 | LocalFlags = (PrimFlags)objectflagupdate; | 5109 | LocalFlags = (PrimFlags)objectflagupdate; |
5113 | 5110 | ||
5114 | if (ParentGroup != null && ParentGroup.RootPart == this) | 5111 | if (ParentGroup != null && ParentGroup.RootPart == this) |
@@ -5119,6 +5116,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5119 | { | 5116 | { |
5120 | // m_log.DebugFormat( | 5117 | // m_log.DebugFormat( |
5121 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); | 5118 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); |
5119 | UpdatePhysicsSubscribedEvents(); | ||
5122 | ScheduleFullUpdate(); | 5120 | ScheduleFullUpdate(); |
5123 | } | 5121 | } |
5124 | } | 5122 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 914644a..50ee9d4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1246,7 +1246,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1246 | physActor_OnPhysicsRequestingCameraData; | 1246 | physActor_OnPhysicsRequestingCameraData; |
1247 | partPhysActor.OnPhysicsRequestingCameraData += | 1247 | partPhysActor.OnPhysicsRequestingCameraData += |
1248 | physActor_OnPhysicsRequestingCameraData; | 1248 | physActor_OnPhysicsRequestingCameraData; |
1249 | } | 1249 | } |
1250 | } | 1250 | } |
1251 | ParentUUID = UUID.Zero; | 1251 | ParentUUID = UUID.Zero; |
1252 | } | 1252 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c046a0c..66cb30c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5109,6 +5109,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5109 | m_host.CollisionSoundVolume = (float)impact_volume; | 5109 | m_host.CollisionSoundVolume = (float)impact_volume; |
5110 | m_host.CollisionSound = m_host.invalidCollisionSoundUUID; | 5110 | m_host.CollisionSound = m_host.invalidCollisionSoundUUID; |
5111 | m_host.CollisionSoundType = -1; // disable all sounds | 5111 | m_host.CollisionSoundType = -1; // disable all sounds |
5112 | m_host.aggregateScriptEvents(); | ||
5112 | return; | 5113 | return; |
5113 | } | 5114 | } |
5114 | 5115 | ||
@@ -5122,6 +5123,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5122 | } | 5123 | } |
5123 | else | 5124 | else |
5124 | m_host.CollisionSoundType = -1; | 5125 | m_host.CollisionSoundType = -1; |
5126 | |||
5127 | m_host.aggregateScriptEvents(); | ||
5125 | } | 5128 | } |
5126 | 5129 | ||
5127 | public LSL_String llGetAnimation(string id) | 5130 | public LSL_String llGetAnimation(string id) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6168fe0..4af4339 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -4266,6 +4266,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4266 | m_host.CollisionSoundType = 0; // full return to default sounds | 4266 | m_host.CollisionSoundType = 0; // full return to default sounds |
4267 | else | 4267 | else |
4268 | m_host.CollisionSoundType = 2; // default sounds with volume | 4268 | m_host.CollisionSoundType = 2; // default sounds with volume |
4269 | m_host.aggregateScriptEvents(); | ||
4269 | return; | 4270 | return; |
4270 | } | 4271 | } |
4271 | // TODO: Parameter check logic required. | 4272 | // TODO: Parameter check logic required. |
@@ -4278,6 +4279,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4278 | } | 4279 | } |
4279 | else | 4280 | else |
4280 | m_host.CollisionSoundType = -1; | 4281 | m_host.CollisionSoundType = -1; |
4282 | |||
4283 | m_host.aggregateScriptEvents(); | ||
4281 | } | 4284 | } |
4282 | 4285 | ||
4283 | // still not very usefull, detector is lost on rez, restarts, etc | 4286 | // still not very usefull, detector is lost on rez, restarts, etc |