From 2d352e6348a54716664af5dd8b5ca0bfd33a5743 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 8 Sep 2014 02:19:53 +0100 Subject: *NEEDS more testing* on attachment drop: fix adding prims to physics engine, remove disturbing phantom flag. On attach: fix removing prims from physics engine, delete any keyframeMotion, remove physical flag. This is executed in all attachs possible only need on attach from the scene (?), but its where original code removed only root part from physics engine --- .../Avatar/Attachments/AttachmentsModule.cs | 35 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 2c7cd40..0361741 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -710,13 +710,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments so.AttachedAvatar = UUID.Zero; rootPart.SetParentLocalId(0); so.ClearPartAttachmentData(); - rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false); + + rootPart.Flags &= ~PrimFlags.Phantom; +// rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false); + so.ApplyPhysics(); + so.HasGroupChanged = true; rootPart.Rezzed = DateTime.Now; rootPart.RemFlag(PrimFlags.TemporaryOnRez); so.AttachToBackup(); m_scene.EventManager.TriggerParcelPrimCountTainted(); - rootPart.ScheduleFullUpdate(); + + so.ScheduleGroupForFullUpdate(); + rootPart.ClearUndoState(); List uuids = new List(); @@ -907,8 +913,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments so.AttachedAvatar = sp.UUID; - if (so.RootPart.PhysActor != null) - so.RootPart.RemoveFromPhysics(); +// if (so.RootPart.PhysActor != null) +// so.RootPart.RemoveFromPhysics(); + + foreach (SceneObjectPart part in so.Parts) + { + if (part.KeyframeMotion != null) + { + part.KeyframeMotion.Delete(); + part.KeyframeMotion = null; + } + +// if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0)) +// { +// PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? +// } +// else + if (part.PhysActor != null) + { + part.RemoveFromPhysics(); + } + } + + so.RootPart.Flags &= ~PrimFlags.Physics; so.AbsolutePosition = attachOffset; so.RootPart.AttachedPos = attachOffset; -- cgit v1.1