diff options
author | Adam Frisby | 2009-05-12 21:21:33 +0000 |
---|---|---|
committer | Adam Frisby | 2009-05-12 21:21:33 +0000 |
commit | 3a28f748d5cb586a5401b9b4d1f2f108af79ace1 (patch) | |
tree | 30604d290d5bb0389db40202b0793a9cda586820 | |
parent | * EventManager's OnNewPresence event now fires correctly again. (diff) | |
download | opensim-SC_OLD-3a28f748d5cb586a5401b9b4d1f2f108af79ace1.zip opensim-SC_OLD-3a28f748d5cb586a5401b9b4d1f2f108af79ace1.tar.gz opensim-SC_OLD-3a28f748d5cb586a5401b9b4d1f2f108af79ace1.tar.bz2 opensim-SC_OLD-3a28f748d5cb586a5401b9b4d1f2f108af79ace1.tar.xz |
* Adds ScenePresence.TeleportWithMomentum - same as .Teleport, but preserves velocity.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8fd4b47..8950942 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1015,6 +1015,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1015 | SendTerseUpdateToAllClients(); | 1015 | SendTerseUpdateToAllClients(); |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | public void TeleportWithMomentum(Vector3 pos) | ||
1019 | { | ||
1020 | bool isFlying = false; | ||
1021 | if (m_physicsActor != null) | ||
1022 | isFlying = m_physicsActor.Flying; | ||
1023 | |||
1024 | RemoveFromPhysicalScene(); | ||
1025 | AbsolutePosition = pos; | ||
1026 | AddToPhysicalScene(isFlying); | ||
1027 | if (m_appearance != null) | ||
1028 | { | ||
1029 | if (m_appearance.AvatarHeight > 0) | ||
1030 | SetHeight(m_appearance.AvatarHeight); | ||
1031 | } | ||
1032 | |||
1033 | SendTerseUpdateToAllClients(); | ||
1034 | } | ||
1035 | |||
1018 | /// <summary> | 1036 | /// <summary> |
1019 | /// | 1037 | /// |
1020 | /// </summary> | 1038 | /// </summary> |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index 0f2076e..8fed89c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
61 | public Vector3 WorldPosition | 61 | public Vector3 WorldPosition |
62 | { | 62 | { |
63 | get { return GetSP().AbsolutePosition; } | 63 | get { return GetSP().AbsolutePosition; } |
64 | set { GetSP().AbsolutePosition = value; } | 64 | set { GetSP().TeleportWithMomentum(value); } |
65 | } | 65 | } |
66 | } | 66 | } |
67 | } | 67 | } |