From f111094d30a406f1ee9f21e484df4c6d87c3d675 Mon Sep 17 00:00:00 2001 From: Christopher Latza Date: Wed, 10 Jun 2020 21:35:28 +0200 Subject: [PATCH] change collor --- src/BasicPathFinding.cs | 17 +++++++++++++++++ src/PathFindingSceneGenerator.cs | 11 +++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/BasicPathFinding.cs b/src/BasicPathFinding.cs index 1e546f9..fb00a50 100644 --- a/src/BasicPathFinding.cs +++ b/src/BasicPathFinding.cs @@ -138,6 +138,21 @@ namespace OpenSim.Modules.PathFinding { Bitmap _map = new Bitmap((int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY); + for (int X = 0; X < m_scene.RegionInfo.RegionSizeX; X++) + { + for (int Y = 0; Y < m_scene.RegionInfo.RegionSizeY; Y++) + { + float baseheight = (float)m_scene.Heightmap[X, Y]; + + if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight) + _map.SetPixel(Y, X, Color.Blue); + + if (baseheight > m_scene.RegionInfo.RegionSettings.WaterHeight) + _map.SetPixel(Y, X, Color.Green); + } + } + + PathFindingSceneGenerator.DrawObjectVolume(m_scene, ref _map); _map.Save(imageName + ".png", ImageFormat.Png); @@ -159,6 +174,8 @@ namespace OpenSim.Modules.PathFinding if (_host != null) { + UUID tid = m_asyncCommands.DataserverPlugin.RegisterRequest(_host.LocalId, _host.GroupID, imageName); + (new Thread(delegate () { createPathFindingScene(imageName); })).Start(); } else diff --git a/src/PathFindingSceneGenerator.cs b/src/PathFindingSceneGenerator.cs index 90bfee6..54d9260 100644 --- a/src/PathFindingSceneGenerator.cs +++ b/src/PathFindingSceneGenerator.cs @@ -33,13 +33,20 @@ namespace OpenSim.Modules.PathFinding if (obj is SceneObjectGroup) { SceneObjectGroup mapdot = (SceneObjectGroup)obj; - Color mapdotspot = Color.Gray; // Default color when prim color is white + + if (mapdot.IsPhantom == true) + continue; + + Color mapdotspot = Color.Red; // Default color when prim color is white // Loop over prim in group foreach (SceneObjectPart part in mapdot.Parts) { if (part == null) continue; + if (part.Description.Contains("allowedpath")) + mapdotspot = Color.Green; + // Draw if the object is at least 1 meter wide in any direction if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) { @@ -79,7 +86,7 @@ namespace OpenSim.Modules.PathFinding try { // If the color gets goofy somehow, skip it *shakes fist at Color4 - mapdotspot = Color.FromArgb(colorr, colorg, colorb); + //mapdotspot = Color.FromArgb(colorr, colorg, colorb); } catch (ArgumentException) {