29 using System.Collections.Generic;
30 using System.Reflection;
32 using NUnit.Framework;
34 using OpenSim.Framework;
35 using OpenSim.Framework.Servers;
36 using OpenSim.Region.Framework.Interfaces;
37 using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
38 using OpenSim.Tests.Common;
39 using System.Threading;
41 namespace OpenSim.
Region.Framework.Scenes.Tests
53 m_sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
59 TestHelpers.InMethod();
63 Vector3 startPos =
new Vector3(10.1f, 0, 0);
64 m_sp.AbsolutePosition = startPos;
68 m_sp.HandleAgentRequestSit(m_sp.ControllingClient, m_sp.UUID, part.UUID, Vector3.Zero);
70 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
71 Assert.That(part.GetSittingAvatarsCount(), Is.EqualTo(0));
72 Assert.That(part.GetSittingAvatars(), Is.Null);
73 Assert.That(m_sp.ParentID, Is.EqualTo(0));
74 Assert.AreEqual(startPos, m_sp.AbsolutePosition);
80 TestHelpers.InMethod();
84 Vector3 startPos =
new Vector3(9.9f, 0, 0);
85 m_sp.AbsolutePosition = startPos;
90 Vector3 spPhysActorSize = m_sp.PhysicsActor.Size;
91 m_sp.HandleAgentRequestSit(m_sp.ControllingClient, m_sp.UUID, part.UUID, Vector3.Zero);
93 Assert.That(m_sp.PhysicsActor, Is.Null);
96 m_sp.AbsolutePosition,
97 Is.EqualTo(part.AbsolutePosition +
new Vector3(0, 0, spPhysActorSize.Z / 2)));
99 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
100 Assert.That(part.GetSittingAvatarsCount(), Is.EqualTo(1));
101 HashSet<ScenePresence> sittingAvatars = part.GetSittingAvatars();
102 Assert.That(sittingAvatars.Count, Is.EqualTo(1));
103 Assert.That(sittingAvatars.Contains(m_sp));
104 Assert.That(m_sp.ParentID, Is.EqualTo(part.LocalId));
110 TestHelpers.InMethod();
114 Vector3 startPos =
new Vector3(1, 1, 1);
115 m_sp.AbsolutePosition = startPos;
120 Vector3 spPhysActorSize = m_sp.PhysicsActor.Size;
121 m_sp.HandleAgentRequestSit(m_sp.ControllingClient, m_sp.UUID, part.UUID, Vector3.Zero);
124 m_sp.AbsolutePosition,
125 Is.EqualTo(part.AbsolutePosition +
new Vector3(0, 0, spPhysActorSize.Z / 2)));
129 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
130 Assert.That(part.GetSittingAvatarsCount(), Is.EqualTo(0));
131 Assert.That(part.GetSittingAvatars(), Is.Null);
132 Assert.That(m_sp.ParentID, Is.EqualTo(0));
133 Assert.That(m_sp.PhysicsActor, Is.Not.Null);
139 TestHelpers.InMethod();
143 Vector3 startPos =
new Vector3(1, 1, 1);
144 m_sp.AbsolutePosition = startPos;
146 SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene, 2, m_sp.UUID,
"part", 0x10).Parts[1];
147 part.OffsetPosition =
new Vector3(2, 3, 4);
150 Vector3 spPhysActorSize = m_sp.PhysicsActor.Size;
151 m_sp.HandleAgentRequestSit(m_sp.ControllingClient, m_sp.UUID, part.UUID, Vector3.Zero);
154 m_sp.AbsolutePosition,
155 Is.EqualTo(part.AbsolutePosition +
new Vector3(0, 0, spPhysActorSize.Z / 2)));
159 Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
160 Assert.That(part.GetSittingAvatarsCount(), Is.EqualTo(0));
161 Assert.That(part.GetSittingAvatars(), Is.Null);
162 Assert.That(m_sp.ParentID, Is.EqualTo(0));
163 Assert.That(m_sp.PhysicsActor, Is.Not.Null);
233 TestHelpers.InMethod();
240 m_sp.HandleAgentSitOnGround();
242 Assert.That(m_sp.SitGround, Is.True);
243 Assert.That(m_sp.PhysicsActor, Is.Null);
247 Assert.That(m_sp.SitGround, Is.False);
248 Assert.That(m_sp.PhysicsActor, Is.Not.Null);
void TestSitAndStandOnGround()
void TestSitWithinRangeNoTarget()
void TestSitAndStandWithSitTarget()
void TestSitAndStandWithNoSitTargetChildPrim()
void TestSitOutsideRangeNoTarget()
Helpers for setting up scenes.
void TestSitAndStandWithNoSitTarget()