Path-282: Added support for viewing the walkability map for various character types
parent
d3550dfcd6
commit
154e569923
|
|
@ -62,6 +62,19 @@ void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const L
|
|||
gGL.end();
|
||||
}
|
||||
//=============================================================================
|
||||
void LLRenderNavPrim::renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color, bool overlayMode ) const
|
||||
{
|
||||
LLColor4 cV(color);
|
||||
gGL.color4fv( cV.mV );
|
||||
gGL.begin(LLRender::TRIANGLES);
|
||||
{
|
||||
gGL.vertex3fv( a.mV );
|
||||
gGL.vertex3fv( b.mV );
|
||||
gGL.vertex3fv( c.mV );
|
||||
}
|
||||
gGL.end();
|
||||
}
|
||||
//=============================================================================
|
||||
void LLRenderNavPrim::renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt )
|
||||
{
|
||||
pVBO->setBuffer( LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL );
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public:
|
|||
void renderSegment( const LLVector3& start, const LLVector3& end, int color, bool overlayMode ) const;
|
||||
//Draw simple tri
|
||||
void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color, bool overlayMode ) const;
|
||||
//Draw simple tri
|
||||
void renderLLTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, const LLColor4U& color, bool overlayMode ) const;
|
||||
//Draw the contents of vertex buffer
|
||||
void renderNavMeshVB( LLVertexBuffer* pVBO, int vertCnt );
|
||||
//Draw a star
|
||||
|
|
|
|||
|
|
@ -368,6 +368,35 @@ LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::get
|
|||
return renderHeatmapType;
|
||||
}
|
||||
|
||||
int LLFloaterPathfindingConsole::getHeatMapType() const
|
||||
{
|
||||
//converts the pathfinding console values to the navmesh filter values
|
||||
|
||||
int renderHeatmapType = 4; //none
|
||||
|
||||
switch ( mShowNavMeshWalkabilityComboBox->getValue().asInteger() )
|
||||
{
|
||||
case XUI_RENDER_HEATMAP_A :
|
||||
renderHeatmapType = 0;
|
||||
break;
|
||||
case XUI_RENDER_HEATMAP_B :
|
||||
renderHeatmapType = 1;
|
||||
break;
|
||||
case XUI_RENDER_HEATMAP_C :
|
||||
renderHeatmapType = 2;
|
||||
break;
|
||||
case XUI_RENDER_HEATMAP_D :
|
||||
renderHeatmapType = 3;
|
||||
break;
|
||||
default :
|
||||
renderHeatmapType = 4;
|
||||
break;
|
||||
}
|
||||
|
||||
return renderHeatmapType;
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType)
|
||||
{
|
||||
LLSD comboBoxValue;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public:
|
|||
bool getHeartBeat() const { return mHeartBeat;}
|
||||
void setHeartBeat( bool state ) { mHeartBeat=state; }
|
||||
void regionCrossingOccured();
|
||||
|
||||
int getHeatMapType() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
|||
|
|
@ -4347,7 +4347,8 @@ void LLPipeline::renderDebug()
|
|||
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
|
||||
}
|
||||
llPathingLibInstance->renderNavMesh();
|
||||
int materialIndex = pathfindingConsole->getHeatMapType();
|
||||
llPathingLibInstance->renderNavMesh( materialIndex );
|
||||
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
|
||||
glLineWidth(1.0f);
|
||||
gGL.flush();
|
||||
|
|
|
|||
Loading…
Reference in New Issue