* minor: remove some pointless assignments in SOG.Copy() that had already been done by MemberwiseClone()
parent
c80733cc98
commit
a9e76ce847
|
@ -1496,8 +1496,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// occur on link to invoke this elsewhere (such as object selection)
|
// occur on link to invoke this elsewhere (such as object selection)
|
||||||
parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected);
|
parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected);
|
||||||
parenPrim.TriggerScriptChangedEvent(Changed.LINK);
|
parenPrim.TriggerScriptChangedEvent(Changed.LINK);
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
|
{
|
||||||
parenPrim.GetProperties(client);
|
parenPrim.GetProperties(client);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (ScenePresence p in GetScenePresences())
|
foreach (ScenePresence p in GetScenePresences())
|
||||||
|
@ -1715,6 +1718,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero);
|
// SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero);
|
||||||
DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
|
DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Duplicate the given object.
|
/// Duplicate the given object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1780,6 +1784,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID);
|
m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1053,7 +1053,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
part.StoreUndoState();
|
part.StoreUndoState();
|
||||||
part.OnGrab(offsetPos, remoteClient);
|
part.OnGrab(offsetPos, remoteClient);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient)
|
public virtual void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient)
|
||||||
|
@ -1232,10 +1231,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// any exception propogate upwards.
|
// any exception propogate upwards.
|
||||||
|
|
||||||
if (IsDeleted || UUID == UUID.Zero)
|
if (IsDeleted || UUID == UUID.Zero)
|
||||||
{
|
|
||||||
// DetachFromBackup();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1362,15 +1358,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
|
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
|
||||||
dupe.m_isBackedUp = false;
|
dupe.m_isBackedUp = false;
|
||||||
dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
|
dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
|
||||||
dupe.m_parts.Clear();
|
|
||||||
//dupe.OwnerID = AgentID;
|
|
||||||
//dupe.GroupID = GroupID;
|
|
||||||
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
||||||
dupe.m_scene = m_scene;
|
|
||||||
dupe.m_regionHandle = m_regionHandle;
|
|
||||||
|
|
||||||
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
||||||
|
|
||||||
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
|
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
|
||||||
|
|
||||||
if (userExposed)
|
if (userExposed)
|
||||||
|
@ -1390,7 +1380,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.RootPart.PhysActor.IsPhysical);
|
dupe.RootPart.PhysActor.IsPhysical);
|
||||||
|
|
||||||
dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
|
dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
|
||||||
|
|
||||||
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
|
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1415,8 +1404,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (part.UUID != m_rootPart.UUID)
|
if (part.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
SceneObjectPart newPart =
|
SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
|
||||||
dupe.CopyPart(part, OwnerID, GroupID, userExposed);
|
|
||||||
|
|
||||||
newPart.LinkNum = part.LinkNum;
|
newPart.LinkNum = part.LinkNum;
|
||||||
|
|
||||||
|
|
|
@ -1380,7 +1380,6 @@ if (m_shape != null) {
|
||||||
if (!userExposed)
|
if (!userExposed)
|
||||||
dupe.PhysActor = null;
|
dupe.PhysActor = null;
|
||||||
|
|
||||||
|
|
||||||
dupe._ownerID = AgentID;
|
dupe._ownerID = AgentID;
|
||||||
dupe._groupID = GroupID;
|
dupe._groupID = GroupID;
|
||||||
dupe.GroupPosition = GroupPosition;
|
dupe.GroupPosition = GroupPosition;
|
||||||
|
@ -1428,6 +1427,7 @@ if (m_shape != null) {
|
||||||
bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0);
|
bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0);
|
||||||
dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
|
dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dupe;
|
return dupe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp2 = part2.ParentGroup;
|
SceneObjectGroup grp2 = part2.ParentGroup;
|
||||||
|
|
||||||
|
|
||||||
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
||||||
grp2.AbsolutePosition = Vector3.Zero;
|
grp2.AbsolutePosition = Vector3.Zero;
|
||||||
|
|
||||||
|
@ -129,6 +128,10 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
// Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated.
|
// Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated.
|
||||||
grp1.LinkToGroup(grp2);
|
grp1.LinkToGroup(grp2);
|
||||||
|
|
||||||
|
// FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since
|
||||||
|
// it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed.
|
||||||
|
//Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link.");
|
||||||
|
//Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink.");
|
||||||
Assert.That(grp1.Children.Count == 2);
|
Assert.That(grp1.Children.Count == 2);
|
||||||
|
|
||||||
if (debugtest)
|
if (debugtest)
|
||||||
|
@ -171,7 +174,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset);
|
System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset);
|
||||||
|
|
||||||
Assert.That(part2.AbsolutePosition == Vector3.Zero);
|
Assert.That(part2.AbsolutePosition == Vector3.Zero);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -189,7 +191,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene);
|
SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene);
|
||||||
SceneObjectGroup grp4 = part4.ParentGroup;
|
SceneObjectGroup grp4 = part4.ParentGroup;
|
||||||
|
|
||||||
|
|
||||||
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
grp1.AbsolutePosition = new Vector3(10, 10, 10);
|
||||||
grp2.AbsolutePosition = Vector3.Zero;
|
grp2.AbsolutePosition = Vector3.Zero;
|
||||||
grp3.AbsolutePosition = new Vector3(20, 20, 20);
|
grp3.AbsolutePosition = new Vector3(20, 20, 20);
|
||||||
|
@ -228,7 +229,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
Assert.That(grp1.Children.Count == 2);
|
Assert.That(grp1.Children.Count == 2);
|
||||||
Assert.That(grp3.Children.Count == 2);
|
Assert.That(grp3.Children.Count == 2);
|
||||||
|
|
||||||
|
|
||||||
if (debugtest)
|
if (debugtest)
|
||||||
{
|
{
|
||||||
System.Console.WriteLine("--------After Link-------");
|
System.Console.WriteLine("--------After Link-------");
|
||||||
|
@ -297,7 +297,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
|
||||||
&& (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003)
|
&& (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003)
|
||||||
&& (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003)
|
&& (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003)
|
||||||
&& (part4.RotationOffset.W - compareQuaternion.W < 0.00003));
|
&& (part4.RotationOffset.W - compareQuaternion.W < 0.00003));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue