Correction for own recent commit -- didn't know it's unsupported in
[blender.git] / source / blender / blenkernel / BKE_navmesh_conversion.h
1 /**
2 * $Id$ 
3 *
4 * ***** BEGIN GPL LICENSE BLOCK *****
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
22 *
23 * The Original Code is: all of this file.
24 *
25 * Contributor(s): none yet.
26 *
27 * ***** END GPL LICENSE BLOCK *****
28 */
29
30 #ifndef BKE_NAVMESH_CONVERSION_H
31 #define BKE_NAVMESH_CONVERSION_H
32
33 struct DerivedMesh;
34
35 /* navmesh_conversion.c */
36 int buildNavMeshDataByDerivedMesh(struct DerivedMesh *dm, int *vertsPerPoly,
37                                                                    int *nverts, float **verts,
38                                                                    int *ndtris, unsigned short **dtris,
39                                                                    int *npolys, unsigned short **dmeshes,
40                                                                    unsigned short **polys, int **dtrisToPolysMap,
41                                                                    int **dtrisToTrisMap, int **trisToFacesMap);
42
43 int buildRawVertIndicesData(struct DerivedMesh* dm, int *nverts, float **verts,
44                                 int *ntris, unsigned short **tris, int **trisToFacesMap,
45                                 int **recastData);
46
47 int buildNavMeshData(const int nverts, const float* verts,
48                                           const int ntris, const unsigned short *tris,
49                                           const int* recastData, const int* trisToFacesMap,
50                                           int *ndtris, unsigned short **dtris,
51                                           int *npolys, unsigned short **dmeshes, unsigned short **polys,
52                                           int *vertsPerPoly, int **dtrisToPolysMap, int **dtrisToTrisMap);
53
54 int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys,
55                                 unsigned short* polys, const unsigned short* dmeshes,
56                                 const float* verts, const unsigned short* dtris,
57                                 const int* dtrisToPolysMap);
58
59 int polyNumVerts(const unsigned short* p, const int vertsPerPoly);
60 int polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts);
61 int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx);
62 float distPointToSegmentSq(const float* point, const float* a, const float* b);
63
64
65 #endif //NAVMESH_CONVERSION_H