From e590ca0dba5679d6940450885119909c85a2e280 Mon Sep 17 00:00:00 2001 From: ikpil Date: Wed, 23 Aug 2023 00:03:35 +0900 Subject: [PATCH] test remove all obstacle --- src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs b/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs index 4e027a7..77c5cb0 100644 --- a/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs +++ b/src/DotRecast.Recast.Toolset/Tools/RcObstacleTool.cs @@ -33,6 +33,15 @@ namespace DotRecast.Recast.Toolset.Tools { if (null == _tc) return; + + for (int i = 0; i < _tc.GetObstacleCount(); ++i) + { + DtTileCacheObstacle ob = _tc.GetObstacle(i); + if (ob.state == DtObstacleState.DT_OBSTACLE_EMPTY) + continue; + + _tc.RemoveObstacle(_tc.GetObstacleRef(ob)); + } } public void RemoveTempObstacle(RcVec3f sp, RcVec3f sq) @@ -48,7 +57,7 @@ namespace DotRecast.Recast.Toolset.Tools { if (null == _tc) return 0; - + p.y -= 0.5f; return _tc.AddObstacle(p, 1.0f, 2.0f); }