setPosition

master
Christopher Latza 2020-06-11 12:42:36 +02:00
parent ed93951ab4
commit f89af08c59
2 changed files with 9 additions and 2 deletions

View File

@ -122,10 +122,11 @@ namespace OpenSim.Modules.PathFinding
#region Script Funktions #region Script Funktions
private void createPathFindingScene(UUID script, UUID requestID, bool terrain) private void createPathFindingScene(UUID script, UUID requestID, bool terrain, Vector3 start, Vector3 target)
{ {
PathFinder _worker = new PathFinder(requestID, m_scene); PathFinder _worker = new PathFinder(requestID, m_scene);
_worker.preparePathFindingScene(terrain); _worker.preparePathFindingScene(terrain);
_worker.setPositions(new Vector2(start.X, start.Y), new Vector2(target.X, target.Y));
m_scriptModule.DispatchReply(script, 0, "", requestID.ToString()); m_scriptModule.DispatchReply(script, 0, "", requestID.ToString());
} }
@ -140,7 +141,7 @@ namespace OpenSim.Modules.PathFinding
useTerrain = true; useTerrain = true;
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID); SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
(new Thread(delegate () { createPathFindingScene(scriptID, requestKey, useTerrain); })).Start(); (new Thread(delegate () { createPathFindingScene(scriptID, requestKey, useTerrain, start, target); })).Start();
return requestKey.ToString(); return requestKey.ToString();
} }

View File

@ -29,6 +29,12 @@ namespace OpenSim.Modules.PathFinding
public void preparePathFindingScene(bool terrain) public void preparePathFindingScene(bool terrain)
{ {
convertRegionToBitmap(terrain); convertRegionToBitmap(terrain);
}
public void setPositions(Vector2 start, Vector2 target)
{
m_bitmap.SetPixel((int)start.X, (int)start.Y, Color.Green);
m_bitmap.SetPixel((int)target.X, (int)target.Y, Color.Red);
saveDebugImageToDisc(); saveDebugImageToDisc();
} }