Recast Navigation
Navigation-mesh Toolset for Games
RecastMesh.cpp File Reference
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "Recast.h"
#include "RecastAlloc.h"
#include "RecastAssert.h"

Classes

struct  rcEdge
 

Functions

static bool buildMeshAdjacency (unsigned short *polys, const int npolys, const int nverts, const int vertsPerPoly)
 
int computeVertexHash (int x, int y, int z)
 
static unsigned short addVertex (unsigned short x, unsigned short y, unsigned short z, unsigned short *verts, int *firstVert, int *nextVert, int &nv)
 
int prev (int i, int n)
 
int next (int i, int n)
 
int area2 (const int *a, const int *b, const int *c)
 
bool xorb (bool x, bool y)
 
bool left (const int *a, const int *b, const int *c)
 
bool leftOn (const int *a, const int *b, const int *c)
 
bool collinear (const int *a, const int *b, const int *c)
 
static bool intersectProp (const int *a, const int *b, const int *c, const int *d)
 
static bool between (const int *a, const int *b, const int *c)
 
static bool intersect (const int *a, const int *b, const int *c, const int *d)
 
static bool vequal (const int *a, const int *b)
 
static bool diagonalie (int i, int j, int n, const int *verts, int *indices)
 
static bool inCone (int i, int j, int n, const int *verts, int *indices)
 
static bool diagonal (int i, int j, int n, const int *verts, int *indices)
 
static bool diagonalieLoose (int i, int j, int n, const int *verts, int *indices)
 
static bool inConeLoose (int i, int j, int n, const int *verts, int *indices)
 
static bool diagonalLoose (int i, int j, int n, const int *verts, int *indices)
 
static int triangulate (int n, const int *verts, int *indices, int *tris)
 
static int countPolyVerts (const unsigned short *p, const int nvp)
 
bool uleft (const unsigned short *a, const unsigned short *b, const unsigned short *c)
 
static int getPolyMergeValue (unsigned short *pa, unsigned short *pb, const unsigned short *verts, int &ea, int &eb, const int nvp)
 
static void mergePolyVerts (unsigned short *pa, unsigned short *pb, int ea, int eb, unsigned short *tmp, const int nvp)
 
static void pushFront (int v, int *arr, int &an)
 
static void pushBack (int v, int *arr, int &an)
 
static bool canRemoveVertex (rcContext *ctx, rcPolyMesh &mesh, const unsigned short rem)
 
static bool removeVertex (rcContext *ctx, rcPolyMesh &mesh, const unsigned short rem, const int maxTris)
 
bool rcBuildPolyMesh (rcContext *ctx, const rcContourSet &cset, const int nvp, rcPolyMesh &mesh)
 Builds a polygon mesh from the provided contours. More...
 
bool rcMergePolyMeshes (rcContext *ctx, rcPolyMesh **meshes, const int nmeshes, rcPolyMesh &mesh)
 Merges multiple polygon meshes into a single mesh. More...
 
bool rcCopyPolyMesh (rcContext *ctx, const rcPolyMesh &src, rcPolyMesh &dst)
 Copies the poly mesh data from src to dst. More...
 

Variables

static const int VERTEX_BUCKET_COUNT = (1<<12)
 

Function Documentation

◆ addVertex()

static unsigned short addVertex ( unsigned short  x,
unsigned short  y,
unsigned short  z,
unsigned short *  verts,
int *  firstVert,
int *  nextVert,
int &  nv 
)
static

◆ area2()

int area2 ( const int *  a,
const int *  b,
const int *  c 
)
inline

◆ between()

static bool between ( const int *  a,
const int *  b,
const int *  c 
)
static

◆ buildMeshAdjacency()

static bool buildMeshAdjacency ( unsigned short *  polys,
const int  npolys,
const int  nverts,
const int  vertsPerPoly 
)
static

◆ canRemoveVertex()

static bool canRemoveVertex ( rcContext ctx,
rcPolyMesh mesh,
const unsigned short  rem 
)
static

◆ collinear()

bool collinear ( const int *  a,
const int *  b,
const int *  c 
)
inline

◆ computeVertexHash()

int computeVertexHash ( int  x,
int  y,
int  z 
)
inline

◆ countPolyVerts()

static int countPolyVerts ( const unsigned short *  p,
const int  nvp 
)
static

◆ diagonal()

static bool diagonal ( int  i,
int  j,
int  n,
const int *  verts,
int *  indices 
)
static

◆ diagonalie()

static bool diagonalie ( int  i,
int  j,
int  n,
const int *  verts,
int *  indices 
)
static

◆ diagonalieLoose()

static bool diagonalieLoose ( int  i,
int  j,
int  n,
const int *  verts,
int *  indices 
)
static

◆ diagonalLoose()

static bool diagonalLoose ( int  i,
int  j,
int  n,
const int *  verts,
int *  indices 
)
static

◆ getPolyMergeValue()

static int getPolyMergeValue ( unsigned short *  pa,
unsigned short *  pb,
const unsigned short *  verts,
int &  ea,
int &  eb,
const int  nvp 
)
static

◆ inCone()

static bool inCone ( int  i,
int  j,
int  n,
const int *  verts,
int *  indices 
)
static

◆ inConeLoose()

static bool inConeLoose ( int  i,
int  j,
int  n,
const int *  verts,
int *  indices 
)
static

◆ intersect()

static bool intersect ( const int *  a,
const int *  b,
const int *  c,
const int *  d 
)
static

◆ intersectProp()

static bool intersectProp ( const int *  a,
const int *  b,
const int *  c,
const int *  d 
)
static

◆ left()

bool left ( const int *  a,
const int *  b,
const int *  c 
)
inline

◆ leftOn()

bool leftOn ( const int *  a,
const int *  b,
const int *  c 
)
inline

◆ mergePolyVerts()

static void mergePolyVerts ( unsigned short *  pa,
unsigned short *  pb,
int  ea,
int  eb,
unsigned short *  tmp,
const int  nvp 
)
static

◆ next()

int next ( int  i,
int  n 
)
inline

◆ prev()

int prev ( int  i,
int  n 
)
inline

◆ pushBack()

static void pushBack ( int  v,
int *  arr,
int &  an 
)
static

◆ pushFront()

static void pushFront ( int  v,
int *  arr,
int &  an 
)
static

◆ removeVertex()

static bool removeVertex ( rcContext ctx,
rcPolyMesh mesh,
const unsigned short  rem,
const int  maxTris 
)
static

◆ triangulate()

static int triangulate ( int  n,
const int *  verts,
int *  indices,
int *  tris 
)
static

◆ uleft()

bool uleft ( const unsigned short *  a,
const unsigned short *  b,
const unsigned short *  c 
)
inline

◆ vequal()

static bool vequal ( const int *  a,
const int *  b 
)
static

◆ xorb()

bool xorb ( bool  x,
bool  y 
)
inline

Variable Documentation

◆ VERTEX_BUCKET_COUNT

const int VERTEX_BUCKET_COUNT = (1<<12)
static