diff --git a/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs b/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs index 5dc1e789ce..284d9fe687 100644 --- a/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs +++ b/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs @@ -30,8 +30,8 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using OpenMetaverse; -using OpenSim.Region.Physics.Manager; -using OpenSim.Region.Physics.Meshing; +using OpenSim.Region.PhysicsModules.SharedBase; +using OpenSim.Region.PhysicsModules.UbitMeshing; public class Vertex : IComparable { diff --git a/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs b/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs index 04188931e3..485de633b6 100644 --- a/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs +++ b/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs @@ -29,13 +29,13 @@ using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; -using OpenSim.Region.Physics.Manager; +using OpenSim.Region.PhysicsModules.SharedBase; using PrimMesher; using OpenMetaverse; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; -namespace OpenSim.Region.Physics.Meshing +namespace OpenSim.Region.PhysicsModules.UbitMeshing { public class MeshBuildingData { diff --git a/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs index c131c6f9b6..7a728ce289 100644 --- a/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs @@ -29,7 +29,9 @@ using System; using System.Collections.Generic; using OpenSim.Framework; -using OpenSim.Region.Physics.Manager; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.PhysicsModules.SharedBase; using OpenMetaverse; using OpenMetaverse.StructuredData; using System.Drawing; @@ -41,36 +43,23 @@ using Nini.Config; using System.Reflection; using System.IO; using ComponentAce.Compression.Libs.zlib; -using OpenSim.Region.Physics.ConvexDecompositionDotNet; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; -namespace OpenSim.Region.Physics.Meshing +using Mono.Addins; + +namespace OpenSim.Region.PhysicsModules.UbitMeshing { - public class MeshmerizerPlugin : IMeshingPlugin - { - public MeshmerizerPlugin() - { - } - - public string GetName() - { - return "UbitMeshmerizer"; - } - - public IMesher GetMesher(IConfigSource config) - { - return new Meshmerizer(config); - } - } - - public class Meshmerizer : IMesher + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UbitMeshmerizer")] + public class UbitMeshmerizer : IMesher, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // Setting baseDir to a path will enable the dumping of raw files // raw files can be imported by blender so a visual inspection of the results can be done + private bool m_Enabled = false; + public object diskLock = new object(); public bool doMeshFileCache = true; @@ -89,7 +78,18 @@ namespace OpenSim.Region.Physics.Meshing private Dictionary m_uniqueMeshes = new Dictionary(); private Dictionary m_uniqueReleasedMeshes = new Dictionary(); - public Meshmerizer(IConfigSource config) + #region INonSharedRegionModule + public string Name + { + get { return "UbitMeshmerizer"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource config) { IConfig start_config = config.Configs["Startup"]; IConfig mesh_config = config.Configs["Mesh"]; @@ -118,7 +118,34 @@ namespace OpenSim.Region.Physics.Meshing CacheExpire = TimeSpan.FromHours(fcache); } + public void Close() + { + } + public void AddRegion(Scene scene) + { + if (!m_Enabled) + return; + + scene.RegisterModuleInterface(this); + } + + public void RemoveRegion(Scene scene) + { + if (!m_Enabled) + return; + + scene.UnregisterModuleInterface(this); + } + + public void RegionLoaded(Scene scene) + { + if (!m_Enabled) + return; + } + + #endregion + /// /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail diff --git a/prebuild.xml b/prebuild.xml index a9b9336bca..fdef5c5e44 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -414,10 +414,12 @@ + - - + + + @@ -1589,7 +1591,7 @@ - + ../../../../bin/ @@ -1755,7 +1757,7 @@ - +