diff options
author | Dave Parks <davep@lindenlab.com> | 2010-10-06 20:35:17 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-10-06 20:35:17 -0500 |
commit | e83b815c0fff09cd7d0d4c0198ed7bdc1fa296ad (patch) | |
tree | 12a647d7d45bdbfa6199d854f2378a4921d81bb4 /indra/newview/llspatialpartition.cpp | |
parent | 99f3db16e93add8025c0b7c60641f2b950b40d01 (diff) | |
parent | 9fa00ed52d634bf2c1023a886d228ae8f4640b32 (diff) |
merge
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 148c222014..b99829c3e4 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2800,6 +2800,38 @@ S32 get_physics_detail(const LLVolumeParams& volume_params, const LLVector3& sca return detail; } +void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color) +{ + LLUUID mesh_id = volume->getVolume()->getParams().getSculptID(); + const LLMeshDecomposition* decomp = gMeshRepo.getDecomposition(mesh_id); + + if (decomp) + { + gGL.pushMatrix(); + glMultMatrixf((F32*) volume->getRelativeXform().mMatrix); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + LLVertexBuffer* buff = decomp->mBaseHullMesh; + + buff->setBuffer(data_mask); + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glColor3fv(color.mV); + buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts()); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + { + LLGLEnable blend(GL_BLEND); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + glColor4fv(color.mV); + buff->drawArrays(LLRender::TRIANGLES, 0, buff->getNumVerts()); + } + gGL.popMatrix(); + } +} + void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) { U8 physics_type = volume->getPhysicsShapeType(); @@ -2875,6 +2907,13 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) gGL.popMatrix(); } } + else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_CONVEX) + { + if (volume->isMesh()) + { + renderMeshBaseHull(volume, data_mask, color); + } + } else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::BOX) { gGL.pushMatrix(); |