add to thread
parent
7737270894
commit
a1ca6409dd
|
@ -7,11 +7,13 @@ using OpenSim.Region.Framework.Scenes;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
|
||||||
[assembly: Addin("BasicPathFindingModule", "0.1")]
|
[assembly: Addin("BasicPathFindingModule", "0.1")]
|
||||||
|
@ -131,26 +133,37 @@ namespace OpenSim.Modules.PathFinding
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ScriptInvocation]
|
private void createTestImage()
|
||||||
public string osCreateNewPathFindingScene(UUID hostID, UUID scriptID)
|
|
||||||
{
|
{
|
||||||
Bitmap _map = new Bitmap((int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY);
|
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 X = 0; X <= m_scene.RegionInfo.RegionSizeX; X++)
|
||||||
{
|
{
|
||||||
|
m_log.Info("X: " + X);
|
||||||
for (int Y = 0; Y <= m_scene.RegionInfo.RegionSizeY; Y++)
|
for (int Y = 0; Y <= m_scene.RegionInfo.RegionSizeY; Y++)
|
||||||
{
|
{
|
||||||
|
m_log.Info("Y: " + Y);
|
||||||
|
|
||||||
|
_map.SetPixel(X, Y, Color.Green);
|
||||||
|
|
||||||
float baseheight = (float)m_scene.Heightmap[X, Y];
|
float baseheight = (float)m_scene.Heightmap[X, Y];
|
||||||
|
|
||||||
if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight)
|
if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight)
|
||||||
_map.SetPixel(X, Y, Color.Red);
|
_map.SetPixel(X, Y, Color.Red);
|
||||||
|
|
||||||
//if (checkIsPositionBlockedByObjekts(new LSL_Vector(X, Y, 0)) == true)
|
//if (checkIsPositionBlockedByObjekts(new LSL_Vector(X, Y, 0)) == true)
|
||||||
//_map.SetPixel(X, Y, Color.Yellow);
|
//_map.SetPixel(X, Y, Color.Yellow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_map.Save("debug.png");
|
_map.Save("debug.png", ImageFormat.Png);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ScriptInvocation]
|
||||||
|
public string osCreateNewPathFindingScene(UUID hostID, UUID scriptID)
|
||||||
|
{
|
||||||
|
|
||||||
|
(new Thread(delegate () { createTestImage(); })).Start();
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue