change root part physics type none to apply physics

master
UbitUmarov 2020-03-02 04:05:18 +00:00
parent be16cf9531
commit c30cb8a9cf
2 changed files with 12 additions and 14 deletions

View File

@ -3420,28 +3420,21 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.setGroupPosition(worldPos);
linkPart.setOffsetPosition(Vector3.Zero);
linkPart.setRotationOffset(worldRot);
linkPart.Rezzed = RootPart.Rezzed;
// Create a new SOG to go around this unlinked and unattached SOP
SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
m_scene.AddNewSceneObject(objectGroup, true);
linkPart.Rezzed = RootPart.Rezzed;
InvalidBoundsRadius();
InvalidatePartsLinkMaps();
objectGroup.InvalidateEffectivePerms();
objectGroup.HasGroupChangedDueToDelink = true;
// When we delete a group, we currently have to force persist to the database if the object id has changed
// (since delete works by deleting all rows which have a given object id)
// this is as it seems to be in sl now
if (linkPart.PhysicsShapeType == (byte)PhysShapeType.none)
linkPart.PhysicsShapeType = linkPart.DefaultPhysicsShapeType(); // root prims can't have type none for now
m_scene.AddNewSceneObject(objectGroup, true);
InvalidateEffectivePerms();
if (m_rootPart.PhysActor != null)
m_rootPart.PhysActor.Building = false;
objectGroup.HasGroupChangedDueToDelink = true;
if (sendEvents)
linkPart.TriggerScriptChangedEvent(Changed.LINK);

View File

@ -2068,7 +2068,12 @@ namespace OpenSim.Region.Framework.Scenes
return;
if (PhysicsShapeType == (byte)PhysShapeType.none)
{
if(ParentID == 0)
m_physicsShapeType = DefaultPhysicsShapeType();
else
return;
}
bool isPhysical = (_ObjectFlags & (uint) PrimFlags.Physics) != 0;
bool isPhantom = (_ObjectFlags & (uint)PrimFlags.Phantom) != 0;