aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2019-05-01 03:49:24 +0100
committerUbitUmarov2019-05-01 03:49:24 +0100
commitea32a73103b3df4b6c5d904ae92e088e0b5bbdc2 (patch)
tree52b540ed95448f0bde2b8eb119f59a212460b795 /OpenSim
parentadd osLocalTeleportAgent(key agent, vector position, vector velocity, vector ... (diff)
downloadopensim-SC-ea32a73103b3df4b6c5d904ae92e088e0b5bbdc2.zip
opensim-SC-ea32a73103b3df4b6c5d904ae92e088e0b5bbdc2.tar.gz
opensim-SC-ea32a73103b3df4b6c5d904ae92e088e0b5bbdc2.tar.bz2
opensim-SC-ea32a73103b3df4b6c5d904ae92e088e0b5bbdc2.tar.xz
osLocalTeleportAgent: no region crossings :( ; check avatar access to target position; flag 8 == force fly; 16 force nofly (both == fly)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs77
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs1
2 files changed, 69 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 56e822a..cd2b9b4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1734,24 +1734,72 @@ namespace OpenSim.Region.Framework.Scenes
1734 1734
1735 public void LocalTeleport(Vector3 newpos, Vector3 newvel, Vector3 newlookat, int flags) 1735 public void LocalTeleport(Vector3 newpos, Vector3 newvel, Vector3 newlookat, int flags)
1736 { 1736 {
1737 if(!CheckLocalTPLandingPoint(ref newpos)) 1737 if (newpos.X <= 0)
1738 return; 1738 {
1739 newpos.X = 0.1f;
1740 if (newvel.X < 0)
1741 newvel.X = 0;
1742 }
1743 else if (newpos.X >= Scene.RegionInfo.RegionSizeX)
1744 {
1745 newpos.X = Scene.RegionInfo.RegionSizeX - 0.1f;
1746 if (newvel.X > 0)
1747 newvel.X = 0;
1748 }
1739 1749
1740 AbsolutePosition = newpos; 1750 if (newpos.Y <= 0)
1751 {
1752 newpos.Y = 0.1f;
1753 if (newvel.Y < 0)
1754 newvel.Y = 0;
1755 }
1756 else if (newpos.Y >= Scene.RegionInfo.RegionSizeY)
1757 {
1758 newpos.Y = Scene.RegionInfo.RegionSizeY - 0.1f;
1759 if (newvel.Y > 0)
1760 newvel.Y = 0;
1761 }
1741 1762
1742 if ((flags & 1) != 0) 1763 string reason;
1764 if (!m_scene.TestLandRestrictions(UUID, out reason, ref newpos.X, ref newpos.Y))
1765 return ;
1766
1767 if (IsSatOnObject)
1768 StandUp();
1769
1770 float localHalfAVHeight = 0.8f;
1771 if (Appearance != null)
1772 localHalfAVHeight = Appearance.AvatarHeight / 2;
1773
1774 float posZLimit = 22;
1775
1776 // TODO: Check other Scene HeightField
1777 posZLimit = (float)Scene.Heightmap[(int)newpos.X, (int)newpos.Y];
1778
1779 posZLimit += localHalfAVHeight + 0.1f;
1780
1781 if ((newpos.Z < posZLimit) && !(Single.IsInfinity(posZLimit) || Single.IsNaN(posZLimit)))
1743 { 1782 {
1744 if (PhysicsActor != null) 1783 newpos.Z = posZLimit;
1745 PhysicsActor.SetMomentum(newvel);
1746 m_velocity = newvel;
1747 } 1784 }
1748 1785
1786 if ((flags & 8) != 0)
1787 Flying = true;
1788 else if ((flags & 16) != 0)
1789 Flying = false;
1790
1791 uint tpflags = (uint)TeleportFlags.ViaLocation;
1792 if(Flying)
1793 tpflags |= (uint)TeleportFlags.IsFlying;
1794
1795 Vector3 lookat = Lookat;
1796
1749 if ((flags & 2) != 0) 1797 if ((flags & 2) != 0)
1750 { 1798 {
1751 newlookat.Z = 0; 1799 newlookat.Z = 0;
1752 newlookat.Normalize(); 1800 newlookat.Normalize();
1753 if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) 1801 if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001)
1754 ControllingClient.SendLocalTeleport(newpos, newlookat, (uint)TeleportFlags.ViaLocation); 1802 lookat = newlookat;
1755 } 1803 }
1756 else if((flags & 4) != 0) 1804 else if((flags & 4) != 0)
1757 { 1805 {
@@ -1762,8 +1810,19 @@ namespace OpenSim.Region.Framework.Scenes
1762 newlookat.Z = 0; 1810 newlookat.Z = 0;
1763 newlookat.Normalize(); 1811 newlookat.Normalize();
1764 if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) 1812 if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001)
1765 ControllingClient.SendLocalTeleport(newpos, newlookat, (uint)TeleportFlags.ViaLocation); 1813 lookat = newlookat;
1814 }
1815
1816 AbsolutePosition = newpos;
1817 ControllingClient.SendLocalTeleport(newpos, lookat, tpflags);
1818
1819 if ((flags & 1) != 0)
1820 {
1821 if (PhysicsActor != null)
1822 PhysicsActor.SetMomentum(newvel);
1823 m_velocity = newvel;
1766 } 1824 }
1825
1767 SendTerseUpdateToAllClients(); 1826 SendTerseUpdateToAllClients();
1768 } 1827 }
1769 1828
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
index cec8b74..b86be0f 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs
@@ -1921,6 +1921,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1921 1921
1922 _position = newPos; 1922 _position = newPos;
1923 m_freemove = false; 1923 m_freemove = false;
1924 _zeroFlag = false;
1924 m_pidControllerActive = true; 1925 m_pidControllerActive = true;
1925 } 1926 }
1926 1927