From ec77e1eb17f032458dbe93c0a1eab5aee604112f Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 11 Nov 2007 00:08:18 +0000 Subject: * adds flag in OpenSim.ini for disabling physical prim. Look at OpenSim.ini.example in the bin folder for an example. --- OpenSim/Region/Application/OpenSimMain.cs | 5 ++++- OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 9 +++++---- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 13 ++++++++----- OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs | 4 ++-- OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 4 ++-- OpenSim/Region/Examples/SimpleApp/Program.cs | 2 +- 7 files changed, 23 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 42f1b94..e3c326b 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -73,6 +73,7 @@ namespace OpenSim protected List m_regionData = new List(); private bool m_verbose; + private bool m_physicalPrim; private readonly string m_logFilename = ("region-console.log"); private bool m_permissions = false; @@ -154,6 +155,7 @@ namespace OpenSim config.Set("gridmode", false); config.Set("physics", "basicphysics"); config.Set("verbose", true); + config.Set("physical_prim", true); config.Set("serverside_object_permissions", false); config.Set("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); @@ -213,6 +215,7 @@ namespace OpenSim m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); m_meshEngineName = startupConfig.GetString("meshing", "Meshmerizer"); m_verbose = startupConfig.GetBoolean("verbose", true); + m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false); m_storageDLL = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); @@ -365,7 +368,7 @@ namespace OpenSim SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); return new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, - m_moduleLoader, m_dumpAssetsToFile); + m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim); } protected override void Initialize() diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index f5e6f63..f840845 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -446,7 +446,7 @@ namespace OpenSim.Region.Environment.Scenes AddEntity(group); group.AbsolutePosition = pos; SceneObjectPart rootPart = group.GetChildPart(group.UUID); - bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); + bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0)&& m_physicalPrim); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) { PrimitiveBaseShape pbs = rootPart.Shape; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7e1bbfa..b4c8b68 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Scenes private int m_timeUpdateCount; private readonly Mutex updateLock; - + public bool m_physicalPrim; protected ModuleLoader m_moduleLoader; protected StorageManager m_storageManager; protected AgentCircuitManager m_authenticateHandler; @@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Scenes public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, - ModuleLoader moduleLoader, bool dumpAssetsToFile) + ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim) { updateLock = new Mutex(false); @@ -207,6 +207,7 @@ namespace OpenSim.Region.Environment.Scenes m_regionName = m_regInfo.RegionName; m_datastore = m_regInfo.DataStore; RegisterRegionWithComms(); + m_physicalPrim = physicalPrim; m_LandManager = new LandManager(this, m_regInfo); m_estateManager = new EstateManager(this, m_regInfo); @@ -522,7 +523,7 @@ namespace OpenSim.Region.Environment.Scenes { AddEntityFromStorage(prim); SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); - bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); + bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = phyScene.AddPrimShape( rootPart.Name, @@ -572,7 +573,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.ObjectFlags += (uint) LLObject.ObjectFlags.Phantom; } // if not phantom, add to physics - bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); + bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = phyScene.AddPrimShape( diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 7575fad..1604dad 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -770,7 +770,7 @@ namespace OpenSim.Region.Environment.Scenes { i += 46; //IsLocked = (data[i++] != 0) ? true : false; - UsePhysics = (data[i++] != 0) ? true : false; + UsePhysics = ((data[i++] != 0) && m_parentGroup.m_scene.m_physicalPrim) ? true : false; //System.Console.WriteLine("U" + packet.ToBytes().Length.ToString()); IsTemporary = (data[i++] != 0) ? true : false; IsPhantom = (data[i++] != 0) ? true : false; @@ -782,7 +782,7 @@ namespace OpenSim.Region.Environment.Scenes //Silently ignore it - TODO: FIXME Quick } - if (UsePhysics) + if (UsePhysics ) { AddFlag(LLObject.ObjectFlags.Physics); if (PhysActor != null) @@ -791,9 +791,12 @@ namespace OpenSim.Region.Environment.Scenes } else { - RemFlag(LLObject.ObjectFlags.Physics); - if (PhysActor != null) - PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate; + if (m_parentGroup.m_scene.m_physicalPrim) + { + RemFlag(LLObject.ObjectFlags.Physics); + if (PhysActor != null) + PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate; + } } if (IsPhantom) diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs index e0ddec5..c2bb019 100644 --- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes m_innerScene.AddEntity(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); - bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); + bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_parentScene.m_physicalPrim); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = m_innerScene.PhyScene.AddPrimShape( rootPart.Name, @@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Scenes m_innerScene.AddEntityFromStorage(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); - bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); + bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_parentScene.m_physicalPrim); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = m_innerScene.PhyScene.AddPrimShape( rootPart.Name, diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index e658688..ae2f5ad 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -44,8 +44,8 @@ namespace SimpleApp public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, - ModuleLoader moduleLoader) - : base(regionInfo, authen, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false) + ModuleLoader moduleLoader, bool physicalPrim) + : base(regionInfo, authen, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true) { m_avatars = new List(); } diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 49fae93..73b8303 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -172,7 +172,7 @@ namespace SimpleApp SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); return new MyWorld(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, - new ModuleLoader(m_log, m_config)); + new ModuleLoader(m_log, m_config), true); } protected override StorageManager CreateStorageManager(RegionInfo regionInfo) -- cgit v1.1