From 0d2e02efb1da5cba09a8cf306b83e5789529601c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 24 Jan 2012 01:29:50 +0000 Subject: [PATCH] Reverse the spawn point distance vector --- OpenSim/Framework/RegionSettings.cs | 6 +++--- .../CoreModules/World/Estate/EstateManagementModule.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 399c795a7b..9ffde035ab 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -42,7 +42,7 @@ namespace OpenSim.Framework { // The point is an absolute position, so we need the relative // location to the spawn point - Vector3 offset = pos - point; + Vector3 offset = point - pos; Distance = Vector3.Mag(offset); // Next we need to rotate this vector into the spawn point's @@ -58,7 +58,7 @@ namespace OpenSim.Framework Pitch = (float)-Math.Atan2(dir.Z, Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y)); } - public Vector3 GetLocation(Quaternion rot) + public Vector3 GetLocation(Vector3 pos, Quaternion rot) { Quaternion y = Quaternion.CreateFromEulers(0, 0, Yaw); Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0); @@ -69,7 +69,7 @@ namespace OpenSim.Framework rot.W = -rot.W; offset *= rot; - return offset; + return pos + offset; } } diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 1855aead2a..20f3903fdd 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -1309,7 +1309,7 @@ namespace OpenSim.Region.CoreModules.World.Estate foreach (SpawnPoint sp in settings.SpawnPoints()) { - spawnPoints.Add(sp.GetLocation(telehub.GroupRotation)); + spawnPoints.Add(sp.GetLocation(Vector3.Zero, telehub.GroupRotation)); } client.SendTelehubInfo(settings.TelehubObject,