summaryrefslogtreecommitdiff
path: root/indra/newview/llspatialpartition.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-05-04 17:43:26 +0000
committerAdam Moss <moss@lindenlab.com>2009-05-04 17:43:26 +0000
commitcc92525b0df952659102d2e5adcc4140fea7f371 (patch)
treeee1a9b63decb3667fb740a8c9b70bcfdbf9a054b /indra/newview/llspatialpartition.cpp
parent4bcbf3342284b19ff5fbda5a16a43a8cafb3baad (diff)
QAR-1476 Combo-merge to trunk: Viewer 1.23 RC0 and Simulator 1.26.3
svn merge -r118927:118939 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.0-merge-2-combo-QAR-1476 this is a composite of... svn merge -r115088:118182 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer_1-23 conflicts resolved: C doc/contributions.txt C indra/llaudio/audioengine.cpp C indra/newview/CMakeLists.txt C indra/newview/llfloaterlandholdings.cpp C indra/newview/llpaneldirbrowser.cpp C indra/newview/llpanelgrouplandmoney.cpp C indra/newview/llpreviewscript.cpp C indra/newview/llviewermenu.cpp C indra/newview/skins/default/xui/en-us/notifications.xml and... svn merge -r116937:118673 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26 minor-to-trivial conflicts resolved: C indra/llcommon/llversionserver.h C indra/newsim/llrezdata.cpp C indra/newsim/llstate.cpp C indra/upgrade/schema_version/sequence/3/index_log_paypal.sql
Diffstat (limited to 'indra/newview/llspatialpartition.cpp')
-rw-r--r--indra/newview/llspatialpartition.cpp54
1 files changed, 52 insertions, 2 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 6e5231bddd..f8b824732f 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2234,6 +2234,22 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
}
}
+void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color)
+{
+ gGL.color4fv(color.mV);
+ gGL.begin(LLRender::LINES);
+ {
+ gGL.vertex3fv((position - LLVector3(size, 0.f, 0.f)).mV);
+ gGL.vertex3fv((position + LLVector3(size, 0.f, 0.f)).mV);
+ gGL.vertex3fv((position - LLVector3(0.f, size, 0.f)).mV);
+ gGL.vertex3fv((position + LLVector3(0.f, size, 0.f)).mV);
+ gGL.vertex3fv((position - LLVector3(0.f, 0.f, size)).mV);
+ gGL.vertex3fv((position + LLVector3(0.f, 0.f, size)).mV);
+ }
+ gGL.end();
+}
+
+
void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
{
if (set_color)
@@ -2405,7 +2421,7 @@ void renderTextureAnim(LLDrawInfo* params)
}
LLGLEnable blend(GL_BLEND);
- gGL.color4f(1,1,0,0.5f);
+ glColor4f(1,1,0,0.5f);
pushVerts(params, LLVertexBuffer::MAP_VERTEX);
}
@@ -2507,6 +2523,25 @@ void renderRaycast(LLDrawable* drawablep)
}
}
+
+void renderAvatarCollisionVolumes(LLVOAvatar* avatar)
+{
+ avatar->renderCollisionVolumes();
+}
+
+void renderAgentTarget(LLVOAvatar* avatar)
+{
+ // render these for self only (why, i don't know)
+ if (avatar->isSelf())
+ {
+ renderCrossHairs(avatar->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f));
+ renderCrossHairs(avatar->mDrawable->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f));
+ renderCrossHairs(avatar->mRoot.getWorldPosition(), 0.2f, LLColor4(1, 1, 1, 0.8f));
+ renderCrossHairs(avatar->mPelvisp->getWorldPosition(), 0.2f, LLColor4(0, 0, 1, 0.8f));
+ }
+}
+
+
class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
{
public:
@@ -2591,6 +2626,19 @@ public:
{
renderRaycast(drawable);
}
+
+ LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(drawable->getVObj().get());
+
+ if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_VOLUME))
+ {
+ renderAvatarCollisionVolumes(avatar);
+ }
+
+ if (avatar && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AGENT_TARGET))
+ {
+ renderAgentTarget(avatar);
+ }
+
}
for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
@@ -2667,7 +2715,9 @@ void LLSpatialPartition::renderDebug()
LLPipeline::RENDER_DEBUG_POINTS |
LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY |
LLPipeline::RENDER_DEBUG_TEXTURE_ANIM |
- LLPipeline::RENDER_DEBUG_RAYCAST))
+ LLPipeline::RENDER_DEBUG_RAYCAST |
+ LLPipeline::RENDER_DEBUG_AVATAR_VOLUME |
+ LLPipeline::RENDER_DEBUG_AGENT_TARGET))
{
return;
}