From 7f18f494f1200f0f6470020a794e5291124f3ead Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 1 Jul 2007 21:45:47 +0000 Subject: Just committing this because I want my commit to be on the front page of www.opensimulator.org rather than lbsa71's being there. --- OpenSim/Framework/General/Types/PrimitiveBaseShape.cs | 5 +++-- OpenSim/Region/Environment/Scenes/Primitive.cs | 6 +++--- OpenSim/Region/Environment/Scenes/SceneObject.cs | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index 7c8de16..584bc9b 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -16,12 +16,13 @@ namespace OpenSim.Framework.Types Torus, Prism, Scuplted, - Cylinder + Cylinder, + Unknown } public class PrimitiveBaseShape { - private ShapeType type; + private ShapeType type = ShapeType.Unknown; public byte PCode; public ushort PathBegin; diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index dd8bb02..b8ec68b 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Scenes /// public override void update() { - if (this.updateFlag == 1) // is a new prim just been created/reloaded + if (this.updateFlag == 1) // is a new prim just been created/reloaded or has major changes { this.SendFullUpdateToAllClients(); this.updateFlag = 0; @@ -151,7 +151,7 @@ namespace OpenSim.Region.Environment.Scenes this.updateFlag = 1; } - public void AddToChildren(SceneObject linkObject) + public void AddNewChildren(SceneObject linkObject) { // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); //TODO check permissions @@ -159,7 +159,7 @@ namespace OpenSim.Region.Environment.Scenes linkObject.rootPrimitive.SetNewParent(this, this.m_RootParent); this.m_world.DeleteEntity(linkObject.rootUUID); - linkObject.rootPrimitive = null; + linkObject.DeleteAllChildren(); } public void SetNewParent(Primitive newParent, SceneObject rootParent) diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 2c55a7d..c03354e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes m_regionHandle = regionHandle; m_world = world; this.Pos = addPacket.ObjectData.RayEnd; - this.CreateFromPacket(addPacket, ownerID, localID); + this.CreateRootFromPacket(addPacket, ownerID, localID); } /// @@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) + public void CreateRootFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) { this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, addPacket, agentID, localID, true, this, this); this.children.Add(rootPrimitive); @@ -99,6 +99,15 @@ namespace OpenSim.Region.Environment.Scenes } + /// + /// + /// + public void DeleteAllChildren() + { + this.children.Clear(); + this.ChildPrimitives.Clear(); + this.rootPrimitive = null; + } /// /// @@ -106,7 +115,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void AddNewChildPrims(SceneObject primObject) { - this.rootPrimitive.AddToChildren(primObject); + this.rootPrimitive.AddNewChildren(primObject); } /// -- cgit v1.1