Mikko Mononen b1114cb5cd Paris demo build (does not compile from SVN).
Removed portal test from demo.cpp
Added new debug draw mode (regions connections).
Tweaked several debug draw modes to be more illustrative.
Added checks in the Detour code to allow to call the API even if the initialization failed.
2009-06-04 13:03:48 +00:00

61 lines
2.8 KiB
C

//
// Copyright (c) 2009 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef RECAST_DEBUGDRAW_H
#define RECAST_DEBUGDRAW_H
inline int bit(int a, int b)
{
return (a & (1 << b)) >> b;
}
inline void intToCol(int i, float* col)
{
int r = bit(i, 0) + bit(i, 3) * 2 + 1;
int g = bit(i, 1) + bit(i, 4) * 2 + 1;
int b = bit(i, 2) + bit(i, 5) * 2 + 1;
col[0] = 1 - r*63.0f/255.0f;
col[1] = 1 - g*63.0f/255.0f;
col[2] = 1 - b*63.0f/255.0f;
}
void rcDebugDrawHeightfieldSolid(const struct rcHeightfield& hf,
const float* orig, float cs, float ch);
void rcDebugDrawHeightfieldWalkable(const struct rcHeightfield& hf,
const float* orig, float cs, float ch);
void rcDebugDrawMesh(const class rcMeshLoaderObj& mesh, const unsigned char* flags, const float miny, const float maxy);
void rcDebugDrawMeshSlope(const class rcMeshLoaderObj& mesh, const float walkableSlopeAngle, const float miny, const float maxy);
void rcDebugDrawCompactHeightfieldSolid(const struct rcCompactHeightfield& chf);
void rcDebugDrawCompactHeightfieldRegions(const struct rcCompactHeightfield& chf);
void rcDebugDrawCompactHeightfieldDistance(const struct rcCompactHeightfield& chf);
void rcDebugDrawRegionConnections(const struct rcContourSet& cset, const float* orig, float cs, float ch, const float alpha = 1.0f);
void rcDebugDrawRawContours(const struct rcContourSet& cset, const float* orig, float cs, float ch, const float alpha = 1.0f);
void rcDebugDrawContours(const struct rcContourSet& cset, const float* orig, float cs, float ch);
void rcDebugDrawPolyMesh(const struct rcPolyMesh& mesh);
void rcDebugDrawCylinderWire(float minx, float miny, float minz, float maxx, float maxy, float maxz, const float* col);
void rcDebugDrawBoxWire(float minx, float miny, float minz, float maxx, float maxy, float maxz, const float* col);
void rcDebugDrawBox(float minx, float miny, float minz, float maxx, float maxy, float maxz,
const float* col1, const float* col2);
#endif // RECAST_DEBUGDRAW_H