Debug draw duPolyToCol custom function (#253)

Add duDebugDraw::duPolyToCol to allow user to pick polygon color.
This commit is contained in:
Domenico Albani
2017-01-30 11:11:32 +01:00
committed by Jakob Botsch Nielsen
parent dfd40071c5
commit ad6e5de2e9
3 changed files with 24 additions and 12 deletions

View File

@@ -20,13 +20,26 @@
#include <string.h>
#include "DebugDraw.h"
#include "DetourMath.h"
#include "DetourNavMesh.h"
duDebugDraw::~duDebugDraw()
{
// Empty
}
unsigned int duDebugDraw::polyToCol(const struct dtPoly* poly)
{
if (poly->getArea() == 0)
{
// Treat zero area type as default.
return duRGBA(0, 192, 255, 255);
}
else
{
return duIntToCol(poly->getArea(), 255);
}
}
inline int bit(int a, int b)
{