mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Improve convex volume creation/drawing
* Improved ground convex visibility (changed to red as this acts as deletion). * Default m_areaType to SAMPLE_POLYAREA_GROUND.
This commit is contained in:
parent
0576749de0
commit
369c92e358
@ -90,7 +90,7 @@ static int pointInPoly(int nvert, const float* verts, const float* p)
|
||||
|
||||
ConvexVolumeTool::ConvexVolumeTool() :
|
||||
m_sample(0),
|
||||
m_areaType(SAMPLE_POLYAREA_GRASS),
|
||||
m_areaType(SAMPLE_POLYAREA_GROUND),
|
||||
m_polyOffset(0.0f),
|
||||
m_boxHeight(500.0f),
|
||||
m_boxDescent(250.0f),
|
||||
|
@ -593,7 +593,13 @@ void InputGeom::drawConvexVolumes(struct duDebugDraw* dd, bool /*hilight*/)
|
||||
for (int i = 0; i < m_volumeCount; ++i)
|
||||
{
|
||||
const ConvexVolume* vol = &m_volumes[i];
|
||||
unsigned int col = duTransCol(dd->areaToCol(vol->area), 32);
|
||||
unsigned int col;
|
||||
|
||||
if (vol->area == SAMPLE_POLYAREA_GROUND)
|
||||
col = duRGBA(255, 0, 0, 32); // Use red for visibility (ground acts as deletion).
|
||||
else
|
||||
col = duTransCol(dd->areaToCol(vol->area), 32);
|
||||
|
||||
for (int j = 0, k = vol->nverts-1; j < vol->nverts; k = j++)
|
||||
{
|
||||
const float* va = &vol->verts[k*3];
|
||||
@ -617,7 +623,13 @@ void InputGeom::drawConvexVolumes(struct duDebugDraw* dd, bool /*hilight*/)
|
||||
for (int i = 0; i < m_volumeCount; ++i)
|
||||
{
|
||||
const ConvexVolume* vol = &m_volumes[i];
|
||||
unsigned int col = duTransCol(dd->areaToCol(vol->area), 220);
|
||||
unsigned int col;
|
||||
|
||||
if (vol->area == SAMPLE_POLYAREA_GROUND)
|
||||
col = duRGBA(255, 0, 0, 220); // Use red for visibility (ground acts as deletion).
|
||||
else
|
||||
col = duTransCol(dd->areaToCol(vol->area), 220);
|
||||
|
||||
for (int j = 0, k = vol->nverts-1; j < vol->nverts; k = j++)
|
||||
{
|
||||
const float* va = &vol->verts[k*3];
|
||||
|
Loading…
x
Reference in New Issue
Block a user