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

Classes

struct  rcContourHole
 
struct  rcContourRegion
 
struct  rcPotentialDiagonal
 

Functions

static int getCornerHeight (int x, int y, int i, int dir, const rcCompactHeightfield &chf, bool &isBorderVertex)
 
static void walkContour (int x, int y, int i, const rcCompactHeightfield &chf, unsigned char *flags, rcIntArray &points)
 
static float distancePtSeg (const int x, const int z, const int px, const int pz, const int qx, const int qz)
 
static void simplifyContour (rcIntArray &points, rcIntArray &simplified, const float maxError, const int maxEdgeLen, const int buildFlags)
 
static int calcAreaOfPolygon2D (const int *verts, const int nverts)
 
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 intersectSegContour (const int *d0, const int *d1, int i, int n, const int *verts)
 
static bool inCone (int i, int n, const int *verts, const int *pj)
 
static void removeDegenerateSegments (rcIntArray &simplified)
 
static bool mergeContours (rcContour &ca, rcContour &cb, int ia, int ib)
 
static void findLeftMostVertex (rcContour *contour, int *minx, int *minz, int *leftmost)
 
static int compareHoles (const void *va, const void *vb)
 
static int compareDiagDist (const void *va, const void *vb)
 
static void mergeRegionHoles (rcContext *ctx, rcContourRegion &region)
 
bool rcBuildContours (rcContext *ctx, const rcCompactHeightfield &chf, const float maxError, const int maxEdgeLen, rcContourSet &cset, const int buildFlags)
 Builds a contour set from the region outlines in the provided compact heightfield. More...
 

Function Documentation

◆ 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

◆ calcAreaOfPolygon2D()

static int calcAreaOfPolygon2D ( const int *  verts,
const int  nverts 
)
static

◆ collinear()

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

◆ compareDiagDist()

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

◆ compareHoles()

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

◆ distancePtSeg()

static float distancePtSeg ( const int  x,
const int  z,
const int  px,
const int  pz,
const int  qx,
const int  qz 
)
static

◆ findLeftMostVertex()

static void findLeftMostVertex ( rcContour contour,
int *  minx,
int *  minz,
int *  leftmost 
)
static

◆ getCornerHeight()

static int getCornerHeight ( int  x,
int  y,
int  i,
int  dir,
const rcCompactHeightfield chf,
bool &  isBorderVertex 
)
static

◆ inCone()

static bool inCone ( int  i,
int  n,
const int *  verts,
const int *  pj 
)
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

◆ intersectSegContour()

static bool intersectSegContour ( const int *  d0,
const int *  d1,
int  i,
int  n,
const int *  verts 
)
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

◆ mergeContours()

static bool mergeContours ( rcContour ca,
rcContour cb,
int  ia,
int  ib 
)
static

◆ mergeRegionHoles()

static void mergeRegionHoles ( rcContext ctx,
rcContourRegion region 
)
static

◆ next()

int next ( int  i,
int  n 
)
inline

◆ prev()

int prev ( int  i,
int  n 
)
inline

◆ removeDegenerateSegments()

static void removeDegenerateSegments ( rcIntArray simplified)
static

◆ simplifyContour()

static void simplifyContour ( rcIntArray points,
rcIntArray simplified,
const float  maxError,
const int  maxEdgeLen,
const int  buildFlags 
)
static

◆ vequal()

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

◆ walkContour()

static void walkContour ( int  x,
int  y,
int  i,
const rcCompactHeightfield chf,
unsigned char *  flags,
rcIntArray points 
)
static

◆ xorb()

bool xorb ( bool  x,
bool  y 
)
inline