diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs | 71 | ||||
-rw-r--r-- | prebuild.xml | 10 |
4 files changed, 59 insertions, 30 deletions
diff --git a/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs b/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs index 5dc1e78..284d9fe 100644 --- a/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs +++ b/OpenSim/Region/PhysicsModules/UbitMeshing/HelperTypes.cs | |||
@@ -30,8 +30,8 @@ using System.Collections.Generic; | |||
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | using System.Globalization; | 31 | using System.Globalization; |
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Region.Physics.Manager; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
34 | using OpenSim.Region.Physics.Meshing; | 34 | using OpenSim.Region.PhysicsModules.UbitMeshing; |
35 | 35 | ||
36 | public class Vertex : IComparable<Vertex> | 36 | public class Vertex : IComparable<Vertex> |
37 | { | 37 | { |
diff --git a/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs b/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs index 0418893..485de63 100644 --- a/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs +++ b/OpenSim/Region/PhysicsModules/UbitMeshing/Mesh.cs | |||
@@ -29,13 +29,13 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.PhysicsModules.SharedBase; |
33 | using PrimMesher; | 33 | using PrimMesher; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using System.Runtime.Serialization; | 35 | using System.Runtime.Serialization; |
36 | using System.Runtime.Serialization.Formatters.Binary; | 36 | using System.Runtime.Serialization.Formatters.Binary; |
37 | 37 | ||
38 | namespace OpenSim.Region.Physics.Meshing | 38 | namespace OpenSim.Region.PhysicsModules.UbitMeshing |
39 | { | 39 | { |
40 | public class MeshBuildingData | 40 | public class MeshBuildingData |
41 | { | 41 | { |
diff --git a/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs index c131c6f..7a728ce 100644 --- a/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/UbitMeshing/Meshmerizer.cs | |||
@@ -29,7 +29,9 @@ | |||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Region.Framework.Interfaces; | ||
34 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
33 | using OpenMetaverse; | 35 | using OpenMetaverse; |
34 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
35 | using System.Drawing; | 37 | using System.Drawing; |
@@ -41,36 +43,23 @@ using Nini.Config; | |||
41 | using System.Reflection; | 43 | using System.Reflection; |
42 | using System.IO; | 44 | using System.IO; |
43 | using ComponentAce.Compression.Libs.zlib; | 45 | using ComponentAce.Compression.Libs.zlib; |
44 | using OpenSim.Region.Physics.ConvexDecompositionDotNet; | ||
45 | using System.Runtime.Serialization; | 46 | using System.Runtime.Serialization; |
46 | using System.Runtime.Serialization.Formatters.Binary; | 47 | using System.Runtime.Serialization.Formatters.Binary; |
47 | 48 | ||
48 | namespace OpenSim.Region.Physics.Meshing | 49 | using Mono.Addins; |
49 | { | ||
50 | public class MeshmerizerPlugin : IMeshingPlugin | ||
51 | { | ||
52 | public MeshmerizerPlugin() | ||
53 | { | ||
54 | } | ||
55 | 50 | ||
56 | public string GetName() | 51 | namespace OpenSim.Region.PhysicsModules.UbitMeshing |
57 | { | 52 | { |
58 | return "UbitMeshmerizer"; | 53 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UbitMeshmerizer")] |
59 | } | 54 | public class UbitMeshmerizer : IMesher, INonSharedRegionModule |
60 | |||
61 | public IMesher GetMesher(IConfigSource config) | ||
62 | { | ||
63 | return new Meshmerizer(config); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | public class Meshmerizer : IMesher | ||
68 | { | 55 | { |
69 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 56 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
70 | 57 | ||
71 | // Setting baseDir to a path will enable the dumping of raw files | 58 | // Setting baseDir to a path will enable the dumping of raw files |
72 | // raw files can be imported by blender so a visual inspection of the results can be done | 59 | // raw files can be imported by blender so a visual inspection of the results can be done |
73 | 60 | ||
61 | private bool m_Enabled = false; | ||
62 | |||
74 | public object diskLock = new object(); | 63 | public object diskLock = new object(); |
75 | 64 | ||
76 | public bool doMeshFileCache = true; | 65 | public bool doMeshFileCache = true; |
@@ -89,7 +78,18 @@ namespace OpenSim.Region.Physics.Meshing | |||
89 | private Dictionary<AMeshKey, Mesh> m_uniqueMeshes = new Dictionary<AMeshKey, Mesh>(); | 78 | private Dictionary<AMeshKey, Mesh> m_uniqueMeshes = new Dictionary<AMeshKey, Mesh>(); |
90 | private Dictionary<AMeshKey, Mesh> m_uniqueReleasedMeshes = new Dictionary<AMeshKey, Mesh>(); | 79 | private Dictionary<AMeshKey, Mesh> m_uniqueReleasedMeshes = new Dictionary<AMeshKey, Mesh>(); |
91 | 80 | ||
92 | public Meshmerizer(IConfigSource config) | 81 | #region INonSharedRegionModule |
82 | public string Name | ||
83 | { | ||
84 | get { return "UbitMeshmerizer"; } | ||
85 | } | ||
86 | |||
87 | public Type ReplaceableInterface | ||
88 | { | ||
89 | get { return null; } | ||
90 | } | ||
91 | |||
92 | public void Initialise(IConfigSource config) | ||
93 | { | 93 | { |
94 | IConfig start_config = config.Configs["Startup"]; | 94 | IConfig start_config = config.Configs["Startup"]; |
95 | IConfig mesh_config = config.Configs["Mesh"]; | 95 | IConfig mesh_config = config.Configs["Mesh"]; |
@@ -118,7 +118,34 @@ namespace OpenSim.Region.Physics.Meshing | |||
118 | CacheExpire = TimeSpan.FromHours(fcache); | 118 | CacheExpire = TimeSpan.FromHours(fcache); |
119 | 119 | ||
120 | } | 120 | } |
121 | public void Close() | ||
122 | { | ||
123 | } | ||
124 | |||
125 | public void AddRegion(Scene scene) | ||
126 | { | ||
127 | if (!m_Enabled) | ||
128 | return; | ||
129 | |||
130 | scene.RegisterModuleInterface<IMesher>(this); | ||
131 | } | ||
121 | 132 | ||
133 | public void RemoveRegion(Scene scene) | ||
134 | { | ||
135 | if (!m_Enabled) | ||
136 | return; | ||
137 | |||
138 | scene.UnregisterModuleInterface<IMesher>(this); | ||
139 | } | ||
140 | |||
141 | public void RegionLoaded(Scene scene) | ||
142 | { | ||
143 | if (!m_Enabled) | ||
144 | return; | ||
145 | } | ||
146 | |||
147 | #endregion | ||
148 | |||
122 | /// <summary> | 149 | /// <summary> |
123 | /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may | 150 | /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may |
124 | /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail | 151 | /// 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 a9b9336..fdef5c5 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -414,10 +414,12 @@ | |||
414 | <Reference name="OpenSim.Framework"/> | 414 | <Reference name="OpenSim.Framework"/> |
415 | <Reference name="OpenSim.Framework.Console"/> | 415 | <Reference name="OpenSim.Framework.Console"/> |
416 | <Reference name="OpenSim.Region.PhysicsModules.SharedBase"/> | 416 | <Reference name="OpenSim.Region.PhysicsModules.SharedBase"/> |
417 | <Reference name="OpenSim.Region.Framework"/> | ||
417 | <Reference name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet"/> | 418 | <Reference name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet"/> |
418 | <Reference name="log4net" path="../../../../bin/"/> | ||
419 | <Reference name="zlib.net" path="../../../../bin/"/> | 419 | <Reference name="zlib.net" path="../../../../bin/"/> |
420 | 420 | <Reference name="Mono.Addins" path="../../../../bin/"/> | |
421 | <Reference name="log4net" path="../../../../bin/"/> | ||
422 | |||
421 | <Files> | 423 | <Files> |
422 | <Match pattern="*.cs" recurse="true"/> | 424 | <Match pattern="*.cs" recurse="true"/> |
423 | </Files> | 425 | </Files> |
@@ -1589,7 +1591,7 @@ | |||
1589 | </Files> | 1591 | </Files> |
1590 | </Project> | 1592 | </Project> |
1591 | 1593 | ||
1592 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet" path="OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet" type="Library"> | 1594 | <Project frameworkVersion="v4_0" name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet" path="OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet" type="Library"> |
1593 | <Configuration name="Debug"> | 1595 | <Configuration name="Debug"> |
1594 | <Options> | 1596 | <Options> |
1595 | <OutputPath>../../../../bin/</OutputPath> | 1597 | <OutputPath>../../../../bin/</OutputPath> |
@@ -1755,7 +1757,7 @@ | |||
1755 | <Reference name="OpenSim.Framework.Console"/> | 1757 | <Reference name="OpenSim.Framework.Console"/> |
1756 | <Reference name="OpenSim.Region.PhysicsModules.SharedBase"/> | 1758 | <Reference name="OpenSim.Region.PhysicsModules.SharedBase"/> |
1757 | <Reference name="OpenSim.Region.PhysicsModules.Meshing" path="../../../../bin/"/> | 1759 | <Reference name="OpenSim.Region.PhysicsModules.Meshing" path="../../../../bin/"/> |
1758 | <Reference name="OpenSim.Region.PhysicsModule.ConvexDecompositionDotNet"/> | 1760 | <Reference name="OpenSim.Region.PhysicsModules.ConvexDecompositionDotNet"/> |
1759 | <Reference name="Mono.Addins" path="../../../../bin/"/> | 1761 | <Reference name="Mono.Addins" path="../../../../bin/"/> |
1760 | <Reference name="BulletXNA.dll" path="../../../../bin/"/> | 1762 | <Reference name="BulletXNA.dll" path="../../../../bin/"/> |
1761 | <Reference name="log4net.dll" path="../../../../bin/"/> | 1763 | <Reference name="log4net.dll" path="../../../../bin/"/> |