From 911e63765c7cea748b5ae2227f5c1d6ff131d329 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 27 Apr 2008 20:10:28 +0000 Subject: * Single Attachments now work from inventory. You can attach from inventory and detach from inventory. * Detaching from right clicking in world, detaches to your inventory. * If you go up to a prim and attach it from in world, it appears in your inventory. * Attachment placement is saved when you detach them. * Choosing wear remembers your last attachment point from inventory. * Wrote a method to update an inventory item's asset and sends the updated inventory item to the Client * Wrote a recursive method to find the folder of a known existing inventory item. * Removed a block on physics object position on creation. This might crash a region or two, let us know via Mantis if your region crashes because of a physics out of bounds error. * Drop doesn't work. The menu item doesn't even come up. Don't know why :P. --- .../Region/Environment/Scenes/SceneObjectGroup.cs | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2493ed8..ba318a8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -663,9 +663,11 @@ namespace OpenSim.Region.Environment.Scenes { m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor); m_rootPart.PhysActor = null; - AbsolutePosition = AttachOffset; - m_rootPart.m_attachedPos = AttachOffset; + } + + AbsolutePosition = AttachOffset; + m_rootPart.m_attachedPos = AttachOffset; m_rootPart.m_IsAttachment = true; m_rootPart.SetParentLocalId(avatar.LocalId); @@ -702,6 +704,26 @@ namespace OpenSim.Region.Environment.Scenes AttachToBackup(); m_rootPart.ScheduleFullUpdate(); } + public void DetachToInventoryPrep() + { + ScenePresence avatar = m_scene.GetScenePresence(m_rootPart.m_attachedAvatar); + //LLVector3 detachedpos = new LLVector3(127f, 127f, 127f); + if (avatar != null) + { + //detachedpos = avatar.AbsolutePosition; + avatar.RemoveAttachment(this); + } + + m_rootPart.m_attachedAvatar = LLUUID.Zero; + m_rootPart.SetParentLocalId(0); + //m_rootPart.SetAttachmentPoint((byte)0); + m_rootPart.m_IsAttachment = false; + AbsolutePosition = m_rootPart.m_attachedPos; + //m_rootPart.ApplyPhysics(m_rootPart.ObjectFlags, m_scene.m_physicalPrim); + //AttachToBackup(); + //m_rootPart.ScheduleFullUpdate(); + + } /// /// /// -- cgit v1.1