aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2012-01-24 01:29:50 +0000
committerMelanie2012-01-24 01:29:50 +0000
commit696fbdfa24595fef5c26f5d3a297465ff765058b (patch)
treed2afea575be100d40861dca3d8c00167225ab4bf /OpenSim
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-696fbdfa24595fef5c26f5d3a297465ff765058b.zip
opensim-SC_OLD-696fbdfa24595fef5c26f5d3a297465ff765058b.tar.gz
opensim-SC_OLD-696fbdfa24595fef5c26f5d3a297465ff765058b.tar.bz2
opensim-SC_OLD-696fbdfa24595fef5c26f5d3a297465ff765058b.tar.xz
Reverse the spawn point distance vector
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/RegionSettings.cs6
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs2
2 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs
index f392889..8322cd6 100644
--- a/OpenSim/Framework/RegionSettings.cs
+++ b/OpenSim/Framework/RegionSettings.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Framework
42 { 42 {
43 // The point is an absolute position, so we need the relative 43 // The point is an absolute position, so we need the relative
44 // location to the spawn point 44 // location to the spawn point
45 Vector3 offset = pos - point; 45 Vector3 offset = point - pos;
46 Distance = Vector3.Mag(offset); 46 Distance = Vector3.Mag(offset);
47 47
48 // Next we need to rotate this vector into the spawn point's 48 // Next we need to rotate this vector into the spawn point's
@@ -58,7 +58,7 @@ namespace OpenSim.Framework
58 Pitch = (float)-Math.Atan2(dir.Z, Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y)); 58 Pitch = (float)-Math.Atan2(dir.Z, Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y));
59 } 59 }
60 60
61 public Vector3 GetLocation(Quaternion rot) 61 public Vector3 GetLocation(Vector3 pos, Quaternion rot)
62 { 62 {
63 Quaternion y = Quaternion.CreateFromEulers(0, 0, Yaw); 63 Quaternion y = Quaternion.CreateFromEulers(0, 0, Yaw);
64 Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0); 64 Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0);
@@ -69,7 +69,7 @@ namespace OpenSim.Framework
69 rot.W = -rot.W; 69 rot.W = -rot.W;
70 offset *= rot; 70 offset *= rot;
71 71
72 return offset; 72 return pos + offset;
73 } 73 }
74 } 74 }
75 75
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index acd22e9..a8e943a 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -1358,7 +1358,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
1358 1358
1359 foreach (SpawnPoint sp in settings.SpawnPoints()) 1359 foreach (SpawnPoint sp in settings.SpawnPoints())
1360 { 1360 {
1361 spawnPoints.Add(sp.GetLocation(telehub.GroupRotation)); 1361 spawnPoints.Add(sp.GetLocation(Vector3.Zero, telehub.GroupRotation));
1362 } 1362 }
1363 1363
1364 client.SendTelehubInfo(settings.TelehubObject, 1364 client.SendTelehubInfo(settings.TelehubObject,