aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index 5e89eec..94c0030 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -303,6 +303,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
303 Assert.That(presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); 303 Assert.That(presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest));
304 } 304 }
305 305
306 [Test]
307 public void TestUpdateAttachmentPosition()
308 {
309 TestHelpers.InMethod();
310
311 UUID userId = TestHelpers.ParseTail(0x1);
312 UUID attItemId = TestHelpers.ParseTail(0x2);
313 UUID attAssetId = TestHelpers.ParseTail(0x3);
314 string attName = "att";
315
316 UserAccountHelpers.CreateUserWithInventory(scene, userId);
317 InventoryItemBase attItem
318 = UserInventoryHelpers.CreateInventoryItem(
319 scene, attName, attItemId, attAssetId, userId, InventoryType.Object);
320
321 AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId);
322 acd.Appearance = new AvatarAppearance();
323 acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
324 ScenePresence sp = SceneHelpers.AddScenePresence(scene, acd);
325
326 SceneObjectGroup attSo = sp.GetAttachments()[0];
327
328 Vector3 newPosition = new Vector3(1, 2, 4);
329
330 scene.SceneGraph.UpdatePrimGroupPosition(attSo.LocalId, newPosition, sp.ControllingClient);
331
332 Assert.That(attSo.AbsolutePosition, Is.EqualTo(sp.AbsolutePosition));
333 Assert.That(attSo.RootPart.AttachedPos, Is.EqualTo(newPosition));
334 }
335
306 // I'm commenting this test because scene setup NEEDS InventoryService to 336 // I'm commenting this test because scene setup NEEDS InventoryService to
307 // be non-null 337 // be non-null
308 //[Test] 338 //[Test]