forked from mirror/DotRecast
added static DefaultQueryHeuristic.Default
This commit is contained in:
parent
120c946a34
commit
9cf145a471
|
@ -21,14 +21,12 @@ using static DotRecast.Core.RcMath;
|
||||||
|
|
||||||
namespace DotRecast.Detour
|
namespace DotRecast.Detour
|
||||||
{
|
{
|
||||||
|
|
||||||
public class DefaultQueryHeuristic : IQueryHeuristic
|
public class DefaultQueryHeuristic : IQueryHeuristic
|
||||||
{
|
{
|
||||||
private readonly float scale;
|
public const float H_SCALE = 0.999f; // Search heuristic scale.
|
||||||
|
public static readonly DefaultQueryHeuristic Default = new DefaultQueryHeuristic(H_SCALE);
|
||||||
|
|
||||||
public DefaultQueryHeuristic() : this(0.999f)
|
private readonly float scale;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public DefaultQueryHeuristic(float scale)
|
public DefaultQueryHeuristic(float scale)
|
||||||
{
|
{
|
||||||
|
|
|
@ -766,13 +766,13 @@ namespace DotRecast.Detour
|
||||||
*/
|
*/
|
||||||
public virtual Result<List<long>> FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter)
|
public virtual Result<List<long>> FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter)
|
||||||
{
|
{
|
||||||
return FindPath(startRef, endRef, startPos, endPos, filter, new DefaultQueryHeuristic(), 0, 0);
|
return FindPath(startRef, endRef, startPos, endPos, filter, DefaultQueryHeuristic.Default, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Result<List<long>> FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter,
|
public virtual Result<List<long>> FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter,
|
||||||
int options, float raycastLimit)
|
int options, float raycastLimit)
|
||||||
{
|
{
|
||||||
return FindPath(startRef, endRef, startPos, endPos, filter, new DefaultQueryHeuristic(), options, raycastLimit);
|
return FindPath(startRef, endRef, startPos, endPos, filter, DefaultQueryHeuristic.Default, options, raycastLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result<List<long>> FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter,
|
public Result<List<long>> FindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter,
|
||||||
|
@ -1031,12 +1031,12 @@ namespace DotRecast.Detour
|
||||||
*/
|
*/
|
||||||
public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, int options)
|
public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, int options)
|
||||||
{
|
{
|
||||||
return InitSlicedFindPath(startRef, endRef, startPos, endPos, filter, options, new DefaultQueryHeuristic(), -1.0f);
|
return InitSlicedFindPath(startRef, endRef, startPos, endPos, filter, options, DefaultQueryHeuristic.Default, -1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, int options, float raycastLimit)
|
public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, int options, float raycastLimit)
|
||||||
{
|
{
|
||||||
return InitSlicedFindPath(startRef, endRef, startPos, endPos, filter, options, new DefaultQueryHeuristic(), raycastLimit);
|
return InitSlicedFindPath(startRef, endRef, startPos, endPos, filter, options, DefaultQueryHeuristic.Default, raycastLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, int options, IQueryHeuristic heuristic, float raycastLimit)
|
public DtStatus InitSlicedFindPath(long startRef, long endRef, RcVec3f startPos, RcVec3f endPos, IDtQueryFilter filter, int options, IQueryHeuristic heuristic, float raycastLimit)
|
||||||
|
|
Loading…
Reference in New Issue