adding obstacle tool

This commit is contained in:
ikpil 2023-07-29 10:44:24 +09:00
parent 12dfb27538
commit b115f816b4
4 changed files with 70 additions and 5 deletions

View File

@ -383,6 +383,7 @@ public class RecastDemo : IRecastDemoChannel
toolset = new RcToolsetView( toolset = new RcToolsetView(
new TestNavmeshTool(), new TestNavmeshTool(),
new TileTool(), new TileTool(),
new ObstacleTool(),
new OffMeshConnectionTool(), new OffMeshConnectionTool(),
new ConvexVolumeTool(), new ConvexVolumeTool(),
new CrowdTool(), new CrowdTool(),

View File

@ -28,14 +28,9 @@ public interface IRcTool
{ {
ISampleTool GetTool(); ISampleTool GetTool();
void OnSampleChanged(); void OnSampleChanged();
void Layout(); void Layout();
void HandleClick(RcVec3f s, RcVec3f p, bool shift); void HandleClick(RcVec3f s, RcVec3f p, bool shift);
void HandleRender(NavMeshRenderer renderer); void HandleRender(NavMeshRenderer renderer);
void HandleUpdate(float dt); void HandleUpdate(float dt);
void HandleClickRay(RcVec3f start, RcVec3f direction, bool shift); void HandleClickRay(RcVec3f start, RcVec3f direction, bool shift);
} }

View File

@ -0,0 +1,47 @@
using DotRecast.Core;
using DotRecast.Recast.Demo.Draw;
using DotRecast.Recast.DemoTool;
using DotRecast.Recast.DemoTool.Tools;
using Serilog;
namespace DotRecast.Recast.Demo.Tools;
public class ObstacleTool : IRcTool
{
private static readonly ILogger Logger = Log.ForContext<ObstacleTool>();
private readonly ObstacleToolImpl _impl;
public ObstacleTool()
{
_impl = new();
}
public ISampleTool GetTool()
{
return _impl;
}
public void OnSampleChanged()
{
}
public void Layout()
{
}
public void HandleClick(RcVec3f s, RcVec3f p, bool shift)
{
}
public void HandleRender(NavMeshRenderer renderer)
{
}
public void HandleUpdate(float dt)
{
}
public void HandleClickRay(RcVec3f start, RcVec3f direction, bool shift)
{
}
}

View File

@ -0,0 +1,22 @@
namespace DotRecast.Recast.DemoTool.Tools
{
public class ObstacleToolImpl : ISampleTool
{
private Sample _sample;
public string GetName()
{
return "Create Temp Obstacles";
}
public void SetSample(Sample sample)
{
_sample = sample;
}
public Sample GetSample()
{
return _sample;
}
}
}