From 2a988f187ec4c743d6b269fc3a8fe32d84716f65 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 14 May 2008 23:15:25 +0000 Subject: * Refactored IConfigSource into Physics plug-ins and Scene. We can get rid of some of the parameters we pass to it's constructor now like, 'm_allowPhysicalPrim', 'seeIntoOtherRegions', etc.. so on * The main purpose of this is to provide configuration options for ODE and other physics plug-ins that are advanced enough to be able to be configured. --- OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 3 ++- OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | 5 ++++- OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | 5 +++-- OpenSim/Region/Physics/Manager/PhysicsScene.cs | 5 +++-- OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | 3 ++- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 6 +++++- OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | 3 ++- OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | 3 ++- 8 files changed, 23 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index eecd115..d7c4013 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs @@ -27,6 +27,7 @@ using System.Collections.Generic; using Axiom.Math; +using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -70,7 +71,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin { } - public override void Initialise(IMesher meshmerizer) + public override void Initialise(IMesher meshmerizer, IConfigSource config) { // Does nothing right now } diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index ddfb5a4..9415fff 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs @@ -34,6 +34,7 @@ using OpenSim.Framework; using OpenSim.Region.Physics.Manager; using XnaDevRu.BulletX; using XnaDevRu.BulletX.Dynamics; +using Nini.Config; using AxiomQuaternion = Axiom.Math.Quaternion; #endregion @@ -483,6 +484,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin internal Dictionary _prims = new Dictionary(); public IMesher mesher; + private IConfigSource m_config; public static float Gravity @@ -536,9 +538,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin //this._heightmap = new float[65536]; } - public override void Initialise(IMesher meshmerizer) + public override void Initialise(IMesher meshmerizer, IConfigSource config) { mesher = meshmerizer; + m_config = config; } public override void Dispose() diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index e4ff725..b8ca180 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection; +using Nini.Config; using log4net; namespace OpenSim.Region.Physics.Manager @@ -47,7 +48,7 @@ namespace OpenSim.Region.Physics.Manager { } - public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName) + public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, IConfigSource config) { if (String.IsNullOrEmpty(physEngineName)) { @@ -75,7 +76,7 @@ namespace OpenSim.Region.Physics.Manager { m_log.Info("[PHYSICS]: creating " + physEngineName); PhysicsScene result = _PhysPlugins[physEngineName].GetScene(); - result.Initialise(meshEngine); + result.Initialise(meshEngine, config); return result; } else diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 4c509b7..de93f22 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs @@ -28,6 +28,7 @@ using System.Reflection; using Axiom.Math; using log4net; +using Nini.Config; using OpenSim.Framework; namespace OpenSim.Region.Physics.Manager @@ -58,7 +59,7 @@ namespace OpenSim.Region.Physics.Manager } - public abstract void Initialise(IMesher meshmerizer); + public abstract void Initialise(IMesher meshmerizer, IConfigSource config); public abstract PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size); @@ -92,7 +93,7 @@ namespace OpenSim.Region.Physics.Manager private static int m_workIndicator; - public override void Initialise(IMesher meshmerizer) + public override void Initialise(IMesher meshmerizer, IConfigSource config) { // Does nothing right now } diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index 94d98cb..bdc5b00 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs @@ -27,6 +27,7 @@ using System; using Axiom.Math; +using Nini.Config; using NUnit.Framework; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -50,7 +51,7 @@ namespace OpenSim.Region.Physics.OdePlugin // Getting Physics Scene ps = cbt.GetScene(); // Initializing Physics Scene. - ps.Initialise(imp.GetMesher()); + ps.Initialise(imp.GetMesher(),null); float[] _heightmap = new float[256 * 256]; for (int i = 0; i<(256*256);i++) { diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index c2a1c8e..da72092 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -32,6 +32,7 @@ using System.Runtime.InteropServices; using System.Threading; using Axiom.Math; using log4net; +using Nini.Config; using Ode.NET; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -193,6 +194,8 @@ namespace OpenSim.Region.Physics.OdePlugin public IMesher mesher; + private IConfigSource m_config; + /// /// Initiailizes the scene @@ -286,9 +289,10 @@ namespace OpenSim.Region.Physics.OdePlugin // Initialize the mesh plugin - public override void Initialise(IMesher meshmerizer) + public override void Initialise(IMesher meshmerizer, IConfigSource config) { mesher = meshmerizer; + m_config = config; } internal void waitForSpaceUnlock(IntPtr space) diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 96e67d1..9ca1b23 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using Axiom.Math; +using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; @@ -73,7 +74,7 @@ namespace OpenSim.Region.Physics.POSPlugin { } - public override void Initialise(IMesher meshmerizer) + public override void Initialise(IMesher meshmerizer, IConfigSource config) { // Does nothing right now } diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 712d10e..175d749 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; using PhysXWrapper; @@ -84,7 +85,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin scene = mySdk.CreateScene(); } - public override void Initialise(IMesher meshmerizer) + public override void Initialise(IMesher meshmerizer, IConfigSource config) { // Does nothing right now } -- cgit v1.1