forked from mirror/DotRecast
add DT_VERTS_PER_POLYGON
This commit is contained in:
parent
1b4f5af155
commit
aeefed7fbb
|
@ -4,6 +4,10 @@ namespace DotRecast.Detour
|
||||||
{
|
{
|
||||||
public static class DtDetour
|
public static class DtDetour
|
||||||
{
|
{
|
||||||
|
/// The maximum number of vertices per navigation polygon.
|
||||||
|
/// @ingroup detour
|
||||||
|
public const int DT_VERTS_PER_POLYGON = 6;
|
||||||
|
|
||||||
/** A magic number used to detect compatibility of navigation tile data. */
|
/** A magic number used to detect compatibility of navigation tile data. */
|
||||||
public const int DT_NAVMESH_MAGIC = 'D' << 24 | 'N' << 16 | 'A' << 8 | 'V';
|
public const int DT_NAVMESH_MAGIC = 'D' << 24 | 'N' << 16 | 'A' << 8 | 'V';
|
||||||
|
|
||||||
|
|
|
@ -111,8 +111,11 @@ namespace DotRecast.Detour
|
||||||
node.bmin = minmax[0];
|
node.bmin = minmax[0];
|
||||||
node.bmax = minmax[1];
|
node.bmax = minmax[1];
|
||||||
|
|
||||||
int axis = LongestAxis(node.bmax[0] - node.bmin[0], node.bmax[1] - node.bmin[1],
|
int axis = LongestAxis(
|
||||||
node.bmax[2] - node.bmin[2]);
|
node.bmax[0] - node.bmin[0],
|
||||||
|
node.bmax[1] - node.bmin[1],
|
||||||
|
node.bmax[2] - node.bmin[2]
|
||||||
|
);
|
||||||
|
|
||||||
if (axis == 0)
|
if (axis == 0)
|
||||||
{
|
{
|
||||||
|
@ -253,14 +256,15 @@ namespace DotRecast.Detour
|
||||||
return 0xff;
|
return 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// TODO: Better error handling.
|
||||||
* Builds navigation mesh tile data from the provided tile creation data.
|
|
||||||
*
|
/// @par
|
||||||
* @param option
|
///
|
||||||
* Tile creation data.
|
/// The output data array is allocated using the detour allocator (dtAlloc()). The method
|
||||||
*
|
/// used to free the memory will be determined by how the tile is added to the navigation
|
||||||
* @return created tile data
|
/// mesh.
|
||||||
*/
|
///
|
||||||
|
/// @see dtNavMesh, dtNavMesh::addTile()
|
||||||
public static DtMeshData CreateNavMeshData(DtNavMeshCreateParams option)
|
public static DtMeshData CreateNavMeshData(DtNavMeshCreateParams option)
|
||||||
{
|
{
|
||||||
if (option.vertCount >= 0xffff)
|
if (option.vertCount >= 0xffff)
|
||||||
|
|
Loading…
Reference in New Issue