diff options
author | Melanie | 2012-04-17 01:54:54 +0100 |
---|---|---|
committer | Melanie | 2012-04-17 01:54:54 +0100 |
commit | 74aa8eee1255d457d0c865682a7c5466ae8d640e (patch) | |
tree | d7fed81841ad48e09836ee3582b7161921339f9e /OpenSim/Region/Framework | |
parent | Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into ... (diff) | |
parent | Add test TestGetChildPartPosition() (diff) | |
download | opensim-SC_OLD-74aa8eee1255d457d0c865682a7c5466ae8d640e.zip opensim-SC_OLD-74aa8eee1255d457d0c865682a7c5466ae8d640e.tar.gz opensim-SC_OLD-74aa8eee1255d457d0c865682a7c5466ae8d640e.tar.bz2 opensim-SC_OLD-74aa8eee1255d457d0c865682a7c5466ae8d640e.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | 28 |
2 files changed, 31 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7a634c4..292dbdc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3946,7 +3946,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3946 | land.LandData.UserLocation != Vector3.Zero && | 3946 | land.LandData.UserLocation != Vector3.Zero && |
3947 | land.LandData.OwnerID != m_uuid && | 3947 | land.LandData.OwnerID != m_uuid && |
3948 | (!m_scene.Permissions.IsGod(m_uuid)) && | 3948 | (!m_scene.Permissions.IsGod(m_uuid)) && |
3949 | (!m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid))) | 3949 | (!m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid))) |
3950 | { | 3950 | { |
3951 | float curr = Vector3.Distance(AbsolutePosition, pos); | 3951 | float curr = Vector3.Distance(AbsolutePosition, pos); |
3952 | if (Vector3.Distance(land.LandData.UserLocation, pos) < curr) | 3952 | if (Vector3.Distance(land.LandData.UserLocation, pos) < curr) |
@@ -3966,7 +3966,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3966 | { | 3966 | { |
3967 | if (GodLevel < 200 && | 3967 | if (GodLevel < 200 && |
3968 | ((!m_scene.Permissions.IsGod(m_uuid) && | 3968 | ((!m_scene.Permissions.IsGod(m_uuid) && |
3969 | !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid)) || | 3969 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || |
3970 | (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || | 3970 | (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || |
3971 | (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)) | 3971 | (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)) |
3972 | { | 3972 | { |
@@ -4040,7 +4040,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4040 | GodLevel < 200 && | 4040 | GodLevel < 200 && |
4041 | ((land.LandData.OwnerID != m_uuid && | 4041 | ((land.LandData.OwnerID != m_uuid && |
4042 | !m_scene.Permissions.IsGod(m_uuid) && | 4042 | !m_scene.Permissions.IsGod(m_uuid) && |
4043 | !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid)) || | 4043 | !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || |
4044 | (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || | 4044 | (m_teleportFlags & TeleportFlags.ViaLocation) != 0 || |
4045 | (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)) | 4045 | (m_teleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0)) |
4046 | { | 4046 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs index 7a3b362..fffa3bd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs | |||
@@ -86,5 +86,33 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
86 | Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition)); | 86 | Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition)); |
87 | Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); | 87 | Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); |
88 | } | 88 | } |
89 | |||
90 | [Test] | ||
91 | public void TestGetChildPartPosition() | ||
92 | { | ||
93 | TestHelpers.InMethod(); | ||
94 | |||
95 | Vector3 rootPartPosition = new Vector3(10, 20, 30); | ||
96 | Vector3 childOffsetPosition = new Vector3(2, 3, 4); | ||
97 | |||
98 | SceneObjectGroup so | ||
99 | = SceneHelpers.CreateSceneObject(2, m_ownerId, "obj1", 0x10); | ||
100 | so.AbsolutePosition = rootPartPosition; | ||
101 | so.Parts[1].OffsetPosition = childOffsetPosition; | ||
102 | |||
103 | m_scene.AddNewSceneObject(so, false); | ||
104 | |||
105 | // Calculate child absolute position. | ||
106 | Vector3 childPosition = new Vector3(rootPartPosition + childOffsetPosition); | ||
107 | |||
108 | SceneObjectPart childPart = so.Parts[1]; | ||
109 | Assert.That(childPart.AbsolutePosition, Is.EqualTo(childPosition)); | ||
110 | Assert.That(childPart.GroupPosition, Is.EqualTo(rootPartPosition)); | ||
111 | Assert.That(childPart.GetWorldPosition(), Is.EqualTo(childPosition)); | ||
112 | Assert.That(childPart.RelativePosition, Is.EqualTo(childOffsetPosition)); | ||
113 | Assert.That(childPart.OffsetPosition, Is.EqualTo(childOffsetPosition)); | ||
114 | |||
115 | // TODO: Write test for child part position after rotation. | ||
116 | } | ||
89 | } | 117 | } |
90 | } \ No newline at end of file | 118 | } \ No newline at end of file |