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

Classes

struct  rcHeightPatch
 

Enumerations

enum  EdgeValues { EV_UNDEF = -1 , EV_HULL = -2 }
 

Functions

float vdot2 (const float *a, const float *b)
 
float vdistSq2 (const float *p, const float *q)
 
float vdist2 (const float *p, const float *q)
 
float vcross2 (const float *p1, const float *p2, const float *p3)
 
static bool circumCircle (const float *p1, const float *p2, const float *p3, float *c, float &r)
 
static float distPtTri (const float *p, const float *a, const float *b, const float *c)
 
static float distancePtSeg (const float *pt, const float *p, const float *q)
 
static float distancePtSeg2d (const float *pt, const float *p, const float *q)
 
static float distToTriMesh (const float *p, const float *verts, const int, const int *tris, const int ntris)
 
static float distToPoly (int nvert, const float *verts, const float *p)
 
static unsigned short getHeight (const float fx, const float fy, const float fz, const float, const float ics, const float ch, const int radius, const rcHeightPatch &hp)
 
static int findEdge (const int *edges, int nedges, int s, int t)
 
static int addEdge (rcContext *ctx, int *edges, int &nedges, const int maxEdges, int s, int t, int l, int r)
 
static void updateLeftFace (int *e, int s, int t, int f)
 
static int overlapSegSeg2d (const float *a, const float *b, const float *c, const float *d)
 
static bool overlapEdges (const float *pts, const int *edges, int nedges, int s1, int t1)
 
static void completeFacet (rcContext *ctx, const float *pts, int npts, int *edges, int &nedges, const int maxEdges, int &nfaces, int e)
 
static void delaunayHull (rcContext *ctx, const int npts, const float *pts, const int nhull, const int *hull, rcIntArray &tris, rcIntArray &edges)
 
static float polyMinExtent (const float *verts, const int nverts)
 
int prev (int i, int n)
 
int next (int i, int n)
 
static void triangulateHull (const int, const float *verts, const int nhull, const int *hull, const int nin, rcIntArray &tris)
 
float getJitterX (const int i)
 
float getJitterY (const int i)
 
static bool onHull (int a, int b, int nhull, int *hull)
 
static void setTriFlags (rcIntArray &tris, int nhull, int *hull)
 
static bool buildPolyDetail (rcContext *ctx, const float *in, const int nin, const float sampleDist, const float sampleMaxError, const int heightSearchRadius, const rcCompactHeightfield &chf, const rcHeightPatch &hp, float *verts, int &nverts, rcIntArray &tris, rcIntArray &edges, rcIntArray &samples)
 
static void seedArrayWithPolyCenter (rcContext *ctx, const rcCompactHeightfield &chf, const unsigned short *poly, const int npoly, const unsigned short *verts, const int bs, rcHeightPatch &hp, rcIntArray &array)
 
static void push3 (rcIntArray &queue, int v1, int v2, int v3)
 
static void getHeightData (rcContext *ctx, const rcCompactHeightfield &chf, const unsigned short *poly, const int npoly, const unsigned short *verts, const int bs, rcHeightPatch &hp, rcIntArray &queue, int region)
 
bool rcBuildPolyMeshDetail (rcContext *ctx, const rcPolyMesh &mesh, const rcCompactHeightfield &chf, const float sampleDist, const float sampleMaxError, rcPolyMeshDetail &dmesh)
 Builds a detail mesh from the provided polygon mesh. More...
 
bool rcMergePolyMeshDetails (rcContext *ctx, rcPolyMeshDetail **meshes, const int nmeshes, rcPolyMeshDetail &mesh)
 Merges multiple detail meshes into a single detail mesh. More...
 

Variables

static const unsigned RC_UNSET_HEIGHT = 0xffff
 

Enumeration Type Documentation

◆ EdgeValues

enum EdgeValues
Enumerator
EV_UNDEF 
EV_HULL 

Function Documentation

◆ addEdge()

static int addEdge ( rcContext ctx,
int *  edges,
int &  nedges,
const int  maxEdges,
int  s,
int  t,
int  l,
int  r 
)
static

◆ buildPolyDetail()

static bool buildPolyDetail ( rcContext ctx,
const float *  in,
const int  nin,
const float  sampleDist,
const float  sampleMaxError,
const int  heightSearchRadius,
const rcCompactHeightfield chf,
const rcHeightPatch hp,
float *  verts,
int &  nverts,
rcIntArray tris,
rcIntArray edges,
rcIntArray samples 
)
static

◆ circumCircle()

static bool circumCircle ( const float *  p1,
const float *  p2,
const float *  p3,
float *  c,
float &  r 
)
static

◆ completeFacet()

static void completeFacet ( rcContext ctx,
const float *  pts,
int  npts,
int *  edges,
int &  nedges,
const int  maxEdges,
int &  nfaces,
int  e 
)
static

◆ delaunayHull()

static void delaunayHull ( rcContext ctx,
const int  npts,
const float *  pts,
const int  nhull,
const int *  hull,
rcIntArray tris,
rcIntArray edges 
)
static

◆ distancePtSeg()

static float distancePtSeg ( const float *  pt,
const float *  p,
const float *  q 
)
static

◆ distancePtSeg2d()

static float distancePtSeg2d ( const float *  pt,
const float *  p,
const float *  q 
)
static

◆ distPtTri()

static float distPtTri ( const float *  p,
const float *  a,
const float *  b,
const float *  c 
)
static

◆ distToPoly()

static float distToPoly ( int  nvert,
const float *  verts,
const float *  p 
)
static

◆ distToTriMesh()

static float distToTriMesh ( const float *  p,
const float *  verts,
const int  ,
const int *  tris,
const int  ntris 
)
static

◆ findEdge()

static int findEdge ( const int *  edges,
int  nedges,
int  s,
int  t 
)
static

◆ getHeight()

static unsigned short getHeight ( const float  fx,
const float  fy,
const float  fz,
const float  ,
const float  ics,
const float  ch,
const int  radius,
const rcHeightPatch hp 
)
static

◆ getHeightData()

static void getHeightData ( rcContext ctx,
const rcCompactHeightfield chf,
const unsigned short *  poly,
const int  npoly,
const unsigned short *  verts,
const int  bs,
rcHeightPatch hp,
rcIntArray queue,
int  region 
)
static

◆ getJitterX()

float getJitterX ( const int  i)
inline

◆ getJitterY()

float getJitterY ( const int  i)
inline

◆ next()

int next ( int  i,
int  n 
)
inline

◆ onHull()

static bool onHull ( int  a,
int  b,
int  nhull,
int *  hull 
)
static

◆ overlapEdges()

static bool overlapEdges ( const float *  pts,
const int *  edges,
int  nedges,
int  s1,
int  t1 
)
static

◆ overlapSegSeg2d()

static int overlapSegSeg2d ( const float *  a,
const float *  b,
const float *  c,
const float *  d 
)
static

◆ polyMinExtent()

static float polyMinExtent ( const float *  verts,
const int  nverts 
)
static

◆ prev()

int prev ( int  i,
int  n 
)
inline

◆ push3()

static void push3 ( rcIntArray queue,
int  v1,
int  v2,
int  v3 
)
static

◆ seedArrayWithPolyCenter()

static void seedArrayWithPolyCenter ( rcContext ctx,
const rcCompactHeightfield chf,
const unsigned short *  poly,
const int  npoly,
const unsigned short *  verts,
const int  bs,
rcHeightPatch hp,
rcIntArray array 
)
static

◆ setTriFlags()

static void setTriFlags ( rcIntArray tris,
int  nhull,
int *  hull 
)
static

◆ triangulateHull()

static void triangulateHull ( const int  ,
const float *  verts,
const int  nhull,
const int *  hull,
const int  nin,
rcIntArray tris 
)
static

◆ updateLeftFace()

static void updateLeftFace ( int *  e,
int  s,
int  t,
int  f 
)
static

◆ vcross2()

float vcross2 ( const float *  p1,
const float *  p2,
const float *  p3 
)
inline

◆ vdist2()

float vdist2 ( const float *  p,
const float *  q 
)
inline

◆ vdistSq2()

float vdistSq2 ( const float *  p,
const float *  q 
)
inline

◆ vdot2()

float vdot2 ( const float *  a,
const float *  b 
)
inline

Variable Documentation

◆ RC_UNSET_HEIGHT

const unsigned RC_UNSET_HEIGHT = 0xffff
static