From fcc7f86427f14f9a43a918f30cdf97b438c49a77 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 13 Jul 2007 16:12:38 +0000 Subject: Changed simpleApp to use basic physics. Done some work of fixing primitive/SceneObject copying. Set DefaultHome region to 1000,1000. --- OpenSim/Region/Environment/Scenes/Primitive.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Primitive.cs') diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index 4bb43d2..53314e3 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs @@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes this.m_isRootPrim = isRoot; this.m_RootParent = rootObject; - this.CreateFromPacket(ownerID, localID, pos, shape); + this.CreateFromShape(ownerID, localID, pos, shape); this.Rotation = Axiom.Math.Quaternion.Identity; } @@ -164,14 +164,22 @@ namespace OpenSim.Region.Environment.Scenes dupe.m_Parent = parent; dupe.m_RootParent = rootParent; // TODO: Copy this properly. - dupe.m_Shape = this.m_Shape; - + dupe.m_Shape = this.m_Shape.Copy(); + dupe.children = new List(); uint newLocalID = this.m_world.PrimIDAllocate(); + dupe.uuid = LLUUID.Random(); dupe.LocalId = newLocalID; 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); + rootParent.AddChildToList(dupe); + + foreach (Primitive prim in this.children) + { + Primitive primClone = prim.Copy(this, rootParent); + dupe.children.Add(primClone); + } return dupe; } @@ -210,7 +218,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CreateFromPacket(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) + public void CreateFromShape(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) { this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; this.OwnerID = ownerID; -- cgit v1.1