mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
*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
This commit is contained in:
@@ -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<UUID> uuids = new List<UUID>();
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user