aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/POS
diff options
context:
space:
mode:
authorDiva Canto2015-08-31 13:02:51 -0700
committerDiva Canto2015-08-31 13:02:51 -0700
commit134d4300f0b6e9b0df0326cfe0b5df9f41f42865 (patch)
tree86420f55292ec2f566c10b30cdb52a54e6c0f14c /OpenSim/Region/PhysicsModules/POS
parentFixed a namespace dependency. Also started preparing prebuild.xml for making ... (diff)
downloadopensim-SC_OLD-134d4300f0b6e9b0df0326cfe0b5df9f41f42865.zip
opensim-SC_OLD-134d4300f0b6e9b0df0326cfe0b5df9f41f42865.tar.gz
opensim-SC_OLD-134d4300f0b6e9b0df0326cfe0b5df9f41f42865.tar.bz2
opensim-SC_OLD-134d4300f0b6e9b0df0326cfe0b5df9f41f42865.tar.xz
All physics plugins are now region modules. Compiles but doesn't run.
Diffstat (limited to 'OpenSim/Region/PhysicsModules/POS')
-rw-r--r--OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs4
-rw-r--r--OpenSim/Region/PhysicsModules/POS/POSPlugin.cs42
-rw-r--r--OpenSim/Region/PhysicsModules/POS/POSScene.cs56
3 files changed, 76 insertions, 26 deletions
diff --git a/OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs
index fc1ffba..e3a3e35 100644
--- a/OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs
+++ b/OpenSim/Region/PhysicsModules/POS/AssemblyInfo.cs
@@ -27,6 +27,7 @@
27 27
28using System.Reflection; 28using System.Reflection;
29using System.Runtime.InteropServices; 29using System.Runtime.InteropServices;
30using Mono.Addins;
30 31
31// Information about this assembly is defined by the following 32// Information about this assembly is defined by the following
32// attributes. 33// attributes.
@@ -56,3 +57,6 @@ using System.Runtime.InteropServices;
56// numbers with the '*' character (the default): 57// numbers with the '*' character (the default):
57 58
58[assembly : AssemblyVersion("0.8.2.*")] 59[assembly : AssemblyVersion("0.8.2.*")]
60
61[assembly: Addin("OpenSim.Region.PhysicsModule.POS", OpenSim.VersionInfo.VersionNumber)]
62[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
diff --git a/OpenSim/Region/PhysicsModules/POS/POSPlugin.cs b/OpenSim/Region/PhysicsModules/POS/POSPlugin.cs
index 3fe1a0a..d233097 100644
--- a/OpenSim/Region/PhysicsModules/POS/POSPlugin.cs
+++ b/OpenSim/Region/PhysicsModules/POS/POSPlugin.cs
@@ -36,29 +36,29 @@ namespace OpenSim.Region.PhysicsModule.POS
36 /// <summary> 36 /// <summary>
37 /// for now will be a very POS physics engine 37 /// for now will be a very POS physics engine
38 /// </summary> 38 /// </summary>
39 public class POSPlugin : IPhysicsPlugin 39 //public class POSPlugin : IPhysicsPlugin
40 { 40 //{
41 public POSPlugin() 41 // public POSPlugin()
42 { 42 // {
43 } 43 // }
44 44
45 public bool Init() 45 // public bool Init()
46 { 46 // {
47 return true; 47 // return true;
48 } 48 // }
49 49
50 public PhysicsScene GetScene(string sceneIdentifier) 50 // public PhysicsScene GetScene(string sceneIdentifier)
51 { 51 // {
52 return new POSScene(GetName(), sceneIdentifier); 52 // return new POSScene(GetName(), sceneIdentifier);
53 } 53 // }
54 54
55 public string GetName() 55 // public string GetName()
56 { 56 // {
57 return ("POS"); 57 // return ("POS");
58 } 58 // }
59 59
60 public void Dispose() 60 // public void Dispose()
61 { 61 // {
62 } 62 // }
63 } 63 //}
64} 64}
diff --git a/OpenSim/Region/PhysicsModules/POS/POSScene.cs b/OpenSim/Region/PhysicsModules/POS/POSScene.cs
index 603502f..915fa8c 100644
--- a/OpenSim/Region/PhysicsModules/POS/POSScene.cs
+++ b/OpenSim/Region/PhysicsModules/POS/POSScene.cs
@@ -29,11 +29,15 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Nini.Config; 30using Nini.Config;
31using OpenMetaverse; 31using OpenMetaverse;
32using Mono.Addins;
32using OpenSim.Framework; 33using OpenSim.Framework;
33using OpenSim.Region.PhysicsModules.SharedBase; 34using OpenSim.Region.PhysicsModules.SharedBase;
35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces;
34 37
35namespace OpenSim.Region.PhysicsModule.POS 38namespace OpenSim.Region.PhysicsModule.POS
36{ 39{
40 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "POSPhysicsScene")]
37 public class POSScene : PhysicsScene 41 public class POSScene : PhysicsScene
38 { 42 {
39 private List<POSCharacter> _characters = new List<POSCharacter>(); 43 private List<POSCharacter> _characters = new List<POSCharacter>();
@@ -41,19 +45,61 @@ namespace OpenSim.Region.PhysicsModule.POS
41 private float[] _heightMap; 45 private float[] _heightMap;
42 private const float gravity = -9.8f; 46 private const float gravity = -9.8f;
43 47
48 private bool m_Enabled = false;
44 //protected internal string sceneIdentifier; 49 //protected internal string sceneIdentifier;
45 50
46 public POSScene(string engineType, String _sceneIdentifier) 51 #region INonSharedRegionModule
52 public string Name
47 { 53 {
48 EngineType = engineType; 54 get { return "POS"; }
49 Name = EngineType + "/" + _sceneIdentifier;
50 //sceneIdentifier = _sceneIdentifier;
51 } 55 }
52 56
53 public override void Initialise(IMesher meshmerizer, IConfigSource config) 57 public Type ReplaceableInterface
54 { 58 {
59 get { return null; }
55 } 60 }
56 61
62 public void Initialise(IConfigSource source)
63 {
64 // TODO: Move this out of Startup
65 IConfig config = source.Configs["Startup"];
66 if (config != null)
67 {
68 string physics = config.GetString("physics", string.Empty);
69 if (physics == Name)
70 m_Enabled = true;
71 }
72
73 }
74
75 public void Close()
76 {
77 }
78
79 public void AddRegion(Scene scene)
80 {
81 if (!m_Enabled)
82 return;
83
84 EngineType = Name;
85 PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName;
86
87 scene.RegisterModuleInterface<PhysicsScene>(this);
88 }
89
90 public void RemoveRegion(Scene scene)
91 {
92 if (!m_Enabled)
93 return;
94 }
95
96 public void RegionLoaded(Scene scene)
97 {
98 if (!m_Enabled)
99 return;
100 }
101 #endregion
102
57 public override void Dispose() 103 public override void Dispose()
58 { 104 {
59 } 105 }