drop attachments with original physical proprieties

avinationmerge
UbitUmarov 2014-09-09 03:45:26 +01:00
parent 17154fbffa
commit 136749c651
1 changed files with 6 additions and 21 deletions

View File

@ -713,13 +713,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
so.UpdateGroupRotationR(absoluteRot); so.UpdateGroupRotationR(absoluteRot);
} }
// rootPart.RemFlag(PrimFlags.TemporaryOnRez); rootPart.RemFlag(PrimFlags.TemporaryOnRez);
// rootPart.AddFlag(PrimFlags.Phantom);
// rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false);
// not physical, not temporary, phaton, not volume detector // not physical, not temporary, phaton, not volume detector
so.UpdatePrimFlags(rootPart.LocalId,false,false,true,rootPart.VolumeDetectActive); // so.UpdatePrimFlags(rootPart.LocalId,false,false,true,rootPart.VolumeDetectActive);
// restore full physical state instead
so.ApplyPhysics();
so.HasGroupChanged = true; so.HasGroupChanged = true;
rootPart.Rezzed = DateTime.Now; rootPart.Rezzed = DateTime.Now;
@ -918,32 +918,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
so.AttachedAvatar = sp.UUID; so.AttachedAvatar = sp.UUID;
// if (so.RootPart.PhysActor != null)
// so.RootPart.RemoveFromPhysics();
foreach (SceneObjectPart part in so.Parts) foreach (SceneObjectPart part in so.Parts)
{ {
if (part.KeyframeMotion != null) if (part.KeyframeMotion != null)
{ part.KeyframeMotion.Suspend();
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) if (part.PhysActor != null)
{ {
if(part.PhysActor.IsPhysical)
so.Scene.RemovePhysicalPrim(1);
part.RemoveFromPhysics(); part.RemoveFromPhysics();
} }
} }
so.RootPart.Flags &= ~PrimFlags.Physics;
so.AbsolutePosition = attachOffset; so.AbsolutePosition = attachOffset;
so.RootPart.AttachedPos = attachOffset; so.RootPart.AttachedPos = attachOffset;
so.IsAttachment = true; so.IsAttachment = true;