diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 71 |
1 files changed, 34 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f59518b..b65d168 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -298,45 +298,42 @@ namespace OpenSim.Region.Framework.Scenes | |||
298 | protected internal bool AddRestoredSceneObject( | 298 | protected internal bool AddRestoredSceneObject( |
299 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) | 299 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) |
300 | { | 300 | { |
301 | if (!m_parentScene.CombineRegions) | 301 | // temporary checks to remove after varsize suport |
302 | { | 302 | float regionSizeX = m_parentScene.RegionInfo.RegionSizeX; |
303 | // temporary checks to remove after varsize suport | 303 | if (regionSizeX == 0) |
304 | float regionSizeX = m_parentScene.RegionInfo.RegionSizeX; | 304 | regionSizeX = Constants.RegionSize; |
305 | if (regionSizeX == 0) | 305 | float regionSizeY = m_parentScene.RegionInfo.RegionSizeY; |
306 | regionSizeX = Constants.RegionSize; | 306 | if (regionSizeY == 0) |
307 | float regionSizeY = m_parentScene.RegionInfo.RegionSizeY; | 307 | regionSizeY = Constants.RegionSize; |
308 | if (regionSizeY == 0) | 308 | |
309 | regionSizeY = Constants.RegionSize; | 309 | // KF: Check for out-of-region, move inside and make static. |
310 | 310 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | |
311 | // KF: Check for out-of-region, move inside and make static. | 311 | sceneObject.RootPart.GroupPosition.Y, |
312 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | 312 | sceneObject.RootPart.GroupPosition.Z); |
313 | sceneObject.RootPart.GroupPosition.Y, | 313 | bool clampZ = m_parentScene.ClampNegativeZ; |
314 | sceneObject.RootPart.GroupPosition.Z); | 314 | |
315 | bool clampZ = m_parentScene.ClampNegativeZ; | 315 | if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || (npos.Z < 0.0 && clampZ) || |
316 | 316 | npos.X > regionSizeX || | |
317 | if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || (npos.Z < 0.0 && clampZ) || | 317 | npos.Y > regionSizeY)) |
318 | npos.X > regionSizeX || | 318 | { |
319 | npos.Y > regionSizeY)) | 319 | if (npos.X < 0.0) npos.X = 1.0f; |
320 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
321 | if (npos.Z < 0.0 && clampZ) npos.Z = 0.0f; | ||
322 | if (npos.X > regionSizeX) npos.X = regionSizeX - 1.0f; | ||
323 | if (npos.Y > regionSizeY) npos.Y = regionSizeY - 1.0f; | ||
324 | |||
325 | SceneObjectPart rootpart = sceneObject.RootPart; | ||
326 | rootpart.GroupPosition = npos; | ||
327 | |||
328 | foreach (SceneObjectPart part in sceneObject.Parts) | ||
320 | { | 329 | { |
321 | if (npos.X < 0.0) npos.X = 1.0f; | 330 | if (part == rootpart) |
322 | if (npos.Y < 0.0) npos.Y = 1.0f; | 331 | continue; |
323 | if (npos.Z < 0.0 && clampZ) npos.Z = 0.0f; | 332 | part.GroupPosition = npos; |
324 | if (npos.X > regionSizeX) npos.X = regionSizeX - 1.0f; | ||
325 | if (npos.Y > regionSizeY) npos.Y = regionSizeY - 1.0f; | ||
326 | |||
327 | SceneObjectPart rootpart = sceneObject.RootPart; | ||
328 | rootpart.GroupPosition = npos; | ||
329 | |||
330 | foreach (SceneObjectPart part in sceneObject.Parts) | ||
331 | { | ||
332 | if (part == rootpart) | ||
333 | continue; | ||
334 | part.GroupPosition = npos; | ||
335 | } | ||
336 | rootpart.Velocity = Vector3.Zero; | ||
337 | rootpart.AngularVelocity = Vector3.Zero; | ||
338 | rootpart.Acceleration = Vector3.Zero; | ||
339 | } | 333 | } |
334 | rootpart.Velocity = Vector3.Zero; | ||
335 | rootpart.AngularVelocity = Vector3.Zero; | ||
336 | rootpart.Acceleration = Vector3.Zero; | ||
340 | } | 337 | } |
341 | 338 | ||
342 | bool ret = AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); | 339 | bool ret = AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); |