summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-10-20 14:37:37 -0500
committerDave Parks <davep@lindenlab.com>2010-10-20 14:37:37 -0500
commit187716a4ee9019b0133de865d9ede3c3abc3cc5b (patch)
treed56db839aa15ba14225ff128f1551a077f3fa530 /indra/newview
parent5d5cb7a08344915a11bb43954212444fec073e7c (diff)
Add terrain to physics shape display.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llspatialpartition.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index e763f92fab..c23756611d 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -3195,6 +3195,31 @@ void renderPhysicsShapes(LLSpatialGroup* group)
renderPhysicsShape(drawable, volume);
}
}
+ else
+ {
+ LLViewerObject* object = drawable->getVObj();
+ if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
+ {
+ //push face vertices for terrain
+ for (S32 i = 0; i < drawable->getNumFaces(); ++i)
+ {
+ LLFace* face = drawable->getFace(i);
+ LLVertexBuffer* buff = face->mVertexBuffer;
+ if (buff)
+ {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
+ glColor3f(0.2f, 0.5f, 0.3f);
+ buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0);
+
+ glColor3f(0.2f, 1.f, 0.3f);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ buff->draw(LLRender::TRIANGLES, buff->getRequestedIndices(), 0);
+ }
+ }
+ }
+ }
}
}