*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 engineavinationmerge
parent
cf1d58d164
commit
2d352e6348
|
@ -710,13 +710,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
so.AttachedAvatar = UUID.Zero;
|
so.AttachedAvatar = UUID.Zero;
|
||||||
rootPart.SetParentLocalId(0);
|
rootPart.SetParentLocalId(0);
|
||||||
so.ClearPartAttachmentData();
|
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;
|
so.HasGroupChanged = true;
|
||||||
rootPart.Rezzed = DateTime.Now;
|
rootPart.Rezzed = DateTime.Now;
|
||||||
rootPart.RemFlag(PrimFlags.TemporaryOnRez);
|
rootPart.RemFlag(PrimFlags.TemporaryOnRez);
|
||||||
so.AttachToBackup();
|
so.AttachToBackup();
|
||||||
m_scene.EventManager.TriggerParcelPrimCountTainted();
|
m_scene.EventManager.TriggerParcelPrimCountTainted();
|
||||||
rootPart.ScheduleFullUpdate();
|
|
||||||
|
so.ScheduleGroupForFullUpdate();
|
||||||
|
|
||||||
rootPart.ClearUndoState();
|
rootPart.ClearUndoState();
|
||||||
|
|
||||||
List<UUID> uuids = new List<UUID>();
|
List<UUID> uuids = new List<UUID>();
|
||||||
|
@ -907,8 +913,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
|
|
||||||
so.AttachedAvatar = sp.UUID;
|
so.AttachedAvatar = sp.UUID;
|
||||||
|
|
||||||
if (so.RootPart.PhysActor != null)
|
// if (so.RootPart.PhysActor != null)
|
||||||
so.RootPart.RemoveFromPhysics();
|
// 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.AbsolutePosition = attachOffset;
|
||||||
so.RootPart.AttachedPos = attachOffset;
|
so.RootPart.AttachedPos = attachOffset;
|
||||||
|
|
Loading…
Reference in New Issue