aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/BasicPhysics
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/BasicPhysics
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/BasicPhysics')
-rw-r--r--OpenSim/Region/PhysicsModules/BasicPhysics/AssemblyInfo.cs8
-rw-r--r--OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPlugin.cs42
-rw-r--r--OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs61
3 files changed, 79 insertions, 32 deletions
diff --git a/OpenSim/Region/PhysicsModules/BasicPhysics/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/AssemblyInfo.cs
index 7d054dd..1765ae0 100644
--- a/OpenSim/Region/PhysicsModules/BasicPhysics/AssemblyInfo.cs
+++ b/OpenSim/Region/PhysicsModules/BasicPhysics/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.
@@ -34,11 +35,11 @@ using System.Runtime.InteropServices;
34// change them to the information which is associated with the assembly 35// change them to the information which is associated with the assembly
35// you compile. 36// you compile.
36 37
37[assembly : AssemblyTitle("BasicPhysicsPlugin")] 38[assembly : AssemblyTitle("BasicPhysicsModule")]
38[assembly : AssemblyDescription("")] 39[assembly : AssemblyDescription("")]
39[assembly : AssemblyConfiguration("")] 40[assembly : AssemblyConfiguration("")]
40[assembly : AssemblyCompany("http://opensimulator.org")] 41[assembly : AssemblyCompany("http://opensimulator.org")]
41[assembly : AssemblyProduct("BasicPhysicsPlugin")] 42[assembly : AssemblyProduct("BasicPhysicsModule")]
42[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers")] 43[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers")]
43[assembly : AssemblyTrademark("")] 44[assembly : AssemblyTrademark("")]
44[assembly : AssemblyCulture("")] 45[assembly : AssemblyCulture("")]
@@ -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.BasicPhysics", OpenSim.VersionInfo.VersionNumber)]
62[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
diff --git a/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPlugin.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPlugin.cs
index e78c191..db02eb6 100644
--- a/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPlugin.cs
+++ b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsPlugin.cs
@@ -36,29 +36,29 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
36 /// <summary> 36 /// <summary>
37 /// Effectively a physics plugin that simulates no physics at all. 37 /// Effectively a physics plugin that simulates no physics at all.
38 /// </summary> 38 /// </summary>
39 public class BasicPhysicsPlugin : IPhysicsPlugin 39 //public class BasicPhysicsPlugin : IPhysicsPlugin
40 { 40 //{
41 public BasicPhysicsPlugin() 41 // public BasicPhysicsPlugin()
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 BasicScene(GetName(), sceneIdentifier); 52 // return new BasicScene(GetName(), sceneIdentifier);
53 } 53 // }
54 54
55 public string GetName() 55 // public string GetName()
56 { 56 // {
57 return ("basicphysics"); 57 // return ("basicphysics");
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/BasicPhysics/BasicPhysicsScene.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs
index 8b9e65a..5ec0f85 100644
--- a/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs
+++ b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs
@@ -28,9 +28,12 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Nini.Config; 30using Nini.Config;
31using Mono.Addins;
31using OpenMetaverse; 32using OpenMetaverse;
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.BasicPhysics 38namespace OpenSim.Region.PhysicsModule.BasicPhysics
36{ 39{
@@ -41,32 +44,71 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
41 /// Not useful for anything at the moment apart from some regression testing in other components where some form 44 /// Not useful for anything at the moment apart from some regression testing in other components where some form
42 /// of physics plugin is needed. 45 /// of physics plugin is needed.
43 /// </remarks> 46 /// </remarks>
44 public class BasicScene : PhysicsScene 47 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicPhysicsScene")]
48 public class BasicScene : PhysicsScene, INonSharedRegionModule
45 { 49 {
46 private List<BasicActor> _actors = new List<BasicActor>(); 50 private List<BasicActor> _actors = new List<BasicActor>();
47 private List<BasicPhysicsPrim> _prims = new List<BasicPhysicsPrim>(); 51 private List<BasicPhysicsPrim> _prims = new List<BasicPhysicsPrim>();
48 private float[] _heightMap; 52 private float[] _heightMap;
49 private Vector3 m_regionExtent; 53 private Vector3 m_regionExtent;
50 54
55 private bool m_Enabled = false;
56
51 //protected internal string sceneIdentifier; 57 //protected internal string sceneIdentifier;
58 #region INonSharedRegionModule
59 public string Name
60 {
61 get { return "basicphysics"; }
62 }
52 63
53 public BasicScene(string engineType, string _sceneIdentifier) 64 public Type ReplaceableInterface
54 { 65 {
55 EngineType = engineType; 66 get { return null; }
56 Name = EngineType + "/" + _sceneIdentifier;
57 //sceneIdentifier = _sceneIdentifier;
58 } 67 }
59 68
60 public override void Initialise(IMesher meshmerizer, IConfigSource config) 69 public void Initialise(IConfigSource source)
61 { 70 {
62 throw new Exception("Should not be called."); 71 // TODO: Move this out of Startup
72 IConfig config = source.Configs["Startup"];
73 if (config != null)
74 {
75 string physics = config.GetString("physics", string.Empty);
76 if (physics == Name)
77 m_Enabled = true;
78 }
79
63 } 80 }
64 81
65 public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) 82 public void Close()
66 { 83 {
67 m_regionExtent = regionExtent;
68 } 84 }
69 85
86 public void AddRegion(Scene scene)
87 {
88 if (!m_Enabled)
89 return;
90
91 EngineType = Name;
92 PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName;
93
94 scene.RegisterModuleInterface<PhysicsScene>(this);
95 m_regionExtent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
96
97 }
98
99 public void RemoveRegion(Scene scene)
100 {
101 if (!m_Enabled)
102 return;
103 }
104
105 public void RegionLoaded(Scene scene)
106 {
107 if (!m_Enabled)
108 return;
109 }
110 #endregion
111
70 public override void Dispose() {} 112 public override void Dispose() {}
71 113
72 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 114 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
@@ -206,5 +248,6 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
206 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); 248 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
207 return returncolliders; 249 return returncolliders;
208 } 250 }
251
209 } 252 }
210} 253}