diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs (renamed from OpenSim/Region/Physics/Manager/ZeroMesher.cs) | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs index 890951f..09676c6 100644 --- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs | |||
@@ -26,9 +26,15 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | ||
29 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | ||
32 | using OpenSim.Region.Framework.Interfaces; | ||
33 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
30 | using OpenMetaverse; | 34 | using OpenMetaverse; |
31 | using Nini.Config; | 35 | using Nini.Config; |
36 | using Mono.Addins; | ||
37 | using 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 | ||
44 | namespace OpenSim.Region.Physics.Manager | 50 | namespace 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); | 113 | return CreateMesh(primName, primShape, size, lod, false); |
@@ -93,5 +139,7 @@ namespace OpenSim.Region.Physics.Manager | |||
93 | public void ReleaseMesh(IMesh mesh) { } | 139 | public void ReleaseMesh(IMesh mesh) { } |
94 | public void ExpireReleaseMeshs() { } | 140 | public void ExpireReleaseMeshs() { } |
95 | public void ExpireFileCache() { } | 141 | public void ExpireFileCache() { } |
142 | |||
143 | #endregion | ||
96 | } | 144 | } |
97 | } | 145 | } |