diff options
author | Robert Adams | 2015-09-08 04:54:16 -0700 |
---|---|---|
committer | Robert Adams | 2015-09-08 04:54:16 -0700 |
commit | e5367d822be9b05e74c859afe2d2956a3e95aa33 (patch) | |
tree | e904050a30715df587aa527d7f313755177726a7 /OpenSim/Region/PhysicsModules/Meshing | |
parent | add lost admin_reset_land method (diff) | |
parent | Deleted access control spec from [LoginService] section of standalone config.... (diff) | |
download | opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.zip opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.gz opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.bz2 opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.xz |
Merge of ubitworkvarnew with opensim/master as of 20150905.
This integrates the OpenSim refactoring to make physics, etc into modules.
AVN physics hasn't been moved to new location.
Does not compile yet.
Merge branch 'osmaster' into mbworknew1
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/HelperTypes.cs (renamed from OpenSim/Region/Physics/Meshing/HelperTypes.cs) | 4 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Mesh.cs (renamed from OpenSim/Region/Physics/Meshing/Mesh.cs) | 4 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs (renamed from OpenSim/Region/Physics/Meshing/Meshmerizer.cs) | 116 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/PrimMesher.cs (renamed from OpenSim/Region/Physics/Meshing/PrimMesher.cs) | 0 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMap.cs (renamed from OpenSim/Region/Physics/Meshing/SculptMap.cs) | 0 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMesh.cs (renamed from OpenSim/Region/Physics/Meshing/SculptMesh.cs) | 0 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/Properties/AssemblyInfo.cs (renamed from OpenSim/Region/RegionCombinerModule/Properties/AssemblyInfo.cs) | 6 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Meshing/ZeroMesher.cs (renamed from OpenSim/Region/Physics/Manager/ZeroMesher.cs) | 68 |
8 files changed, 142 insertions, 56 deletions
diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/HelperTypes.cs index 8cd8dcf..34a925d 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/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.Meshing; |
35 | 35 | ||
36 | public class Vertex : IComparable<Vertex> | 36 | public class Vertex : IComparable<Vertex> |
37 | { | 37 | { |
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Mesh.cs index e6b32e7..8c97f2f 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Mesh.cs | |||
@@ -29,11 +29,11 @@ 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 | 35 | ||
36 | namespace OpenSim.Region.Physics.Meshing | 36 | namespace OpenSim.Region.PhysicsModules.Meshing |
37 | { | 37 | { |
38 | public class Mesh : IMesh | 38 | public class Mesh : IMesh |
39 | { | 39 | { |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs index ef6482a..bae3449 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/Meshmerizer.cs | |||
@@ -28,8 +28,12 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | ||
32 | using System.IO; | ||
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
32 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | using OpenSim.Region.PhysicsModules.SharedBase; | ||
33 | using OpenMetaverse; | 37 | using OpenMetaverse; |
34 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
35 | using System.Drawing; | 39 | using System.Drawing; |
@@ -38,29 +42,12 @@ using System.IO.Compression; | |||
38 | using PrimMesher; | 42 | using PrimMesher; |
39 | using log4net; | 43 | using log4net; |
40 | using Nini.Config; | 44 | using Nini.Config; |
41 | using System.Reflection; | 45 | using Mono.Addins; |
42 | using System.IO; | ||
43 | 46 | ||
44 | namespace OpenSim.Region.Physics.Meshing | 47 | namespace OpenSim.Region.PhysicsModules.Meshing |
45 | { | 48 | { |
46 | public class MeshmerizerPlugin : IMeshingPlugin | 49 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "Meshmerizer")] |
47 | { | 50 | public class Meshmerizer : IMesher, INonSharedRegionModule |
48 | public MeshmerizerPlugin() | ||
49 | { | ||
50 | } | ||
51 | |||
52 | public string GetName() | ||
53 | { | ||
54 | return "Meshmerizer"; | ||
55 | } | ||
56 | |||
57 | public IMesher GetMesher(IConfigSource config) | ||
58 | { | ||
59 | return new Meshmerizer(config); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | public class Meshmerizer : IMesher | ||
64 | { | 51 | { |
65 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 52 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
66 | private static string LogHeader = "[MESH]"; | 53 | private static string LogHeader = "[MESH]"; |
@@ -72,6 +59,8 @@ namespace OpenSim.Region.Physics.Meshing | |||
72 | #else | 59 | #else |
73 | private const string baseDir = null; //"rawFiles"; | 60 | private const string baseDir = null; //"rawFiles"; |
74 | #endif | 61 | #endif |
62 | private bool m_Enabled = false; | ||
63 | |||
75 | // If 'true', lots of DEBUG logging of asset parsing details | 64 | // If 'true', lots of DEBUG logging of asset parsing details |
76 | private bool debugDetail = false; | 65 | private bool debugDetail = false; |
77 | 66 | ||
@@ -87,30 +76,79 @@ namespace OpenSim.Region.Physics.Meshing | |||
87 | // Mesh cache. Static so it can be shared across instances of this class | 76 | // Mesh cache. Static so it can be shared across instances of this class |
88 | private static Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); | 77 | private static Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); |
89 | 78 | ||
90 | public Meshmerizer(IConfigSource config) | 79 | #region INonSharedRegionModule |
80 | public string Name | ||
91 | { | 81 | { |
92 | IConfig start_config = config.Configs["Startup"]; | 82 | get { return "Meshmerizer"; } |
93 | IConfig mesh_config = config.Configs["Mesh"]; | 83 | } |
94 | 84 | ||
95 | decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); | 85 | public Type ReplaceableInterface |
96 | cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); | 86 | { |
97 | if (mesh_config != null) | 87 | get { return null; } |
98 | { | 88 | } |
99 | useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); | ||
100 | debugDetail = mesh_config.GetBoolean("LogMeshDetails", debugDetail); | ||
101 | } | ||
102 | 89 | ||
103 | try | 90 | public void Initialise(IConfigSource source) |
104 | { | 91 | { |
105 | if (!Directory.Exists(decodedSculptMapPath)) | 92 | IConfig config = source.Configs["Startup"]; |
106 | Directory.CreateDirectory(decodedSculptMapPath); | 93 | if (config != null) |
107 | } | ||
108 | catch (Exception e) | ||
109 | { | 94 | { |
110 | m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message); | 95 | string mesher = config.GetString("meshing", string.Empty); |
96 | if (mesher == Name) | ||
97 | { | ||
98 | m_Enabled = true; | ||
99 | |||
100 | IConfig mesh_config = source.Configs["Mesh"]; | ||
101 | |||
102 | decodedSculptMapPath = config.GetString("DecodedSculptMapPath", "j2kDecodeCache"); | ||
103 | cacheSculptMaps = config.GetBoolean("CacheSculptMaps", cacheSculptMaps); | ||
104 | if (mesh_config != null) | ||
105 | { | ||
106 | useMeshiesPhysicsMesh = mesh_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); | ||
107 | debugDetail = mesh_config.GetBoolean("LogMeshDetails", debugDetail); | ||
108 | } | ||
109 | |||
110 | try | ||
111 | { | ||
112 | if (!Directory.Exists(decodedSculptMapPath)) | ||
113 | Directory.CreateDirectory(decodedSculptMapPath); | ||
114 | } | ||
115 | catch (Exception e) | ||
116 | { | ||
117 | m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message); | ||
118 | } | ||
119 | |||
120 | } | ||
111 | } | 121 | } |
112 | } | 122 | } |
113 | 123 | ||
124 | public void Close() | ||
125 | { | ||
126 | } | ||
127 | |||
128 | public void AddRegion(Scene scene) | ||
129 | { | ||
130 | if (!m_Enabled) | ||
131 | return; | ||
132 | |||
133 | scene.RegisterModuleInterface<IMesher>(this); | ||
134 | } | ||
135 | |||
136 | public void RemoveRegion(Scene scene) | ||
137 | { | ||
138 | if (!m_Enabled) | ||
139 | return; | ||
140 | |||
141 | scene.UnregisterModuleInterface<IMesher>(this); | ||
142 | } | ||
143 | |||
144 | public void RegionLoaded(Scene scene) | ||
145 | { | ||
146 | if (!m_Enabled) | ||
147 | return; | ||
148 | } | ||
149 | #endregion | ||
150 | |||
151 | |||
114 | /// <summary> | 152 | /// <summary> |
115 | /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may | 153 | /// creates a simple box mesh of the specified size. This mesh is of very low vertex count and may |
116 | /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail | 154 | /// be useful as a backup proxy when level of detail is not needed or when more complex meshes fail |
diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/PrimMesher.cs index 4049ee1..4049ee1 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/PrimMesher.cs | |||
diff --git a/OpenSim/Region/Physics/Meshing/SculptMap.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMap.cs index b3d9cb6..b3d9cb6 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMap.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMap.cs | |||
diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMesh.cs index 4a7f3ad..4a7f3ad 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Meshmerizer/SculptMesh.cs | |||
diff --git a/OpenSim/Region/RegionCombinerModule/Properties/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/Meshing/Properties/AssemblyInfo.cs index 11b89d2..d6ac8b2 100644 --- a/OpenSim/Region/RegionCombinerModule/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/Meshing/Properties/AssemblyInfo.cs | |||
@@ -6,7 +6,7 @@ using Mono.Addins; | |||
6 | // General Information about an assembly is controlled through the following | 6 | // General Information about an assembly is controlled through the following |
7 | // set of attributes. Change these attribute values to modify the information | 7 | // set of attributes. Change these attribute values to modify the information |
8 | // associated with an assembly. | 8 | // associated with an assembly. |
9 | [assembly: AssemblyTitle("OpenSim.Region.RegionCombinerModule")] | 9 | [assembly: AssemblyTitle("OpenSim.Region.PhysicsModules.Meshing")] |
10 | [assembly: AssemblyDescription("")] | 10 | [assembly: AssemblyDescription("")] |
11 | [assembly: AssemblyConfiguration("")] | 11 | [assembly: AssemblyConfiguration("")] |
12 | [assembly: AssemblyCompany("http://opensimulator.org")] | 12 | [assembly: AssemblyCompany("http://opensimulator.org")] |
@@ -21,7 +21,7 @@ using Mono.Addins; | |||
21 | [assembly: ComVisible(false)] | 21 | [assembly: ComVisible(false)] |
22 | 22 | ||
23 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
24 | [assembly: Guid("73c166d2-c9d8-4ab8-af4e-89c41b4b58a9")] | 24 | [assembly: Guid("4b7e35c2-a9dd-4b10-b778-eb417f4f6884")] |
25 | 25 | ||
26 | // Version information for an assembly consists of the following four values: | 26 | // Version information for an assembly consists of the following four values: |
27 | // | 27 | // |
@@ -32,5 +32,5 @@ using Mono.Addins; | |||
32 | // | 32 | // |
33 | [assembly: AssemblyVersion("0.8.2.*")] | 33 | [assembly: AssemblyVersion("0.8.2.*")] |
34 | 34 | ||
35 | [assembly: Addin("OpenSim.RegionModules.RegionCombinerModule", OpenSim.VersionInfo.VersionNumber)] | 35 | [assembly: Addin("OpenSim.Region.PhysicsModules.Meshing", OpenSim.VersionInfo.VersionNumber)] |
36 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] | 36 | [assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] |
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 | } |