diff options
author | Dave Parks <davep@lindenlab.com> | 2010-10-06 01:17:12 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-10-06 01:17:12 -0500 |
commit | 24e0d62a5eb3299a877d7a6b37e1881ec3d1ca0c (patch) | |
tree | e019607213c23f83f17431237f9c45979c5395d5 /indra/newview/llspatialpartition.cpp | |
parent | 98d622551d9466d1153dedfbdd721becf8c38cd9 (diff) |
Added mandatory single hull simplification to mesh upload.
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(); |