aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/SharedBase/ZeroMesher.cs
diff options
context:
space:
mode:
authorDiva Canto2015-08-31 09:21:05 -0700
committerDiva Canto2015-08-31 09:21:05 -0700
commit3741edd1c791e87a38805a62530755cbf0c55cab (patch)
tree93993feafe3ae4b7fc67f9cd2cf5218882134295 /OpenSim/Region/PhysicsModules/SharedBase/ZeroMesher.cs
parentMore namespace and dll name changes. Still no functional changes. (diff)
downloadopensim-SC-3741edd1c791e87a38805a62530755cbf0c55cab.zip
opensim-SC-3741edd1c791e87a38805a62530755cbf0c55cab.tar.gz
opensim-SC-3741edd1c791e87a38805a62530755cbf0c55cab.tar.bz2
opensim-SC-3741edd1c791e87a38805a62530755cbf0c55cab.tar.xz
Refactored Meshing modules:
- Moved ZeroMesher from OpenSim.Region.PhysicsModules.SharedBase to OpenSim.Region.PhysicsModules.Meshing - Created subfolder for all Meshmerizer files, also in the same Meshing dll - Made them both region modules, with ZeroMesher being the default one This compiles but doesn't run yet.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs (renamed from OpenSim/Region/PhysicsModules/SharedBase/ZeroMesher.cs)69
1 files changed, 59 insertions, 10 deletions
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/ZeroMesher.cs b/OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs
index fe87962..0a3b3a4 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/ZeroMesher.cs
+++ b/OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs
@@ -26,9 +26,15 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Reflection;
29using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes;
32using OpenSim.Region.Framework.Interfaces;
33using OpenSim.Region.PhysicsModules.SharedBase;
30using OpenMetaverse; 34using OpenMetaverse;
31using Nini.Config; 35using Nini.Config;
36using Mono.Addins;
37using log4net;
32 38
33/* 39/*
34 * This is the zero mesher. 40 * This is the zero mesher.
@@ -41,27 +47,67 @@ using Nini.Config;
41 * it's always availabe and thus the default in case of configuration errors 47 * it's always availabe and thus the default in case of configuration errors
42*/ 48*/
43 49
44namespace OpenSim.Region.PhysicsModules.SharedBase 50namespace OpenSim.Region.PhysicsModules.Meshing
45{ 51{
46 public class ZeroMesherPlugin : IMeshingPlugin 52
53 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ZeroMesher")]
54 public class ZeroMesher : IMesher, INonSharedRegionModule
47 { 55 {
48 public ZeroMesherPlugin() 56 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
57 private bool m_Enabled = false;
58
59 #region INonSharedRegionModule
60 public string Name
49 { 61 {
62 get { return "ZeroMesher"; }
50 } 63 }
51 64
52 public string GetName() 65 public Type ReplaceableInterface
53 { 66 {
54 return "ZeroMesher"; 67 get { return null; }
55 } 68 }
56 69
57 public IMesher GetMesher(IConfigSource config) 70 public void Initialise(IConfigSource source)
58 { 71 {
59 return new ZeroMesher(); 72 // TODO: Move this out of Startup
73 IConfig config = source.Configs["Startup"];
74 if (config != null)
75 {
76 // This is the default Mesher
77 string mesher = config.GetString("meshing", Name);
78 if (mesher == Name)
79 m_Enabled = true;
80 }
60 } 81 }
61 }
62 82
63 public class ZeroMesher : IMesher 83 public void Close()
64 { 84 {
85 }
86
87 public void AddRegion(Scene scene)
88 {
89 if (!m_Enabled)
90 return;
91
92 scene.RegisterModuleInterface<IMesher>(this);
93 }
94
95 public void RemoveRegion(Scene scene)
96 {
97 if (!m_Enabled)
98 return;
99
100 scene.UnregisterModuleInterface<IMesher>(this);
101 }
102
103 public void RegionLoaded(Scene scene)
104 {
105 if (!m_Enabled)
106 return;
107 }
108 #endregion
109
110 #region IMesher
65 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) 111 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod)
66 { 112 {
67 return CreateMesh(primName, primShape, size, lod, false, false); 113 return CreateMesh(primName, primShape, size, lod, false, false);
@@ -79,5 +125,8 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
79 125
80 return null; 126 return null;
81 } 127 }
128 #endregion
129
130
82 } 131 }
83} 132}