29 using System.Collections.Generic;
30 using System.Reflection;
31 using NUnit.Framework;
33 using OpenSim.Framework;
34 using OpenSim.Region.Framework.Scenes;
35 using OpenSim.Tests.Common;
37 namespace OpenSim.
Region.Framework.Scenes.Tests
46 private UUID m_ownerId = TestHelpers.ParseTail(0x1);
54 m_so1 = SceneHelpers.CreateSceneObject(1, m_ownerId,
"so1", 0x10);
55 m_so2 = SceneHelpers.CreateSceneObject(1, m_ownerId,
"so2", 0x20);
61 TestHelpers.InMethod();
63 m_scene.AddSceneObject(m_so1);
64 m_so1.ScriptSetTemporaryStatus(
true);
67 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.TemporaryOnRez));
68 Assert.That(m_so1.Backup, Is.False);
71 m_so1.ScriptSetTemporaryStatus(
false);
73 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None));
74 Assert.That(m_so1.Backup, Is.True);
80 TestHelpers.InMethod();
82 m_scene.AddSceneObject(m_so1);
85 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
87 m_so1.ScriptSetPhantomStatus(
true);
90 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom));
92 m_so1.ScriptSetPhantomStatus(
false);
94 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
100 TestHelpers.InMethod();
102 m_scene.AddSceneObject(m_so1);
105 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
107 m_so1.ScriptSetVolumeDetect(
true);
110 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom));
112 m_so1.ScriptSetVolumeDetect(
false);
114 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
120 TestHelpers.InMethod();
122 m_scene.AddSceneObject(m_so1);
125 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
127 m_so1.ScriptSetPhysicsStatus(
true);
129 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics));
131 m_so1.ScriptSetPhysicsStatus(
false);
133 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
139 TestHelpers.InMethod();
141 m_scene.AddSceneObject(m_so1);
144 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None));
146 m_so1.ScriptSetPhysicsStatus(
true);
147 m_so1.ScriptSetVolumeDetect(
true);
149 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom | PrimFlags.Physics));
151 m_so1.ScriptSetVolumeDetect(
false);
153 Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics));
159 TestHelpers.InMethod();
161 m_scene.AddSceneObject(m_so1);
162 m_scene.AddSceneObject(m_so2);
164 m_scene.LinkObjects(m_ownerId, m_so1.LocalId,
new List<uint>() { m_so2.LocalId });
166 m_so1.ScriptSetPhysicsStatus(
true);
168 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
169 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
171 m_so1.ScriptSetPhysicsStatus(
false);
173 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None));
174 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.None));
176 m_so1.ScriptSetPhysicsStatus(
true);
178 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
179 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
188 TestHelpers.InMethod();
190 m_scene.AddSceneObject(m_so1);
191 m_scene.AddSceneObject(m_so2);
193 m_so1.ScriptSetPhysicsStatus(
true);
194 m_so2.ScriptSetPhysicsStatus(
true);
196 m_scene.LinkObjects(m_ownerId, m_so1.LocalId,
new List<uint>() { m_so2.LocalId });
198 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
199 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
208 TestHelpers.InMethod();
210 m_scene.AddSceneObject(m_so1);
211 m_scene.AddSceneObject(m_so2);
213 m_so1.ScriptSetPhysicsStatus(
true);
215 m_scene.LinkObjects(m_ownerId, m_so1.LocalId,
new List<uint>() { m_so2.LocalId });
217 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
218 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
227 TestHelpers.InMethod();
229 m_scene.AddSceneObject(m_so1);
230 m_scene.AddSceneObject(m_so2);
232 m_so2.ScriptSetPhysicsStatus(
true);
234 m_scene.LinkObjects(m_ownerId, m_so1.LocalId,
new List<uint>() { m_so2.LocalId });
236 Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None));
237 Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.None));
void TestSetPhantomSinglePrim()
void TestLinkPhysicsBothPhysical()
Test that linking results in the correct physical status for all linkees.
void TestSetPhysicsSinglePrim()
void TestLinkPhysicsRootPhysicalOnly()
Test that linking results in the correct physical status for all linkees.
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
Basic scene object status tests
void TestSetNonPhysicsVolumeDetectSinglePrim()
Helpers for setting up scenes.
void TestSetPhysicsLinkset()
void TestSetPhysicsVolumeDetectSinglePrim()
void TestLinkPhysicsChildPhysicalOnly()
Test that linking results in the correct physical status for all linkees.