Prim Copying (both CTRL+D and shift-drag) should now work.
parent
41cd6cdfdd
commit
401af6ad4a
|
@ -163,21 +163,33 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
dupe.inventoryItems = this.inventoryItems;
|
||||
dupe.m_Parent = parent;
|
||||
dupe.m_RootParent = rootParent;
|
||||
// TODO: Copy this properly.
|
||||
|
||||
dupe.m_Shape = this.m_Shape.Copy();
|
||||
dupe.children = new List<EntityBase>();
|
||||
uint newLocalID = this.m_world.PrimIDAllocate();
|
||||
dupe.uuid = LLUUID.Random();
|
||||
dupe.LocalId = newLocalID;
|
||||
dupe.m_regionHandle = this.m_regionHandle;
|
||||
|
||||
if (parent is SceneObject)
|
||||
{
|
||||
dupe.m_isRootPrim = true;
|
||||
dupe.ParentID = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dupe.m_isRootPrim = false;
|
||||
dupe.ParentID = ((Primitive)parent).LocalId;
|
||||
}
|
||||
|
||||
dupe.Scale = new LLVector3(this.Scale.X, this.Scale.Y, this.Scale.Z);
|
||||
dupe.Rotation = new Quaternion(this.Rotation.w, this.Rotation.x, this.Rotation.y, this.Rotation.z);
|
||||
dupe.Pos = new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z);
|
||||
dupe.m_pos = new LLVector3(this.m_pos.X, this.m_pos.Y, this.m_pos.Z);
|
||||
rootParent.AddChildToList(dupe);
|
||||
|
||||
foreach (Primitive prim in this.children)
|
||||
{
|
||||
Primitive primClone = prim.Copy(this, rootParent);
|
||||
Primitive primClone = prim.Copy(dupe, rootParent);
|
||||
dupe.children.Add(primClone);
|
||||
}
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
avatar = this.Avatars[client.AgentId];
|
||||
// int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
|
||||
dis = (int) avatar.Pos.GetDistanceTo(fromPos);
|
||||
dis = (int)avatar.Pos.GetDistanceTo(fromPos);
|
||||
//Console.WriteLine("found avatar at " +dis);
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,15 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
if (originPrim != null)
|
||||
{
|
||||
//SceneObject copy = originPrim.Copy();
|
||||
SceneObject copy = originPrim.Copy();
|
||||
copy.Pos = copy.Pos + offset;
|
||||
this.Entities.Add(copy.rootUUID, copy);
|
||||
|
||||
List<ScenePresence> avatars = this.RequestAvatarList();
|
||||
for (int i = 0; i < avatars.Count; i++)
|
||||
{
|
||||
copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -494,7 +502,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
prim = ((SceneObject)ent).HasChildPrim(localID);
|
||||
if (prim != null)
|
||||
{
|
||||
prim.UpdateGroupMouseRotation( pos, rot);
|
||||
prim.UpdateGroupMouseRotation(pos, rot);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,11 +117,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
dupe.m_world = this.m_world;
|
||||
dupe.m_regionHandle = this.m_regionHandle;
|
||||
Primitive newRoot = this.rootPrimitive.Copy((EntityBase)dupe, dupe);
|
||||
Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe);
|
||||
dupe.rootPrimitive = newRoot;
|
||||
dupe.rootPrimitive.Pos =( this.Pos + new LLVector3(0,0,1));
|
||||
dupe.children.Add(dupe.rootPrimitive);
|
||||
dupe.rootPrimitive.Pos = this.Pos;
|
||||
dupe.Rotation = this.Rotation;
|
||||
|
||||
LLUUID rootu= dupe.rootUUID;
|
||||
uint rooti = dupe.rootLocalID;
|
||||
return dupe;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue