Combine renderPhysicsDisplay code loops, but don't actually fix any bugs X3
This commit is contained in:
@@ -3347,51 +3347,71 @@ void renderPhysicsShapes(LLSpatialGroup* group)
|
|||||||
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
|
for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
|
||||||
{
|
{
|
||||||
LLDrawable* drawable = *i;
|
LLDrawable* drawable = *i;
|
||||||
LLVOVolume* volume = drawable->getVOVolume();
|
if (!drawable)
|
||||||
if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE )
|
|
||||||
{
|
{
|
||||||
if (!group->mSpatialPartition->isBridge())
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (drawable->isSpatialBridge())
|
||||||
|
{
|
||||||
|
LLSpatialBridge* bridge = drawable->asPartition()->asBridge();
|
||||||
|
|
||||||
|
if (bridge)
|
||||||
{
|
{
|
||||||
gGL.pushMatrix();
|
gGL.pushMatrix();
|
||||||
LLVector3 trans = drawable->getRegion()->getOriginAgent();
|
gGL.multMatrix(bridge->mDrawable->getRenderMatrix());
|
||||||
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
|
bridge->renderPhysicsShapes();
|
||||||
renderPhysicsShape(drawable, volume);
|
|
||||||
gGL.popMatrix();
|
gGL.popMatrix();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
renderPhysicsShape(drawable, volume);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLViewerObject* object = drawable->getVObj();
|
LLVOVolume* volume = drawable->getVOVolume();
|
||||||
if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
|
if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE )
|
||||||
{
|
{
|
||||||
gGL.pushMatrix();
|
if (!group->mSpatialPartition->isBridge())
|
||||||
gGL.multMatrix(object->getRegion()->mRenderMatrix);
|
|
||||||
//push face vertices for terrain
|
|
||||||
for (S32 i = 0; i < drawable->getNumFaces(); ++i)
|
|
||||||
{
|
{
|
||||||
LLFace* face = drawable->getFace(i);
|
gGL.pushMatrix();
|
||||||
if (face)
|
LLVector3 trans = drawable->getRegion()->getOriginAgent();
|
||||||
|
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
|
||||||
|
renderPhysicsShape(drawable, volume);
|
||||||
|
gGL.popMatrix();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
renderPhysicsShape(drawable, volume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LLViewerObject* object = drawable->getVObj();
|
||||||
|
if (object && object->getPCode() == LLViewerObject::LL_VO_SURFACE_PATCH)
|
||||||
|
{
|
||||||
|
gGL.pushMatrix();
|
||||||
|
gGL.multMatrix(object->getRegion()->mRenderMatrix);
|
||||||
|
//push face vertices for terrain
|
||||||
|
for (S32 i = 0; i < drawable->getNumFaces(); ++i)
|
||||||
{
|
{
|
||||||
LLVertexBuffer* buff = face->getVertexBuffer();
|
LLFace* face = drawable->getFace(i);
|
||||||
if (buff)
|
if (face)
|
||||||
{
|
{
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
LLVertexBuffer* buff = face->getVertexBuffer();
|
||||||
|
if (buff)
|
||||||
|
{
|
||||||
|
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||||
|
|
||||||
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
|
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
|
||||||
gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
|
gGL.diffuseColor3f(0.2f, 0.5f, 0.3f);
|
||||||
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
|
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
|
||||||
|
|
||||||
gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
|
gGL.diffuseColor3f(0.2f, 1.f, 0.3f);
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||||
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
|
buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gGL.popMatrix();
|
||||||
}
|
}
|
||||||
gGL.popMatrix();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4640,18 +4640,6 @@ void LLPipeline::renderPhysicsDisplay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (LLCullResult::bridge_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
|
|
||||||
{
|
|
||||||
LLSpatialBridge* bridge = *i;
|
|
||||||
if (!bridge->isDead() && hasRenderType(bridge->mDrawableType))
|
|
||||||
{
|
|
||||||
gGL.pushMatrix();
|
|
||||||
gGL.multMatrix(bridge->mDrawable->getRenderMatrix());
|
|
||||||
bridge->renderPhysicsShapes();
|
|
||||||
gGL.popMatrix();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gGL.flush();
|
gGL.flush();
|
||||||
|
|
||||||
if (LLGLSLShader::sNoFixedFunction)
|
if (LLGLSLShader::sNoFixedFunction)
|
||||||
|
|||||||
Reference in New Issue
Block a user