mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
remove depth changes
changing depth between draw modes is a bit confusing to the viewer could revist PolyAreas must start with 1, 0 = null area in recast.
This commit is contained in:
parent
d1771756c2
commit
de1642c33e
3 changed files with 5 additions and 32 deletions
|
|
@ -62,7 +62,7 @@ unsigned int duDebugDrawTorque::areaToCol(unsigned int area)
|
||||||
{
|
{
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
// Ground (0) : light blue
|
// Ground (1) : light blue
|
||||||
case GroundArea: return duRGBA(0, 192, 255, 255);
|
case GroundArea: return duRGBA(0, 192, 255, 255);
|
||||||
// Water : blue
|
// Water : blue
|
||||||
case WaterArea: return duRGBA(0, 0, 255, 255);
|
case WaterArea: return duRGBA(0, 0, 255, 255);
|
||||||
|
|
@ -94,6 +94,7 @@ void duDebugDrawTorque::begin(duDebugDrawPrimitives prim, float size)
|
||||||
|
|
||||||
mDesc.setCullMode(GFXCullCW);
|
mDesc.setCullMode(GFXCullCW);
|
||||||
mDesc.setBlend(false);
|
mDesc.setBlend(false);
|
||||||
|
mDesc.setZReadWrite(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Submit a vertex
|
/// Submit a vertex
|
||||||
|
|
|
||||||
|
|
@ -1534,22 +1534,6 @@ void NavMesh::renderToDrawer()
|
||||||
{
|
{
|
||||||
NavMesh* n = static_cast<NavMesh*>(no);
|
NavMesh* n = static_cast<NavMesh*>(no);
|
||||||
|
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
|
|
||||||
if (n->nm && m_drawMode != DRAWMODE_NAVMESH_TRANS)
|
|
||||||
{
|
|
||||||
if (m_drawMode != DRAWMODE_NAVMESH_INVIS)
|
|
||||||
duDebugDrawNavMesh(&mDbgDraw, *n->nm, 0);
|
|
||||||
|
|
||||||
////const F32 texScale = 1.0f / (n->mCellSize * 10.0f); this draw mode is useless for us.
|
|
||||||
////duDebugDrawNavMesh(&mDbgDraw, *n->nm, 0);
|
|
||||||
//if (n->m_geo != NULL)
|
|
||||||
//{
|
|
||||||
// duDebugDrawTriMeshSlope(&mDbgDraw, n->m_geo->getVerts(), n->m_geo->getVertCount(),
|
|
||||||
// n->m_geo->getTris(), n->m_geo->getNormals(), n->m_geo->getTriCount(), n->mWalkableSlope, texScale);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n->nm &&
|
if (n->nm &&
|
||||||
(m_drawMode == DRAWMODE_NAVMESH ||
|
(m_drawMode == DRAWMODE_NAVMESH ||
|
||||||
m_drawMode == DRAWMODE_NAVMESH_TRANS ||
|
m_drawMode == DRAWMODE_NAVMESH_TRANS ||
|
||||||
|
|
@ -1558,14 +1542,14 @@ void NavMesh::renderToDrawer()
|
||||||
m_drawMode == DRAWMODE_NAVMESH_PORTALS ||
|
m_drawMode == DRAWMODE_NAVMESH_PORTALS ||
|
||||||
m_drawMode == DRAWMODE_NAVMESH_INVIS))
|
m_drawMode == DRAWMODE_NAVMESH_INVIS))
|
||||||
{
|
{
|
||||||
|
if (m_drawMode != DRAWMODE_NAVMESH_INVIS)
|
||||||
|
duDebugDrawNavMesh(&mDbgDraw, *n->nm, 0);
|
||||||
if(m_drawMode == DRAWMODE_NAVMESH_BVTREE)
|
if(m_drawMode == DRAWMODE_NAVMESH_BVTREE)
|
||||||
duDebugDrawNavMeshBVTree(&mDbgDraw, *n->nm);
|
duDebugDrawNavMeshBVTree(&mDbgDraw, *n->nm);
|
||||||
if(m_drawMode == DRAWMODE_NAVMESH_PORTALS)
|
if(m_drawMode == DRAWMODE_NAVMESH_PORTALS)
|
||||||
duDebugDrawNavMeshPortals(&mDbgDraw, *n->nm);
|
duDebugDrawNavMeshPortals(&mDbgDraw, *n->nm);
|
||||||
}
|
}
|
||||||
|
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
|
|
||||||
for (Tile& tile : n->mTiles)
|
for (Tile& tile : n->mTiles)
|
||||||
{
|
{
|
||||||
if (tile.chf && m_drawMode == DRAWMODE_COMPACT)
|
if (tile.chf && m_drawMode == DRAWMODE_COMPACT)
|
||||||
|
|
@ -1595,47 +1579,35 @@ void NavMesh::renderToDrawer()
|
||||||
|
|
||||||
if (tile.cset && m_drawMode == DRAWMODE_RAW_CONTOURS)
|
if (tile.cset && m_drawMode == DRAWMODE_RAW_CONTOURS)
|
||||||
{
|
{
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
duDebugDrawRawContours(&mDbgDraw, *tile.cset);
|
duDebugDrawRawContours(&mDbgDraw, *tile.cset);
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.cset && m_drawMode == DRAWMODE_BOTH_CONTOURS)
|
if (tile.cset && m_drawMode == DRAWMODE_BOTH_CONTOURS)
|
||||||
{
|
{
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
duDebugDrawRawContours(&mDbgDraw, *tile.cset);
|
duDebugDrawRawContours(&mDbgDraw, *tile.cset);
|
||||||
duDebugDrawContours(&mDbgDraw, *tile.cset);
|
duDebugDrawContours(&mDbgDraw, *tile.cset);
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.cset && m_drawMode == DRAWMODE_CONTOURS)
|
if (tile.cset && m_drawMode == DRAWMODE_CONTOURS)
|
||||||
{
|
{
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
duDebugDrawContours(&mDbgDraw, *tile.cset);
|
duDebugDrawContours(&mDbgDraw, *tile.cset);
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.chf && tile.cset && m_drawMode == DRAWMODE_REGION_CONNECTIONS)
|
if (tile.chf && tile.cset && m_drawMode == DRAWMODE_REGION_CONNECTIONS)
|
||||||
{
|
{
|
||||||
duDebugDrawCompactHeightfieldRegions(&mDbgDraw, *tile.chf);
|
duDebugDrawCompactHeightfieldRegions(&mDbgDraw, *tile.chf);
|
||||||
|
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
duDebugDrawRegionConnections(&mDbgDraw, *tile.cset);
|
duDebugDrawRegionConnections(&mDbgDraw, *tile.cset);
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.pmesh && m_drawMode == DRAWMODE_POLYMESH)
|
if (tile.pmesh && m_drawMode == DRAWMODE_POLYMESH)
|
||||||
{
|
{
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
duDebugDrawPolyMesh(&mDbgDraw, *tile.pmesh);
|
duDebugDrawPolyMesh(&mDbgDraw, *tile.pmesh);
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile.dmesh && m_drawMode == DRAWMODE_POLYMESH_DETAIL)
|
if (tile.dmesh && m_drawMode == DRAWMODE_POLYMESH_DETAIL)
|
||||||
{
|
{
|
||||||
mDbgDraw.depthMask(false);
|
|
||||||
duDebugDrawPolyMeshDetail(&mDbgDraw, *tile.dmesh);
|
duDebugDrawPolyMeshDetail(&mDbgDraw, *tile.dmesh);
|
||||||
mDbgDraw.depthMask(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ inline void rcCol(unsigned int col, U8 &r, U8 &g, U8 &b, U8 &a)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PolyAreas {
|
enum PolyAreas {
|
||||||
GroundArea,
|
GroundArea = 1,
|
||||||
WaterArea,
|
WaterArea,
|
||||||
OffMeshArea,
|
OffMeshArea,
|
||||||
NumAreas
|
NumAreas
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue