diff options
author | Diva Canto | 2015-08-31 13:02:51 -0700 |
---|---|---|
committer | Diva Canto | 2015-08-31 13:02:51 -0700 |
commit | 134d4300f0b6e9b0df0326cfe0b5df9f41f42865 (patch) | |
tree | 86420f55292ec2f566c10b30cdb52a54e6c0f14c /OpenSim/Region/PhysicsModules/POS | |
parent | Fixed a namespace dependency. Also started preparing prebuild.xml for making ... (diff) | |
download | opensim-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.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/POS/POSPlugin.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/POS/POSScene.cs | 56 |
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 | ||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | using 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; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using Mono.Addins; | ||
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Region.PhysicsModules.SharedBase; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using OpenSim.Region.Framework.Scenes; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
34 | 37 | ||
35 | namespace OpenSim.Region.PhysicsModule.POS | 38 | namespace 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 | } |