diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b341d48..56e822a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1688,10 +1688,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1688 | // } | 1688 | // } |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | /// <summary> | ||
1692 | /// Do not call this directly. Call Scene.RequestTeleportLocation() instead. | ||
1693 | /// </summary> | ||
1694 | /// <param name="pos"></param> | ||
1695 | public void Teleport(Vector3 pos) | 1691 | public void Teleport(Vector3 pos) |
1696 | { | 1692 | { |
1697 | TeleportWithMomentum(pos, Vector3.Zero); | 1693 | TeleportWithMomentum(pos, Vector3.Zero); |
@@ -1736,36 +1732,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
1736 | SendTerseUpdateToAllClients(); | 1732 | SendTerseUpdateToAllClients(); |
1737 | } | 1733 | } |
1738 | 1734 | ||
1739 | public void avnLocalTeleport(Vector3 newpos, Vector3? newvel, bool rotateToVelXY) | 1735 | public void LocalTeleport(Vector3 newpos, Vector3 newvel, Vector3 newlookat, int flags) |
1740 | { | 1736 | { |
1741 | if(!CheckLocalTPLandingPoint(ref newpos)) | 1737 | if(!CheckLocalTPLandingPoint(ref newpos)) |
1742 | return; | 1738 | return; |
1743 | 1739 | ||
1744 | AbsolutePosition = newpos; | 1740 | AbsolutePosition = newpos; |
1745 | 1741 | ||
1746 | if (newvel.HasValue) | 1742 | if ((flags & 1) != 0) |
1747 | { | 1743 | { |
1748 | if ((Vector3)newvel == Vector3.Zero) | 1744 | if (PhysicsActor != null) |
1749 | { | 1745 | PhysicsActor.SetMomentum(newvel); |
1750 | if (PhysicsActor != null) | 1746 | m_velocity = newvel; |
1751 | PhysicsActor.SetMomentum(Vector3.Zero); | 1747 | } |
1752 | m_velocity = Vector3.Zero; | ||
1753 | } | ||
1754 | else | ||
1755 | { | ||
1756 | if (PhysicsActor != null) | ||
1757 | PhysicsActor.SetMomentum((Vector3)newvel); | ||
1758 | m_velocity = (Vector3)newvel; | ||
1759 | 1748 | ||
1760 | if (rotateToVelXY) | 1749 | if ((flags & 2) != 0) |
1761 | { | 1750 | { |
1762 | Vector3 lookAt = (Vector3)newvel; | 1751 | newlookat.Z = 0; |
1763 | lookAt.Z = 0; | 1752 | newlookat.Normalize(); |
1764 | lookAt.Normalize(); | 1753 | if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) |
1765 | ControllingClient.SendLocalTeleport(newpos, lookAt, (uint)TeleportFlags.ViaLocation); | 1754 | ControllingClient.SendLocalTeleport(newpos, newlookat, (uint)TeleportFlags.ViaLocation); |
1766 | return; | 1755 | } |
1767 | } | 1756 | else if((flags & 4) != 0) |
1768 | } | 1757 | { |
1758 | if((flags & 1) != 0) | ||
1759 | newlookat = newvel; | ||
1760 | else | ||
1761 | newlookat = m_velocity; | ||
1762 | newlookat.Z = 0; | ||
1763 | newlookat.Normalize(); | ||
1764 | if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) | ||
1765 | ControllingClient.SendLocalTeleport(newpos, newlookat, (uint)TeleportFlags.ViaLocation); | ||
1769 | } | 1766 | } |
1770 | SendTerseUpdateToAllClients(); | 1767 | SendTerseUpdateToAllClients(); |
1771 | } | 1768 | } |