diff options
author | Melanie | 2011-11-05 11:05:32 +0000 |
---|---|---|
committer | Melanie | 2011-11-05 11:05:32 +0000 |
commit | 2cf6172689fd67d969c368fe397700ded23572fd (patch) | |
tree | 252883c9250264cc914a8e41935e47a03ae50fb1 /OpenSim/Region | |
parent | Merge branch 'master' into bigmerge (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-2cf6172689fd67d969c368fe397700ded23572fd.zip opensim-SC-2cf6172689fd67d969c368fe397700ded23572fd.tar.gz opensim-SC-2cf6172689fd67d969c368fe397700ded23572fd.tar.bz2 opensim-SC-2cf6172689fd67d969c368fe397700ded23572fd.tar.xz |
Merge branch 'master' into bigmerge
Conflicts:
OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to '')
6 files changed, 55 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index c8f28c7..e4bee0c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1129,13 +1129,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1129 | public Quaternion SitTargetOrientation | 1129 | public Quaternion SitTargetOrientation |
1130 | { | 1130 | { |
1131 | get { return m_sitTargetOrientation; } | 1131 | get { return m_sitTargetOrientation; } |
1132 | set { m_sitTargetOrientation = value; } | 1132 | set |
1133 | { | ||
1134 | m_sitTargetOrientation = value; | ||
1135 | // m_log.DebugFormat("[SCENE OBJECT PART]: Set sit target orientation {0} for {1} {2}", m_sitTargetOrientation, Name, LocalId); | ||
1136 | } | ||
1133 | } | 1137 | } |
1134 | 1138 | ||
1135 | public Vector3 SitTargetPosition | 1139 | public Vector3 SitTargetPosition |
1136 | { | 1140 | { |
1137 | get { return m_sitTargetPosition; } | 1141 | get { return m_sitTargetPosition; } |
1138 | set { m_sitTargetPosition = value; } | 1142 | set |
1143 | { | ||
1144 | m_sitTargetPosition = value; | ||
1145 | // m_log.DebugFormat("[SCENE OBJECT PART]: Set sit target position to {0} for {1} {2}", m_sitTargetPosition, Name, LocalId); | ||
1146 | } | ||
1139 | } | 1147 | } |
1140 | 1148 | ||
1141 | // This sort of sucks, but I'm adding these in to make some of | 1149 | // This sort of sucks, but I'm adding these in to make some of |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1c892fe..b95d613 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
92 | /// </summary> | 92 | /// </summary> |
93 | // private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f); | 93 | // private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f); |
94 | // Value revised by KF 091121 by comparison with SL. | 94 | // Value revised by KF 091121 by comparison with SL. |
95 | private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f); | 95 | public static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f); |
96 | 96 | ||
97 | /// <summary> | 97 | /// <summary> |
98 | /// Movement updates for agents in neighboring regions are sent directly to clients. | 98 | /// Movement updates for agents in neighboring regions are sent directly to clients. |
@@ -2617,7 +2617,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2617 | RemoveFromPhysicalScene(); | 2617 | RemoveFromPhysicalScene(); |
2618 | Animator.TrySetMovementAnimation(sitAnimation); | 2618 | Animator.TrySetMovementAnimation(sitAnimation); |
2619 | SendAvatarDataToAllAgents(); | 2619 | SendAvatarDataToAllAgents(); |
2620 | //SendTerseUpdateToAllClients(); | ||
2621 | } | 2620 | } |
2622 | 2621 | ||
2623 | public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal) | 2622 | public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal) |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 10181aa..56ff367 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -208,7 +208,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
208 | ScenePresence sp; | 208 | ScenePresence sp; |
209 | scene.TryGetScenePresence(agentID, out sp); | 209 | scene.TryGetScenePresence(agentID, out sp); |
210 | sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); | 210 | sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero); |
211 | sp.HandleAgentSit(m_avatars[agentID], agentID); | 211 | // sp.HandleAgentSit(m_avatars[agentID], agentID); |
212 | 212 | ||
213 | return true; | 213 | return true; |
214 | } | 214 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 174d74c..d2b79f7 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
231 | } | 231 | } |
232 | 232 | ||
233 | [Test] | 233 | [Test] |
234 | public void TestSitAndStand() | 234 | public void TestSitAndStandWithSitTarget() |
235 | { | 235 | { |
236 | TestHelpers.InMethod(); | 236 | TestHelpers.InMethod(); |
237 | // log4net.Config.XmlConfigurator.Configure(); | 237 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -245,12 +245,49 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
245 | ScenePresence npc = scene.GetScenePresence(npcId); | 245 | ScenePresence npc = scene.GetScenePresence(npcId); |
246 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | 246 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); |
247 | 247 | ||
248 | // We must have a non Vector3.Zero sit target position otherwise part.SitTargetAvatar doesn't get set! | ||
249 | part.SitTargetPosition = new Vector3(0, 0, 1); | 248 | part.SitTargetPosition = new Vector3(0, 0, 1); |
250 | npcModule.Sit(npc.UUID, part.UUID, scene); | 249 | npcModule.Sit(npc.UUID, part.UUID, scene); |
251 | 250 | ||
252 | Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId)); | 251 | Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId)); |
253 | Assert.That(npc.ParentID, Is.EqualTo(part.LocalId)); | 252 | Assert.That(npc.ParentID, Is.EqualTo(part.LocalId)); |
253 | Assert.That( | ||
254 | npc.AbsolutePosition, | ||
255 | Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT)); | ||
256 | |||
257 | npcModule.Stand(npc.UUID, scene); | ||
258 | |||
259 | Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero)); | ||
260 | Assert.That(npc.ParentID, Is.EqualTo(0)); | ||
261 | } | ||
262 | |||
263 | [Test] | ||
264 | public void TestSitAndStandWithNoSitTarget() | ||
265 | { | ||
266 | TestHelpers.InMethod(); | ||
267 | // log4net.Config.XmlConfigurator.Configure(); | ||
268 | |||
269 | ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); | ||
270 | |||
271 | // FIXME: To get this to work for now, we are going to place the npc right next to the target so that | ||
272 | // the autopilot doesn't trigger | ||
273 | Vector3 startPos = new Vector3(1, 1, 1); | ||
274 | |||
275 | INPCModule npcModule = scene.RequestModuleInterface<INPCModule>(); | ||
276 | UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance); | ||
277 | |||
278 | ScenePresence npc = scene.GetScenePresence(npcId); | ||
279 | SceneObjectPart part = SceneHelpers.AddSceneObject(scene); | ||
280 | |||
281 | npcModule.Sit(npc.UUID, part.UUID, scene); | ||
282 | |||
283 | Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero)); | ||
284 | Assert.That(npc.ParentID, Is.EqualTo(part.LocalId)); | ||
285 | |||
286 | // FIXME: This is different for live avatars - z position is adjusted. This is half the height of the | ||
287 | // default avatar. | ||
288 | Assert.That( | ||
289 | npc.AbsolutePosition, | ||
290 | Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, 0.8857438f))); | ||
254 | 291 | ||
255 | npcModule.Stand(npc.UUID, scene); | 292 | npcModule.Stand(npc.UUID, scene); |
256 | 293 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 19d87c2..3630510 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -1269,7 +1269,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1269 | // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force. | 1269 | // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force. |
1270 | doForce(m_taintForce); | 1270 | doForce(m_taintForce); |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | m_taintForce = Vector3.Zero; | 1273 | m_taintForce = Vector3.Zero; |
1274 | } | 1274 | } |
1275 | 1275 | ||
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 6e34811..ffd6dc0 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -2250,7 +2250,10 @@ Console.WriteLine(" JointCreateFixed"); | |||
2250 | { | 2250 | { |
2251 | if (!m_isSelected) | 2251 | if (!m_isSelected) |
2252 | { | 2252 | { |
2253 | // Not sure exactly why this sleep is here, but from experimentation it appears to stop an avatar | ||
2254 | // walking through a default rez size prim if it keeps kicking it around - justincc. | ||
2253 | Thread.Sleep(20); | 2255 | Thread.Sleep(20); |
2256 | |||
2254 | if (IsPhysical) | 2257 | if (IsPhysical) |
2255 | { | 2258 | { |
2256 | if (Body != IntPtr.Zero) | 2259 | if (Body != IntPtr.Zero) |