diff options
author | UbitUmarov | 2019-05-01 01:35:45 +0100 |
---|---|---|
committer | UbitUmarov | 2019-05-01 01:36:10 +0100 |
commit | 11c945a5651d8e55c6948df9a026ff3d85566b51 (patch) | |
tree | 2d44f7bbf0740d55b7b62743ad0efd292f46e06a /OpenSim/Region/Framework | |
parent | missing files... (diff) | |
download | opensim-SC-11c945a5651d8e55c6948df9a026ff3d85566b51.zip opensim-SC-11c945a5651d8e55c6948df9a026ff3d85566b51.tar.gz opensim-SC-11c945a5651d8e55c6948df9a026ff3d85566b51.tar.bz2 opensim-SC-11c945a5651d8e55c6948df9a026ff3d85566b51.tar.xz |
add osLocalTeleportAgent(key agent, vector position, vector velocity, vector lookat, LSL_Integer flags). Velocity only works with ubOde but still not good. flags = bit field: 1 use velocity, 2 use lookat, 4 rotate avatar look in current velocity direction (ignored if 2 ie flag = 7 is same as 3). This bypasses most the unnecessary logic of osTeleportAgent, having usage same permissions. It may do region crossings(?). Experimental stage, feedbakc expected ;)
Diffstat (limited to 'OpenSim/Region/Framework')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 49 |
2 files changed, 37 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2fa92b3..073d11f 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4795,6 +4795,20 @@ Label_GroupsDone: | |||
4795 | return true; | 4795 | return true; |
4796 | } | 4796 | } |
4797 | 4797 | ||
4798 | |||
4799 | /// <summary> | ||
4800 | /// Tries to teleport agent within region. | ||
4801 | /// </summary> | ||
4802 | /// <param name="remoteClient"></param> | ||
4803 | /// <param name="position"></param> | ||
4804 | /// <param name="lookAt"></param> | ||
4805 | /// <param name="teleportFlags"></param> | ||
4806 | public void RequestLocalTeleport(ScenePresence sp, Vector3 position, Vector3 vel, | ||
4807 | Vector3 lookat, int flags) | ||
4808 | { | ||
4809 | sp.LocalTeleport(position, vel, lookat, flags); | ||
4810 | } | ||
4811 | |||
4798 | /// <summary> | 4812 | /// <summary> |
4799 | /// Tries to teleport agent to another region. | 4813 | /// Tries to teleport agent to another region. |
4800 | /// </summary> | 4814 | /// </summary> |
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 | } |