aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorBlueWall2010-09-25 22:36:38 -0400
committerMelanie2010-09-26 17:04:11 +0100
commitb0b4782a2b3c7a86195ad09c1c508856c2885f4d (patch)
treec8a1fcd118540b07fb5f30d5a15d8dd0bbbba04e /OpenSim
parentSome cleanup to OpenSimDefaults.ini (diff)
downloadopensim-SC-b0b4782a2b3c7a86195ad09c1c508856c2885f4d.zip
opensim-SC-b0b4782a2b3c7a86195ad09c1c508856c2885f4d.tar.gz
opensim-SC-b0b4782a2b3c7a86195ad09c1c508856c2885f4d.tar.bz2
opensim-SC-b0b4782a2b3c7a86195ad09c1c508856c2885f4d.tar.xz
adding configurable j2kDecodeCache path
allowing the decoded sculpt map cache path to be defined in the configuration files. Use DecodedSculpMapPath in the [Startup] section to set the path. The default is still ./bin/j2kDecodeCache
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs4
-rw-r--r--OpenSim/Region/Physics/Manager/ZeroMesher.cs3
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs13
-rw-r--r--OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs6
4 files changed, 18 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index 7130a3e..3763696 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Manager
81 if (_MeshPlugins.ContainsKey(meshEngineName)) 81 if (_MeshPlugins.ContainsKey(meshEngineName))
82 { 82 {
83 m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); 83 m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
84 meshEngine = _MeshPlugins[meshEngineName].GetMesher(); 84 meshEngine = _MeshPlugins[meshEngineName].GetMesher(config);
85 } 85 }
86 else 86 else
87 { 87 {
@@ -234,6 +234,6 @@ namespace OpenSim.Region.Physics.Manager
234 public interface IMeshingPlugin 234 public interface IMeshingPlugin
235 { 235 {
236 string GetName(); 236 string GetName();
237 IMesher GetMesher(); 237 IMesher GetMesher(IConfigSource config);
238 } 238 }
239} 239}
diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/Physics/Manager/ZeroMesher.cs
index e6e75f9..ba19db6 100644
--- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs
+++ b/OpenSim/Region/Physics/Manager/ZeroMesher.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31using Nini.Config;
31 32
32/* 33/*
33 * This is the zero mesher. 34 * This is the zero mesher.
@@ -53,7 +54,7 @@ namespace OpenSim.Region.Physics.Manager
53 return "ZeroMesher"; 54 return "ZeroMesher";
54 } 55 }
55 56
56 public IMesher GetMesher() 57 public IMesher GetMesher(IConfigSource config)
57 { 58 {
58 return new ZeroMesher(); 59 return new ZeroMesher();
59 } 60 }
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index fded95e..62f947c 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -35,6 +35,7 @@ using System.Drawing;
35using System.Drawing.Imaging; 35using System.Drawing.Imaging;
36using PrimMesher; 36using PrimMesher;
37using log4net; 37using log4net;
38using Nini.Config;
38using System.Reflection; 39using System.Reflection;
39using System.IO; 40using System.IO;
40 41
@@ -51,9 +52,9 @@ namespace OpenSim.Region.Physics.Meshing
51 return "Meshmerizer"; 52 return "Meshmerizer";
52 } 53 }
53 54
54 public IMesher GetMesher() 55 public IMesher GetMesher(IConfigSource config)
55 { 56 {
56 return new Meshmerizer(); 57 return new Meshmerizer(config);
57 } 58 }
58 } 59 }
59 60
@@ -70,14 +71,18 @@ namespace OpenSim.Region.Physics.Meshing
70#endif 71#endif
71 72
72 private bool cacheSculptMaps = true; 73 private bool cacheSculptMaps = true;
73 private string decodedScultMapPath = "j2kDecodeCache"; 74 private string decodedScultMapPath = null;
74 75
75 private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh 76 private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh
76 77
77 private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); 78 private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>();
78 79
79 public Meshmerizer() 80 public Meshmerizer(IConfigSource config)
80 { 81 {
82 IConfig start_config = config.Configs["Startup"];
83
84 decodedScultMapPath = start_config.GetString("DecodedSculpMapPath","j2kDecodeCache");
85
81 try 86 try
82 { 87 {
83 if (!Directory.Exists(decodedScultMapPath)) 88 if (!Directory.Exists(decodedScultMapPath))
diff --git a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs
index 69e2d03..ab8f8bf 100644
--- a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs
+++ b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs
@@ -48,6 +48,10 @@ namespace OpenSim.Region.Physics.OdePlugin
48 [SetUp] 48 [SetUp]
49 public void Initialize() 49 public void Initialize()
50 { 50 {
51 IConfigSource TopConfig = new IniConfigSource();
52 IConfig config = TopConfig.AddConfig("Startup");
53 config.Set("DecodedSculpMapPath","j2kDecodeCache");
54
51 // Loading ODEPlugin 55 // Loading ODEPlugin
52 cbt = new OdePlugin(); 56 cbt = new OdePlugin();
53 // Loading Zero Mesher 57 // Loading Zero Mesher
@@ -55,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin
55 // Getting Physics Scene 59 // Getting Physics Scene
56 ps = cbt.GetScene("test"); 60 ps = cbt.GetScene("test");
57 // Initializing Physics Scene. 61 // Initializing Physics Scene.
58 ps.Initialise(imp.GetMesher(),null); 62 ps.Initialise(imp.GetMesher(TopConfig),null);
59 float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; 63 float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
60 for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) 64 for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
61 { 65 {