Recast Navigation  1.0.35
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 (const unsigned short *verts, const int, const unsigned short *polys, const int npolys, const int nvp, const float cs, const float ch, const int, dtBVNode *nodes)
 
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 dataSize)
 Swaps the endianess of the tile data's header (dtMeshHeader). More...
 
bool dtNavMeshDataSwapEndian (unsigned char *data, const int dataSize)
 Swaps endianess of the tile data. More...
 

Variables

static unsigned short MESH_NULL_IDX = 0xffff
 

Function Documentation

static void calcExtends ( BVItem items,
const int  ,
const int  imin,
const int  imax,
unsigned short *  bmin,
unsigned short *  bmax 
)
static
static unsigned char classifyOffMeshPoint ( const float *  pt,
const float *  bmin,
const float *  bmax 
)
static
static int compareItemX ( const void *  va,
const void *  vb 
)
static
static int compareItemY ( const void *  va,
const void *  vb 
)
static
static int compareItemZ ( const void *  va,
const void *  vb 
)
static
static int createBVTree ( const unsigned short *  verts,
const int  ,
const unsigned short *  polys,
const int  npolys,
const int  nvp,
const float  cs,
const float  ch,
const int  ,
dtBVNode nodes 
)
static
bool dtNavMeshDataSwapEndian ( unsigned char *  data,
const int  dataSize 
)

Swaps endianess of the tile data.

Warning
This function assumes that the header is in the correct endianess already. Call dtNavMeshHeaderSwapEndian() first on the data if the data is expected to be in wrong endianess to start with. Call dtNavMeshHeaderSwapEndian() after the data has been swapped if converting from native to foreign endianess.
bool dtNavMeshHeaderSwapEndian ( unsigned char *  data,
const int  dataSize 
)

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

int longestAxis ( unsigned short  x,
unsigned short  y,
unsigned short  z 
)
inline
static void subdivide ( BVItem items,
int  nitems,
int  imin,
int  imax,
int &  curNode,
dtBVNode nodes 
)
static

Variable Documentation

unsigned short MESH_NULL_IDX = 0xffff
static