Blender V2.61 - r43446
|
#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) |
Definition in file navmesh_conversion.c.
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 | ||
) |
Definition at line 339 of file navmesh_conversion.c.
References buildPolygonsByDetailedMeshes(), compareByData(), i, MEM_callocN(), MEM_freeN(), NULL, SortContext::recastData, and SortContext::trisToFacesMap.
Referenced by buildNavMeshDataByDerivedMesh().
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 | ||
) |
Definition at line 466 of file navmesh_conversion.c.
References buildNavMeshData(), buildRawVertIndicesData(), MEM_freeN(), NULL, and SortContext::recastData.
Referenced by KX_NavMeshObject::BuildVertIndArrays().
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 | ||
) |
Definition at line 109 of file navmesh_conversion.c.
References CD_RECAST, CustomData_get_layer(), DerivedMesh::faceData, DerivedMesh::getFaceArray, DerivedMesh::getNumFaces, DerivedMesh::getNumVerts, DerivedMesh::getVertCos, if(), MEM_callocN(), SWAP, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by buildNavMeshDataByDerivedMesh().
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 | ||
) |
Definition at line 52 of file navmesh_conversion.c.
References area2().
Referenced by FLUID_3D::addVorticity(), MD5Hash::append(), KX_BlenderRenderTools::applyTransform(), GPC_RenderTools::applyTransform(), BKE_tracking_projection_matrix(), BLI_uniquename_cb(), BOP_performBooleanOperation(), BVHBuild::build_node(), build_skip_links(), check_for_dupid(), do_colorband(), fill_quad_double_op(), fill_quad_single(), fill_quad_singlevert(), SG_Tree::Find(), KX_BlenderCanvas::GetMouseX(), GHOST_WindowCarbon::GHOST_WindowCarbon(), GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowX11::GHOST_WindowX11(), ImageRender::ImageRender(), isb_bsp_split(), isb_bsp_split_init(), kdtree_balance(), SG_TreeFactory::MakeTreeDown(), minDx(), orthographic_m4(), perspective_m4(), polyIsConvex(), query_qual(), KX_BlenderRenderTools::RayHit(), GPC_RenderTools::RayHit(), AUD_FFMPEGReader::read(), sb_cf_threads_run(), sb_sfesf_threads_run(), seq_single_fix(), SeqTransInfo(), SG_Tree::SetLeft(), FLUID_3D::setObstacleBoundaries(), FLUID_3D::setObstaclePressure(), KX_Camera::SetViewport(), StereoProjection(), txt_split_curline(), ui_block_position(), KX_TrackToActuator::Update(), View(), and wm_set_apple_prefsize().
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().