diff options
author | Kitto Flora | 2009-12-24 19:19:44 -0500 |
---|---|---|
committer | Kitto Flora | 2009-12-24 19:19:44 -0500 |
commit | e7439efc74a1cc0daedc51eb25ae66cd03db70b5 (patch) | |
tree | 47dcf22626bca7662575e3ab6c6680d41b812172 /OpenSim/Region/Framework/Scenes/SceneGraph.cs | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-e7439efc74a1cc0daedc51eb25ae66cd03db70b5.zip opensim-SC_OLD-e7439efc74a1cc0daedc51eb25ae66cd03db70b5.tar.gz opensim-SC_OLD-e7439efc74a1cc0daedc51eb25ae66cd03db70b5.tar.bz2 opensim-SC_OLD-e7439efc74a1cc0daedc51eb25ae66cd03db70b5.tar.xz |
Recover out-of-region objects during db load.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index b0fb8b3..998d598 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -222,6 +222,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
222 | protected internal bool AddRestoredSceneObject( | 222 | protected internal bool AddRestoredSceneObject( |
223 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 223 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
224 | { | 224 | { |
225 | // KF: Check for out-of-region, move inside and make static. | ||
226 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | ||
227 | sceneObject.RootPart.GroupPosition.Y, | ||
228 | sceneObject.RootPart.GroupPosition.Z); | ||
229 | if (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 || | ||
230 | npos.X > Constants.RegionSize || | ||
231 | npos.Y > Constants.RegionSize) | ||
232 | { | ||
233 | if (npos.X < 0.0) npos.X = 1.0f; | ||
234 | if (npos.Y < 0.0) npos.Y = 1.0f; | ||
235 | if (npos.Z < 0.0) npos.Z = 0.0f; | ||
236 | if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f; | ||
237 | if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f; | ||
238 | |||
239 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
240 | { | ||
241 | part.GroupPosition = npos; | ||
242 | } | ||
243 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
244 | sceneObject.RootPart.AngularVelocity = Vector3.Zero; | ||
245 | sceneObject.RootPart.Acceleration = Vector3.Zero; | ||
246 | sceneObject.RootPart.Velocity = Vector3.Zero; | ||
247 | } | ||
248 | |||
225 | if (!alreadyPersisted) | 249 | if (!alreadyPersisted) |
226 | { | 250 | { |
227 | sceneObject.ForceInventoryPersistence(); | 251 | sceneObject.ForceInventoryPersistence(); |