diff options
author | UbitUmarov | 2016-08-28 08:45:09 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-28 08:45:09 +0100 |
commit | ddc2f2ccd3566a9a4a3631c872979aa6830dbcfe (patch) | |
tree | 24c51a69f8b0e5d17f35501b37659843cf0a4bbe /OpenSim/Region/Framework | |
parent | let mouse steer work on crossings; some cleanup (diff) | |
download | opensim-SC-ddc2f2ccd3566a9a4a3631c872979aa6830dbcfe.zip opensim-SC-ddc2f2ccd3566a9a4a3631c872979aa6830dbcfe.tar.gz opensim-SC-ddc2f2ccd3566a9a4a3631c872979aa6830dbcfe.tar.bz2 opensim-SC-ddc2f2ccd3566a9a4a3631c872979aa6830dbcfe.tar.xz |
mantis: 8008 unscripted child prim collisions didn't trigger scripted root prim collision events; collision sounds had incorrect aggregateevents call and default sounds where muted. Future optimization needed and Testing
Diffstat (limited to '')
4 files changed, 26 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 | } |