summaryrefslogtreecommitdiff
path: root/indra/newview/llspatialpartition.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-05-29 05:37:38 -0500
committerDave Parks <davep@lindenlab.com>2010-05-29 05:37:38 -0500
commit0e7f4dc5cef8a97cb1dd08aa2f79538ced267888 (patch)
treef8556aa8a56a876bb0e1105bd7424da0ea05d17f /indra/newview/llspatialpartition.cpp
parent0a54fb6b24790263c45f096415fee0e2d03323e0 (diff)
Octree per LLVolumeFace WIP
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r--indra/newview/llspatialpartition.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 470c332b42..60e704d360 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2769,6 +2769,19 @@ void renderLights(LLDrawable* drawablep)
}
}
+class LLRenderOctree : public LLOctreeTraveler<LLVolumeFace::Triangle>
+{
+public:
+ void visit(const LLOctreeNode<LLVolumeFace::Triangle>* branch)
+ {
+ const LLVector3d& c = branch->getCenter();
+ const LLVector3d& s = branch->getSize();
+
+ LLVector3 pos((F32) c.mdV[0], (F32) c.mdV[1], (F32) c.mdV[2]);
+ LLVector3 size((F32) s.mdV[0], (F32) s.mdV[1], (F32) s.mdV[2]);
+ drawBoxOutline(pos, size);
+ }
+};
void renderRaycast(LLDrawable* drawablep)
{
@@ -2787,6 +2800,23 @@ void renderRaycast(LLDrawable* drawablep)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
pushVerts(drawablep->getFace(gDebugRaycastFaceHit), LLVertexBuffer::MAP_VERTEX);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+ LLVOVolume* vobj = drawablep->getVOVolume();
+ LLVolume* volume = vobj->getVolume();
+ if (volume && volume->getNumVolumeFaces() > gDebugRaycastFaceHit)
+ {
+ const LLVolumeFace& face = volume->getVolumeFace(gDebugRaycastFaceHit);
+ if (!face.mOctree)
+ {
+ ((LLVolumeFace*) &face)->createOctree();
+ }
+
+ gGL.pushMatrix();
+ glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix);
+ LLRenderOctree render;
+ render.traverse(face.mOctree);
+ gGL.popMatrix();
+ }
}
else if (drawablep->isAvatar())
{