From 3e80fa3dbc943de9b784fedc202ba38cf238f46d Mon Sep 17 00:00:00 2001 From: David Parks Date: Mon, 2 Nov 2009 19:55:37 +0000 Subject: Sync up with render-pipeline-7 ignore-dead-branch --- indra/newview/llselectmgr.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index a7f0ce16d3..a5e3a0492b 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -173,7 +173,6 @@ LLObjectSelection *get_null_object_selection() return sNullSelection; } - //----------------------------------------------------------------------------- // LLSelectMgr() //----------------------------------------------------------------------------- @@ -5301,6 +5300,78 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) return (mPermissions->allowOperationBy(op, proxy_agent_id, group_id)); } +void LLSelectNode::renderOneWireframe(const LLColor4& color) +{ + LLViewerObject* objectp = getObject(); + if (!objectp) + { + return; + } + + LLDrawable* drawable = objectp->mDrawable; + if(!drawable) + { + return; + } + + glMatrixMode(GL_MODELVIEW); + gGL.pushMatrix(); + + BOOL is_hud_object = objectp->isHUDAttachment(); + + if (!is_hud_object) + { + glLoadIdentity(); + glMultMatrixd(gGLModelView); + } + + if (drawable->isActive()) + { + glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); + } + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) + { + gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); + LLGLEnable fog(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgent.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); + glFogf(GL_FOG_START, d); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); + glFogfv(GL_FOG_COLOR, fogCol.mV); + + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + { + glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } + } + } + + gGL.flush(); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + glPolygonOffset(3.f, 2.f); + glLineWidth(3.f); + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } + glLineWidth(1.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + gGL.popMatrix(); +} + //----------------------------------------------------------------------------- // renderOneSilhouette() //----------------------------------------------------------------------------- @@ -5318,6 +5389,13 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) return; } + LLVOVolume* vobj = drawable->getVOVolume(); + if (vobj && vobj->isMesh()) + { + renderOneWireframe(color); + return; + } + if (!mSilhouetteExists) { return; -- cgit v1.2.3 From a0802dd33996df650a473577fc75bf8276f0d20b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 22 Dec 2009 17:48:52 -0600 Subject: Added prim cost equivalency to UI for importer and tools floater. --- indra/newview/llselectmgr.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 852f58e354..4ef68df634 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -68,6 +68,7 @@ #include "llhudmanager.h" #include "llinventorymodel.h" #include "llmenugl.h" +#include "llmeshrepository.h" #include "llmutelist.h" #include "llsidepaneltaskinfo.h" #include "llslurl.h" @@ -6124,10 +6125,32 @@ BOOL LLObjectSelection::isEmpty() const //----------------------------------------------------------------------------- // getObjectCount() - returns number of non null objects //----------------------------------------------------------------------------- -S32 LLObjectSelection::getObjectCount() +S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) { cleanupNodes(); S32 count = mList.size(); + + if (mesh_adjust) + { + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object && object->getVolume()) + { + LLVOVolume* vobj = (LLVOVolume*) object; + if (vobj->isMesh()) + { + LLUUID mesh_id = vobj->getVolume()->getParams().getSculptID(); + U32 cost = gMeshRepo.getResourceCost(mesh_id); + count += cost-1; + } + } + + } + } + return count; } -- cgit v1.2.3 From ce504224de16776ade2a01adfbd5410fae6942cc Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 6 Feb 2010 20:50:49 -0600 Subject: Fix for bad GL blend function caching. --- indra/newview/llselectmgr.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9540894646..d733574a9d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4919,13 +4919,15 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) // set up transform to encompass bounding box of HUD glMatrixMode(GL_PROJECTION); - glPushMatrix(); + gGL.pushMatrix(); glLoadIdentity(); F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f); glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.pushMatrix(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); glLoadIdentity(); glLoadMatrixf(OGL_TO_CFR_ROTATION); // Load Cory's favorite reference frame glTranslatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); @@ -5022,10 +5024,11 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (for_hud && avatar) { glMatrixMode(GL_PROJECTION); - glPopMatrix(); + gGL.popMatrix(); glMatrixMode(GL_MODELVIEW); - glPopMatrix(); + gGL.popMatrix(); + gGL.popUIMatrix(); stop_glerror(); } @@ -5374,7 +5377,10 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) } glMatrixMode(GL_MODELVIEW); - glPushMatrix(); + gGL.pushMatrix(); + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + if (!is_hud_object) { glLoadIdentity(); @@ -5493,7 +5499,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.end(); gGL.flush(); } - glPopMatrix(); + gGL.popMatrix(); + gGL.popUIMatrix(); } // -- cgit v1.2.3 From 92257b55a405f3625cbbcf07357b3ca929a04882 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Fri, 26 Mar 2010 18:23:05 -0700 Subject: DEV-47845 Fix to work with TCP/LLSD message. This checkin is experimental, so if it breaks a build, just revert to the previous changeset. --- indra/newview/llselectmgr.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f45abca246..9d1893b68a 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3930,6 +3930,28 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } +struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor +{ + LLSelectMgrApplyPhysicsRep(U8 value) : mValue(value) {} + U8 mValue; + virtual bool apply(LLViewerObject* object) + { + if ( object->permModify() ) // preemptive permissions check + { + object->setPhysicsRep( mValue ); + object->updateFlags(); + } + return true; + } +}; + + +void LLSelectMgr::selectionUpdatePhysicsRep(U8 rep) +{ + llwarns << "physics rep ->" << (U32)rep << llendl; + LLSelectMgrApplyPhysicsRep func(rep); + getSelection()->applyToObjects(&func); +} //---------------------------------------------------------------------- // Helpful packing functions for sendObjectMessage() @@ -4619,7 +4641,6 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) LLSelectMgr::getInstance()->highlightObjectAndFamily(objects); } - extern LLGLdouble gGLModelView[16]; void LLSelectMgr::updateSilhouettes() -- cgit v1.2.3 From b2381a039de7e0edbd643d198b85ba8e00524b6b Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Wed, 31 Mar 2010 17:35:26 -0700 Subject: DEV-47845 Cleaned up names. --- indra/newview/llselectmgr.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9d1893b68a..89fb6bf4df 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3930,15 +3930,15 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor +struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor { - LLSelectMgrApplyPhysicsRep(U8 value) : mValue(value) {} + LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {} U8 mValue; virtual bool apply(LLViewerObject* object) { if ( object->permModify() ) // preemptive permissions check { - object->setPhysicsRep( mValue ); + object->setPhysicsShapeType( mValue ); object->updateFlags(); } return true; @@ -3946,10 +3946,10 @@ struct LLSelectMgrApplyPhysicsRep : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsRep(U8 rep) +void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type) { - llwarns << "physics rep ->" << (U32)rep << llendl; - LLSelectMgrApplyPhysicsRep func(rep); + llwarns << "physics shape type ->" << (U32)type << llendl; + LLSelectMgrApplyPhysicsShapeType func(type); getSelection()->applyToObjects(&func); } -- cgit v1.2.3