mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-07-04 21:19:04 +00:00
Debug draw duPolyToCol custom function (#253)
Add duDebugDraw::duPolyToCol to allow user to pick polygon color.
This commit is contained in:
committed by
Jakob Botsch Nielsen
parent
dfd40071c5
commit
ad6e5de2e9
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user