From 16d0a895cb817f96a55091fadbbd4cfb2d909204 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 17 Jun 2008 20:36:21 +0000 Subject: * Refactor: Move the responsibility for applying physics and sending the initial client update to Scene.AddSceneObject() from some of the SceneObjectGroup constructors * I think this has been done cleanly from inspection and testing, but if prim creation or load suddenly starts playing up more than usual, please open a mantis * This also has the effect of stopping the archiver generating ghost in-world prims * Some code dupliction also removed --- OpenSim/Region/Environment/Scenes/Scene.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index b39e08d..7adfeca 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1460,7 +1460,6 @@ namespace OpenSim.Region.Environment.Scenes rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; rootPart.TrimPermissions(); group.CheckSculptAndLoad(); - group.ApplyPhysics(m_physicalPrim); //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); } @@ -1578,9 +1577,12 @@ namespace OpenSim.Region.Environment.Scenes public virtual SceneObjectGroup AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) { + //m_log.DebugFormat( + // "[SCENE]: Scene.AddNewPrim() called for agent {0} in {1}", ownerID, RegionInfo.RegionName); + SceneObjectGroup sceneOb = new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); - AddSceneObject(sceneOb, true); + SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); // if grass or tree, make phantom //rootPart.TrimPermissions(); @@ -1591,9 +1593,8 @@ namespace OpenSim.Region.Environment.Scenes if (rootPart.Shape.PCode != (byte)PCode.Grass) AdaptTree(ref shape); } - // if not phantom, add to physics - sceneOb.ApplyPhysics(m_physicalPrim); - m_innerScene.AddToUpdateList(sceneOb); + + AddSceneObject(sceneOb, true); return sceneOb; } -- cgit v1.1