Welcome to mirror list, hosted at ThFree Co, Russian Federation.

recast-capi.h « recastnavigation « extern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58fe08e63356f5adf95a29a7c718622fb6f61ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
 * $Id$
 *
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2011 Blender Foundation.
 * All rights reserved.
 *
 * Contributor(s): Sergey Sharybin
 *
 * ***** END GPL LICENSE BLOCK *****
 */

#ifndef RECAST_C_API_H
#define RECAST_C_API_H

#ifdef __cplusplus
extern "C" {
#endif

struct recast_polyMesh;
struct recast_polyMeshDetail;
struct recast_heightfield;
struct recast_compactHeightfield;
struct recast_contourSet;

enum recast_SpanFlags
{
	RECAST_WALKABLE = 0x01,
	RECAST_REACHABLE = 0x02
};

int recast_buildMeshAdjacency(unsigned short* polys, const int npolys,
			const int nverts, const int vertsPerPoly);

void recast_calcBounds(const float *verts, int nv, float *bmin, float *bmax);

void recast_calcGridSize(const float *bmin, const float *bmax, float cs, int *w, int *h);

struct recast_heightfield *recast_newHeightfield(void);

void recast_destroyHeightfield(struct recast_heightfield *heightfield);

int recast_createHeightfield(struct recast_heightfield *hf, int width, int height,
			const float *bmin, const float* bmax, float cs, float ch);

void recast_markWalkableTriangles(const float walkableSlopeAngle,const float *verts, int nv,
			const int *tris, int nt, unsigned char *flags);

void recast_rasterizeTriangles(const float *verts, int nv, const int *tris,
			const unsigned char *flags, int nt, struct recast_heightfield *solid);

void recast_filterLedgeSpans(const int walkableHeight, const int walkableClimb,
			struct recast_heightfield *solid);

void recast_filterWalkableLowHeightSpans(int walkableHeight, struct recast_heightfield *solid);

struct recast_compactHeightfield *recast_newCompactHeightfield(void);

void recast_destroyCompactHeightfield(struct recast_compactHeightfield *compactHeightfield);

int recast_buildCompactHeightfield(const int walkableHeight, const int walkableClimb,
			unsigned char flags, struct recast_heightfield *hf, struct recast_compactHeightfield *chf);

int recast_buildDistanceField(struct recast_compactHeightfield *chf);

int recast_buildRegions(struct recast_compactHeightfield *chf, int walkableRadius, int borderSize,
	int minRegionSize, int mergeRegionSize);

/* Contour set */

struct recast_contourSet *recast_newContourSet(void);

void recast_destroyContourSet(struct recast_contourSet *contourSet);

int recast_buildContours(struct recast_compactHeightfield *chf,
			const float maxError, const int maxEdgeLen, struct recast_contourSet *cset);

/* Poly mesh */

struct recast_polyMesh *recast_newPolyMesh(void);

void recast_destroyPolyMesh(struct recast_polyMesh *polyMesh);

int recast_buildPolyMesh(struct recast_contourSet *cset, int nvp, struct recast_polyMesh *mesh);

unsigned short *recast_polyMeshGetVerts(struct recast_polyMesh *mesh, int *nverts);

void recast_polyMeshGetBoundbox(struct recast_polyMesh *mesh, float *bmin, float *bmax);

void recast_polyMeshGetCell(struct recast_polyMesh *mesh, float *cs, float *ch);

unsigned short *recast_polyMeshGetPolys(struct recast_polyMesh *mesh, int *npolys, int *nvp);

/* Poly mesh detail */

struct recast_polyMeshDetail *recast_newPolyMeshDetail(void);

void recast_destroyPolyMeshDetail(struct recast_polyMeshDetail *polyMeshDetail);

int recast_buildPolyMeshDetail(const struct recast_polyMesh *mesh, const struct recast_compactHeightfield *chf,
			const float sampleDist, const float sampleMaxError, struct recast_polyMeshDetail *dmesh);

float *recast_polyMeshDetailGetVerts(struct recast_polyMeshDetail *mesh, int *nverts);

unsigned char *recast_polyMeshDetailGetTris(struct recast_polyMeshDetail *mesh, int *ntris);

unsigned short *recast_polyMeshDetailGetMeshes(struct recast_polyMeshDetail *mesh, int *nmeshes);

#ifdef __cplusplus
}
#endif

#endif // RECAST_C_API_H