diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Prioritizer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index f9599f5..cde8d3f 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -167,6 +167,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
167 | 167 | ||
168 | private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) | 168 | private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) |
169 | { | 169 | { |
170 | if (entity == null) return double.NaN; | ||
170 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); | 171 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); |
171 | if (presence != null) | 172 | if (presence != null) |
172 | { | 173 | { |
@@ -224,22 +225,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
224 | if (entity == null) | 225 | if (entity == null) |
225 | return double.NaN; | 226 | return double.NaN; |
226 | 227 | ||
227 | // Use group position for child prims | 228 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); |
228 | Vector3 entityPos = entity.AbsolutePosition; | 229 | if (presence != null) |
229 | if (entity is SceneObjectPart) | ||
230 | { | 230 | { |
231 | SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup; | 231 | // Use group position for child prims |
232 | if (group != null) | 232 | Vector3 entityPos; |
233 | entityPos = group.AbsolutePosition; | 233 | if (entity is SceneObjectPart) |
234 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; | ||
234 | else | 235 | else |
235 | entityPos = entity.AbsolutePosition; | 236 | entityPos = entity.AbsolutePosition; |
236 | } | ||
237 | else | ||
238 | entityPos = entity.AbsolutePosition; | ||
239 | 237 | ||
240 | ScenePresence presence = m_scene.GetScenePresence(client.AgentId); | ||
241 | if (presence != null) | ||
242 | { | ||
243 | if (!presence.IsChildAgent) | 238 | if (!presence.IsChildAgent) |
244 | { | 239 | { |
245 | if (entity is ScenePresence) | 240 | if (entity is ScenePresence) |
@@ -259,12 +254,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
259 | 254 | ||
260 | if (entity is SceneObjectPart) | 255 | if (entity is SceneObjectPart) |
261 | { | 256 | { |
262 | PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor; | ||
263 | if (physActor == null || !physActor.IsPhysical) | ||
264 | priority += 100; | ||
265 | |||
266 | if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment) | 257 | if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment) |
258 | { | ||
267 | priority = 1.0; | 259 | priority = 1.0; |
260 | } | ||
261 | else | ||
262 | { | ||
263 | PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor; | ||
264 | if (physActor == null || !physActor.IsPhysical) | ||
265 | priority += 100; | ||
266 | } | ||
267 | |||
268 | if (((SceneObjectPart)entity).ParentGroup.RootPart != (SceneObjectPart)entity) | ||
269 | priority +=1; | ||
268 | } | 270 | } |
269 | return priority; | 271 | return priority; |
270 | } | 272 | } |