Recast Navigation
Navigation-mesh Toolset for Games
DetourNavMeshBuilder.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include "DetourNavMesh.h"
#include "DetourCommon.h"
#include "DetourMath.h"
#include "DetourNavMeshBuilder.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"

Classes

struct  BVItem
 

Functions

static int compareItemX (const void *va, const void *vb)
 
static int compareItemY (const void *va, const void *vb)
 
static int compareItemZ (const void *va, const void *vb)
 
static void calcExtends (BVItem *items, const int, const int imin, const int imax, unsigned short *bmin, unsigned short *bmax)
 
int longestAxis (unsigned short x, unsigned short y, unsigned short z)
 
static void subdivide (BVItem *items, int nitems, int imin, int imax, int &curNode, dtBVNode *nodes)
 
static int createBVTree (dtNavMeshCreateParams *params, dtBVNode *nodes, int)
 
static unsigned char classifyOffMeshPoint (const float *pt, const float *bmin, const float *bmax)
 
bool dtCreateNavMeshData (dtNavMeshCreateParams *params, unsigned char **outData, int *outDataSize)
 Builds navigation mesh tile data from the provided tile creation data. More...
 
bool dtNavMeshHeaderSwapEndian (unsigned char *data, const int)
 Swaps the endianness of the tile data's header (dtMeshHeader). More...
 
bool dtNavMeshDataSwapEndian (unsigned char *data, const int)
 Swaps endianness of the tile data. More...
 

Variables

static unsigned short MESH_NULL_IDX = 0xffff
 

Function Documentation

◆ calcExtends()

static void calcExtends ( BVItem items,
const int  ,
const int  imin,
const int  imax,
unsigned short *  bmin,
unsigned short *  bmax 
)
static

◆ classifyOffMeshPoint()

static unsigned char classifyOffMeshPoint ( const float *  pt,
const float *  bmin,
const float *  bmax 
)
static

◆ compareItemX()

static int compareItemX ( const void *  va,
const void *  vb 
)
static

◆ compareItemY()

static int compareItemY ( const void *  va,
const void *  vb 
)
static

◆ compareItemZ()

static int compareItemZ ( const void *  va,
const void *  vb 
)
static

◆ createBVTree()

static int createBVTree ( dtNavMeshCreateParams params,
dtBVNode nodes,
int   
)
static

◆ dtNavMeshDataSwapEndian()

bool dtNavMeshDataSwapEndian ( unsigned char *  data,
const int  dataSize 
)

Swaps endianness of the tile data.

Warning
This function assumes that the header is in the correct endianness already. Call dtNavMeshHeaderSwapEndian() first on the data if the data is expected to be in wrong endianness to start with. Call dtNavMeshHeaderSwapEndian() after the data has been swapped if converting from native to foreign endianness.

◆ dtNavMeshHeaderSwapEndian()

bool dtNavMeshHeaderSwapEndian ( unsigned char *  data,
const int  dataSize 
)

Swaps the endianness of the tile data's header (dtMeshHeader).

Parameters
[in,out]dataThe tile data array.
[in]dataSizeThe size of the data array.

◆ longestAxis()

int longestAxis ( unsigned short  x,
unsigned short  y,
unsigned short  z 
)
inline

◆ subdivide()

static void subdivide ( BVItem items,
int  nitems,
int  imin,
int  imax,
int &  curNode,
dtBVNode nodes 
)
static

Variable Documentation

◆ MESH_NULL_IDX

unsigned short MESH_NULL_IDX = 0xffff
static