Reverse the spawn point distance vector
parent
c0e1784e86
commit
0d2e02efb1
|
@ -42,7 +42,7 @@ namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
// The point is an absolute position, so we need the relative
|
// The point is an absolute position, so we need the relative
|
||||||
// location to the spawn point
|
// location to the spawn point
|
||||||
Vector3 offset = pos - point;
|
Vector3 offset = point - pos;
|
||||||
Distance = Vector3.Mag(offset);
|
Distance = Vector3.Mag(offset);
|
||||||
|
|
||||||
// Next we need to rotate this vector into the spawn point's
|
// 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));
|
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 y = Quaternion.CreateFromEulers(0, 0, Yaw);
|
||||||
Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0);
|
Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0);
|
||||||
|
@ -69,7 +69,7 @@ namespace OpenSim.Framework
|
||||||
rot.W = -rot.W;
|
rot.W = -rot.W;
|
||||||
offset *= rot;
|
offset *= rot;
|
||||||
|
|
||||||
return offset;
|
return pos + offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1309,7 +1309,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
|
|
||||||
foreach (SpawnPoint sp in settings.SpawnPoints())
|
foreach (SpawnPoint sp in settings.SpawnPoints())
|
||||||
{
|
{
|
||||||
spawnPoints.Add(sp.GetLocation(telehub.GroupRotation));
|
spawnPoints.Add(sp.GetLocation(Vector3.Zero, telehub.GroupRotation));
|
||||||
}
|
}
|
||||||
|
|
||||||
client.SendTelehubInfo(settings.TelehubObject,
|
client.SendTelehubInfo(settings.TelehubObject,
|
||||||
|
|
Loading…
Reference in New Issue