diff options
author | Melanie | 2009-10-02 19:04:46 +0100 |
---|---|---|
committer | Melanie | 2009-10-02 19:04:46 +0100 |
commit | 46955f42608ceb2b76731432f536e04e85521a12 (patch) | |
tree | 37e8591bd95de33ad0c485626c6f40f7d4bd91b5 /OpenSim/Region/Framework/Scenes | |
parent | Revert "* Adding Scale to EntityBase * Fixing the incorrect initialization of... (diff) | |
parent | Added a default for grid services in standalone. (diff) | |
download | opensim-SC-46955f42608ceb2b76731432f536e04e85521a12.zip opensim-SC-46955f42608ceb2b76731432f536e04e85521a12.tar.gz opensim-SC-46955f42608ceb2b76731432f536e04e85521a12.tar.bz2 opensim-SC-46955f42608ceb2b76731432f536e04e85521a12.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | 31 |
3 files changed, 34 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9db2240..c06a58f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3206,9 +3206,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3206 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | 3206 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); |
3207 | if (land != null) | 3207 | if (land != null) |
3208 | { | 3208 | { |
3209 | if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) | 3209 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) |
3210 | { | 3210 | { |
3211 | agent.startpos = land.landData.UserLocation; | 3211 | agent.startpos = land.LandData.UserLocation; |
3212 | } | 3212 | } |
3213 | } | 3213 | } |
3214 | } | 3214 | } |
@@ -3846,13 +3846,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3846 | 3846 | ||
3847 | public LandData GetLandData(float x, float y) | 3847 | public LandData GetLandData(float x, float y) |
3848 | { | 3848 | { |
3849 | return LandChannel.GetLandObject(x, y).landData; | 3849 | return LandChannel.GetLandObject(x, y).LandData; |
3850 | } | 3850 | } |
3851 | 3851 | ||
3852 | public LandData GetLandData(uint x, uint y) | 3852 | public LandData GetLandData(uint x, uint y) |
3853 | { | 3853 | { |
3854 | m_log.DebugFormat("[SCENE]: returning land for {0},{1}", x, y); | 3854 | m_log.DebugFormat("[SCENE]: returning land for {0},{1}", x, y); |
3855 | return LandChannel.GetLandObject((int)x, (int)y).landData; | 3855 | return LandChannel.GetLandObject((int)x, (int)y).LandData; |
3856 | } | 3856 | } |
3857 | 3857 | ||
3858 | 3858 | ||
@@ -3880,14 +3880,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3880 | { | 3880 | { |
3881 | if (parcel != null) | 3881 | if (parcel != null) |
3882 | { | 3882 | { |
3883 | if ((parcel.landData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) | 3883 | if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) |
3884 | { | 3884 | { |
3885 | return true; | 3885 | return true; |
3886 | } | 3886 | } |
3887 | else if ((parcel.landData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) | 3887 | else if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) |
3888 | { | 3888 | { |
3889 | if (part.OwnerID == parcel.landData.OwnerID | 3889 | if (part.OwnerID == parcel.LandData.OwnerID |
3890 | || (parcel.landData.IsGroupOwned && part.GroupID == parcel.landData.GroupID) | 3890 | || (parcel.LandData.IsGroupOwned && part.GroupID == parcel.LandData.GroupID) |
3891 | || Permissions.IsGod(part.OwnerID)) | 3891 | || Permissions.IsGod(part.OwnerID)) |
3892 | { | 3892 | { |
3893 | return true; | 3893 | return true; |
@@ -3899,7 +3899,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3899 | } | 3899 | } |
3900 | else | 3900 | else |
3901 | { | 3901 | { |
3902 | if (part.OwnerID == parcel.landData.OwnerID) | 3902 | if (part.OwnerID == parcel.LandData.OwnerID) |
3903 | { | 3903 | { |
3904 | return true; | 3904 | return true; |
3905 | } | 3905 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9f44f92..be8a6c9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1327,15 +1327,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1327 | ILandObject parcel = m_scene.LandChannel.GetLandObject( | 1327 | ILandObject parcel = m_scene.LandChannel.GetLandObject( |
1328 | m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); | 1328 | m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); |
1329 | 1329 | ||
1330 | if (parcel != null && parcel.landData != null && | 1330 | if (parcel != null && parcel.LandData != null && |
1331 | parcel.landData.OtherCleanTime != 0) | 1331 | parcel.LandData.OtherCleanTime != 0) |
1332 | { | 1332 | { |
1333 | if (parcel.landData.OwnerID != OwnerID && | 1333 | if (parcel.LandData.OwnerID != OwnerID && |
1334 | (parcel.landData.GroupID != GroupID || | 1334 | (parcel.LandData.GroupID != GroupID || |
1335 | parcel.landData.GroupID == UUID.Zero)) | 1335 | parcel.LandData.GroupID == UUID.Zero)) |
1336 | { | 1336 | { |
1337 | if ((DateTime.Now - RootPart.Rezzed).TotalMinutes > | 1337 | if ((DateTime.Now - RootPart.Rezzed).TotalMinutes > |
1338 | parcel.landData.OtherCleanTime) | 1338 | parcel.LandData.OtherCleanTime) |
1339 | { | 1339 | { |
1340 | DetachFromBackup(); | 1340 | DetachFromBackup(); |
1341 | m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); | 1341 | m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index b3d10df..709cca2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs | |||
@@ -94,10 +94,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
94 | } | 94 | } |
95 | 95 | ||
96 | // root part should have no offset position or rotation | 96 | // root part should have no offset position or rotation |
97 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); | 97 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, |
98 | "root part should have no offset position or rotation"); | ||
98 | 99 | ||
99 | // offset position should be root part position - part2.absolute position. | 100 | // offset position should be root part position - part2.absolute position. |
100 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); | 101 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10), |
102 | "offset position should be root part position - part2.absolute position."); | ||
101 | 103 | ||
102 | float roll = 0; | 104 | float roll = 0; |
103 | float pitch = 0; | 105 | float pitch = 0; |
@@ -116,7 +118,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
116 | if (debugtest) | 118 | if (debugtest) |
117 | m_log.Debug(rotEuler2); | 119 | m_log.Debug(rotEuler2); |
118 | 120 | ||
119 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); | 121 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f), |
122 | "Not exactly sure what this is asserting..."); | ||
120 | 123 | ||
121 | // Delink part 2 | 124 | // Delink part 2 |
122 | grp1.DelinkFromGroup(part2.LocalId); | 125 | grp1.DelinkFromGroup(part2.LocalId); |
@@ -125,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
125 | m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); | 128 | m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); |
126 | 129 | ||
127 | Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); | 130 | Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); |
128 | Assert.That(part2.AbsolutePosition == Vector3.Zero); | 131 | Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); |
129 | } | 132 | } |
130 | 133 | ||
131 | [Test] | 134 | [Test] |
@@ -175,10 +178,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
175 | grp3.LinkToGroup(grp4); | 178 | grp3.LinkToGroup(grp4); |
176 | 179 | ||
177 | // At this point we should have 4 parts total in two groups. | 180 | // At this point we should have 4 parts total in two groups. |
178 | Assert.That(grp1.Children.Count == 2); | 181 | Assert.That(grp1.Children.Count == 2, "Group1 children count should be 2"); |
179 | Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); | 182 | Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); |
180 | Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); | 183 | Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); |
181 | Assert.That(grp3.Children.Count == 2); | 184 | Assert.That(grp3.Children.Count == 2, "Group3 children count should be 2"); |
182 | Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); | 185 | Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); |
183 | Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); | 186 | Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); |
184 | 187 | ||
@@ -201,10 +204,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
201 | grp3.RootPart.UpdateFlag = 0; | 204 | grp3.RootPart.UpdateFlag = 0; |
202 | 205 | ||
203 | // root part should have no offset position or rotation | 206 | // root part should have no offset position or rotation |
204 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); | 207 | Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, |
208 | "root part should have no offset position or rotation (again)"); | ||
205 | 209 | ||
206 | // offset position should be root part position - part2.absolute position. | 210 | // offset position should be root part position - part2.absolute position. |
207 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); | 211 | Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10), |
212 | "offset position should be root part position - part2.absolute position (again)"); | ||
208 | 213 | ||
209 | float roll = 0; | 214 | float roll = 0; |
210 | float pitch = 0; | 215 | float pitch = 0; |
@@ -223,7 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
223 | if (debugtest) | 228 | if (debugtest) |
224 | m_log.Debug(rotEuler2); | 229 | m_log.Debug(rotEuler2); |
225 | 230 | ||
226 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); | 231 | Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f), |
232 | "Not sure what this assertion is all about..."); | ||
227 | 233 | ||
228 | // Now we're linking the first group to the third group. This will make the first group child parts of the third one. | 234 | // Now we're linking the first group to the third group. This will make the first group child parts of the third one. |
229 | grp3.LinkToGroup(grp1); | 235 | grp3.LinkToGroup(grp1); |
@@ -246,13 +252,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
246 | m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); | 252 | m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); |
247 | } | 253 | } |
248 | 254 | ||
249 | Assert.That(part2.AbsolutePosition == Vector3.Zero); | 255 | Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1"); |
250 | Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20)); | 256 | Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2"); |
251 | Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); | 257 | Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); |
252 | Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) | 258 | Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) |
253 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) | 259 | && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) |
254 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) | 260 | && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) |
255 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); | 261 | && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), |
262 | "Badness 3"); | ||
256 | } | 263 | } |
257 | } | 264 | } |
258 | } | 265 | } |