Blender V2.61 - r43446
Classes | Functions

navmesh_conversion.c File Reference

#include <math.h>
#include <stdlib.h>
#include "MEM_guardedalloc.h"
#include "DNA_meshdata_types.h"
#include "BKE_navmesh_conversion.h"
#include "BKE_cdderivedmesh.h"
#include "BLI_utildefines.h"
#include "BLI_math.h"
#include "recast-capi.h"

Go to the source code of this file.

Classes

struct  SortContext

Functions

BM_INLINE float area2 (const float *a, const float *b, const float *c)
BM_INLINE int left (const float *a, const float *b, const float *c)
int polyNumVerts (const unsigned short *p, const int vertsPerPoly)
int polyIsConvex (const unsigned short *p, const int vertsPerPoly, const float *verts)
float distPointToSegmentSq (const float *point, const float *a, const float *b)
int buildRawVertIndicesData (DerivedMesh *dm, int *nverts_r, float **verts_r, int *ntris_r, unsigned short **tris_r, int **trisToFacesMap_r, int **recastData)
int buildPolygonsByDetailedMeshes (const int vertsPerPoly, const int npolys, unsigned short *polys, const unsigned short *dmeshes, const float *verts, const unsigned short *dtris, const int *dtrisToPolysMap)
static int compareByData (void *ctx, const void *a, const void *b)
int buildNavMeshData (const int nverts, const float *verts, const int ntris, const unsigned short *tris, const int *recastData, const int *trisToFacesMap, int *ndtris_r, unsigned short **dtris_r, int *npolys_r, unsigned short **dmeshes_r, unsigned short **polys_r, int *vertsPerPoly_r, int **dtrisToPolysMap_r, int **dtrisToTrisMap_r)
int buildNavMeshDataByDerivedMesh (DerivedMesh *dm, int *vertsPerPoly, int *nverts, float **verts, int *ndtris, unsigned short **dtris, int *npolys, unsigned short **dmeshes, unsigned short **polys, int **dtrisToPolysMap, int **dtrisToTrisMap, int **trisToFacesMap)
int polyFindVertex (const unsigned short *p, const int vertsPerPoly, unsigned short vertexIdx)

Detailed Description

Definition in file navmesh_conversion.c.


Function Documentation

BM_INLINE float area2 ( const float *  a,
const float *  b,
const float *  c 
)

Definition at line 47 of file navmesh_conversion.c.

Referenced by left().

int buildNavMeshData ( const int  nverts,
const float *  verts,
const int  ntris,
const unsigned short *  tris,
const int *  recastData,
const int *  trisToFacesMap,
int *  ndtris_r,
unsigned short **  dtris_r,
int *  npolys_r,
unsigned short **  dmeshes_r,
unsigned short **  polys_r,
int *  vertsPerPoly_r,
int **  dtrisToPolysMap_r,
int **  dtrisToTrisMap_r 
)
int buildNavMeshDataByDerivedMesh ( DerivedMesh dm,
int *  vertsPerPoly,
int *  nverts,
float **  verts,
int *  ndtris,
unsigned short **  dtris,
int *  npolys,
unsigned short **  dmeshes,
unsigned short **  polys,
int **  dtrisToPolysMap,
int **  dtrisToTrisMap,
int **  trisToFacesMap 
)
int buildPolygonsByDetailedMeshes ( const int  vertsPerPoly,
const int  npolys,
unsigned short *  polys,
const unsigned short *  dmeshes,
const float *  verts,
const unsigned short *  dtris,
const int *  dtrisToPolysMap 
)

Definition at line 180 of file navmesh_conversion.c.

References distPointToSegmentSq(), i, MEM_callocN(), MEM_freeN(), and next.

Referenced by buildNavMeshData().

int buildRawVertIndicesData ( DerivedMesh dm,
int *  nverts_r,
float **  verts_r,
int *  ntris_r,
unsigned short **  tris_r,
int **  trisToFacesMap_r,
int **  recastData 
)
static int compareByData ( void *  ctx,
const void *  a,
const void *  b 
) [static]

Definition at line 333 of file navmesh_conversion.c.

Referenced by buildNavMeshData().

float distPointToSegmentSq ( const float *  point,
const float *  a,
const float *  b 
)

Definition at line 86 of file navmesh_conversion.c.

References simple_enum_gen::d, and sub_v3_v3v3().

Referenced by buildPolygonsByDetailedMeshes().

BM_INLINE int left ( const float *  a,
const float *  b,
const float *  c 
)
int polyFindVertex ( const unsigned short *  p,
const int  vertsPerPoly,
unsigned short  vertexIdx 
)

Definition at line 500 of file navmesh_conversion.c.

References i.

Referenced by KX_NavMeshObject::BuildVertIndArrays().

int polyIsConvex ( const unsigned short *  p,
const int  vertsPerPoly,
const float *  verts 
)

Definition at line 69 of file navmesh_conversion.c.

References left(), and polyNumVerts().

int polyNumVerts ( const unsigned short *  p,
const int  vertsPerPoly 
)

Definition at line 57 of file navmesh_conversion.c.

References i.

Referenced by KX_NavMeshObject::BuildVertIndArrays(), and polyIsConvex().