aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Terrain
diff options
context:
space:
mode:
authorJak Daniels2015-11-18 18:18:30 +0000
committerUbitUmarov2015-11-22 01:32:36 +0000
commitcc992bf156ff9585e3a2f6a761711bf193d42eed (patch)
treed08b8b933001457aabb70cddcf3a2b98acf2d392 /OpenSim/Region/CoreModules/World/Terrain
parentChanges to TerrainChannel/ITerrainChannel to support importing OARs with diff... (diff)
downloadopensim-SC_OLD-cc992bf156ff9585e3a2f6a761711bf193d42eed.zip
opensim-SC_OLD-cc992bf156ff9585e3a2f6a761711bf193d42eed.tar.gz
opensim-SC_OLD-cc992bf156ff9585e3a2f6a761711bf193d42eed.tar.bz2
opensim-SC_OLD-cc992bf156ff9585e3a2f6a761711bf193d42eed.tar.xz
Changes to TerrainModule/ITerrainModule to support importing OARs with different Region sizes to the destination region.
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain')
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 5e35d95..275aa2a 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -456,6 +456,37 @@ namespace OpenSim.Region.CoreModules.World.Terrain
456 throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); 456 throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename));
457 } 457 }
458 458
459 public void LoadFromStream(string filename, Vector3 displacement,
460 float rotationDegrees, Vector2 boundingOrigin, Vector2 boundingSize, Stream stream)
461 {
462 foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
463 {
464 if (filename.EndsWith(loader.Key))
465 {
466 lock (m_scene)
467 {
468 try
469 {
470 ITerrainChannel channel = loader.Value.LoadStream(stream);
471 m_channel.MergeWithBounding(channel, displacement, rotationDegrees, boundingOrigin, boundingSize);
472 UpdateBakedMap();
473 }
474 catch (NotImplementedException)
475 {
476 m_log.Error("[TERRAIN]: Unable to load heightmap, the " + loader.Value +
477 " parser does not support file loading. (May be save only)");
478 throw new TerrainException(String.Format("unable to load heightmap: parser {0} does not support loading", loader.Value));
479 }
480 }
481
482 m_log.Info("[TERRAIN]: File (" + filename + ") loaded successfully");
483 return;
484 }
485 }
486 m_log.Error("[TERRAIN]: Unable to load heightmap, no file loader available for that format.");
487 throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename));
488 }
489
459 private static Stream URIFetch(Uri uri) 490 private static Stream URIFetch(Uri uri)
460 { 491 {
461 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 492 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);