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 006e15495515e6e4c233412a4deed0f34e7b0f12 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 d03a492cd1..d15017e0a1 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3931,6 +3931,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() @@ -4620,7 +4642,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 From 9226d42d12b9edb792d65b28254c633d0dc64edc Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 22 Apr 2010 21:40:38 +0100 Subject: Backed out changeset 78dddb3a1dd3 --- indra/newview/llselectmgr.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index d15017e0a1..d03a492cd1 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3931,28 +3931,6 @@ 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() @@ -4642,6 +4620,7 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) LLSelectMgr::getInstance()->highlightObjectAndFamily(objects); } + extern LLGLdouble gGLModelView[16]; void LLSelectMgr::updateSilhouettes() -- cgit v1.2.3 From 246dd9c168550bfe4b1b71bba75f5af9456e86dd Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 15 May 2010 02:45:58 -0500 Subject: Highlight for object cost and proper retrieval/display of prim object cost and linkset cost. --- indra/newview/llselectmgr.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e66be1023d..5acbae0c77 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6183,6 +6183,53 @@ S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) return count; } +F32 LLObjectSelection::getSelectedObjectCost() +{ + cleanupNodes(); + F32 cost = 0.f; + + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + cost += object->getObjectCost(); + } + } + + return cost; +} + +F32 LLObjectSelection::getSelectedLinksetCost() +{ + cleanupNodes(); + F32 cost = 0.f; + + std::set me_roots; + + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + LLViewerObject* root = static_cast(object->getRoot()); + if (root) + { + if (me_roots.find(root) == me_roots.end()) + { + me_roots.insert(root); + cost += root->getLinksetCost(); + } + } + } + } + + return cost; +} //----------------------------------------------------------------------------- // getTECount() -- cgit v1.2.3 From 26ba00b5554d20ee958693ced87b36fa7f6e3d99 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 3 Jun 2010 12:52:28 -0500 Subject: Vectorized octree and much of llspatialpartition and lldrawable. Octree driven raycast. --- indra/newview/llselectmgr.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e66be1023d..d6cff71991 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1100,8 +1100,8 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & mGridRotation = first_grid_object->getRenderRotation(); LLVector3 first_grid_obj_pos = first_grid_object->getRenderPosition(); - LLVector3 min_extents(F32_MAX, F32_MAX, F32_MAX); - LLVector3 max_extents(-F32_MAX, -F32_MAX, -F32_MAX); + LLVector4a min_extents(F32_MAX); + LLVector4a max_extents(-F32_MAX); BOOL grid_changed = FALSE; for (LLObjectSelection::iterator iter = mGridObjects.begin(); iter != mGridObjects.end(); ++iter) @@ -1110,7 +1110,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & LLDrawable* drawable = object->mDrawable; if (drawable) { - const LLVector3* ext = drawable->getSpatialExtents(); + const LLVector4a* ext = drawable->getSpatialExtents(); update_min_max(min_extents, max_extents, ext[0]); update_min_max(min_extents, max_extents, ext[1]); grid_changed = TRUE; @@ -1118,13 +1118,19 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & } if (grid_changed) { - mGridOrigin = lerp(min_extents, max_extents, 0.5f); + LLVector4a center, size; + center.setAdd(min_extents, max_extents); + center.mul(0.5f); + size.setSub(max_extents, min_extents); + size.mul(0.5f); + + mGridOrigin.set(center.getF32()); LLDrawable* drawable = first_grid_object->mDrawable; if (drawable && drawable->isActive()) { mGridOrigin = mGridOrigin * first_grid_object->getRenderMatrix(); } - mGridScale = (max_extents - min_extents) * 0.5f; + mGridScale.set(size.getF32()); } } else // GRID_MODE_WORLD or just plain default -- cgit v1.2.3 From f9b13d8f8510b1f7f02fcf92685471461b79858e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 10 Jun 2010 00:45:48 -0500 Subject: Add "LL_MESH_ENABLED" preprocessor flag for toggling mesh code. Couple of merge fixes. --- indra/newview/llselectmgr.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ceef03d2f8..0ce7ffb077 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6165,6 +6165,7 @@ S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) cleanupNodes(); S32 count = mList.size(); +#if LL_MESH_ENABLED if (mesh_adjust) { for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) @@ -6185,6 +6186,7 @@ S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) } } +#endif return count; } -- cgit v1.2.3 From 2530b057bb18550ed2825c14988a807ab90d460f Mon Sep 17 00:00:00 2001 From: "Karl Stiefvater (qarl)" Date: Thu, 1 Jul 2010 17:18:55 -0500 Subject: added new physics parameters to prims --- indra/newview/llselectmgr.cpp | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 559c802f51..8ab9910f67 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3937,15 +3937,33 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor -{ - LLSelectMgrApplyPhysicsShapeType(U8 value) : mValue(value) {} - U8 mValue; +struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor +{ + LLSelectMgrApplyPhysicsParam(U8 type, F32 gravity, BOOL material_override, + F32 friction, F32 density, F32 restitution) : + mType(type), + mGravity(gravity), + mMaterialOverride(material_override), + mFriction(friction), + mDensity(density), + mRestitution(restitution) + {} + U8 mType; + F32 mGravity; + BOOL mMaterialOverride; + F32 mFriction; + F32 mDensity; + F32 mRestitution; virtual bool apply(LLViewerObject* object) { if ( object->permModify() ) // preemptive permissions check { - object->setPhysicsShapeType( mValue ); + object->setPhysicsShapeType( mType ); + object->setPhysicsGravity(mGravity); + object->setPhysicsMaterialOverride(mMaterialOverride); + object->setPhysicsFriction(mFriction); + object->setPhysicsDensity(mDensity); + object->setPhysicsRestitution(mRestitution); object->updateFlags(); } return true; @@ -3953,10 +3971,11 @@ struct LLSelectMgrApplyPhysicsShapeType : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsShapeType(U8 type) +void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, BOOL material_override, + F32 friction, F32 density, F32 restitution) { llwarns << "physics shape type ->" << (U32)type << llendl; - LLSelectMgrApplyPhysicsShapeType func(type); + LLSelectMgrApplyPhysicsParam func(type, gravity, material_override, friction, density, restitution); getSelection()->applyToObjects(&func); } -- cgit v1.2.3 From 3733337011c781b6dabe978181d8ae4c5c96188b Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Fri, 9 Jul 2010 17:47:58 -0700 Subject: Gravity, Friction, Restitution, Density now work with simulator. --- indra/newview/llselectmgr.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8ab9910f67..c11a6f289b 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3939,18 +3939,16 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor { - LLSelectMgrApplyPhysicsParam(U8 type, F32 gravity, BOOL material_override, - F32 friction, F32 density, F32 restitution) : + LLSelectMgrApplyPhysicsParam(U8 type, F32 gravity, F32 friction, + F32 density, F32 restitution) : mType(type), mGravity(gravity), - mMaterialOverride(material_override), mFriction(friction), mDensity(density), mRestitution(restitution) {} U8 mType; F32 mGravity; - BOOL mMaterialOverride; F32 mFriction; F32 mDensity; F32 mRestitution; @@ -3960,7 +3958,6 @@ struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor { object->setPhysicsShapeType( mType ); object->setPhysicsGravity(mGravity); - object->setPhysicsMaterialOverride(mMaterialOverride); object->setPhysicsFriction(mFriction); object->setPhysicsDensity(mDensity); object->setPhysicsRestitution(mRestitution); @@ -3971,11 +3968,11 @@ struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor }; -void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, BOOL material_override, - F32 friction, F32 density, F32 restitution) +void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, F32 friction, + F32 density, F32 restitution) { llwarns << "physics shape type ->" << (U32)type << llendl; - LLSelectMgrApplyPhysicsParam func(type, gravity, material_override, friction, density, restitution); + LLSelectMgrApplyPhysicsParam func(type, gravity, friction, density, restitution); getSelection()->applyToObjects(&func); } -- cgit v1.2.3 From 5f9f6dcdec0de015e3c9a88afad6f4761c3c6527 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 6 Aug 2010 17:14:01 +0300 Subject: EXT-8577 WIP Context menu items for multi-attachments. Done: - 1. Dropped the obsolete "MultipleAttachments" setting. - 2. Added an "Add" item to the following attachment-related context menus: * My Appearance (ex-My Outfits) context menu. * Edit Outfit -> Add More context menu. * Object in-world context menu. * Inventory context menu. * Object inspector gear menu. - 3. Modified "Attach To / Attach To HUD" to perform the "add" instead of "replace" action. TODO: - Ability to attach multiple objects at once from the Add More panel (bulk attach). - Make sure there's no memleak when you click Wear/Attach in the in-world object context menu and the callback isn't invoked (because e.g. avatar fails to get close enough to the object). Issues: 0. I'm not sure whether LLAgentWearables::userAttachMultipleAttachments() should replace attachments or add them. Assumed the former. 1. I couldn't verify that adding objects from the object inspector menu works because I either could wear an object or see its inspector, not both. 2. > 1. Right-click on an object in your inventory and select "Wear". > VERIFY: Attaches the object and replaces whatever's there; asks for > confirmation before replacing an existing object. I think this is impossible to implement because we don't know in advance what point the object will be attached to, so we can't display a confirmation dialog. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/843/ --HG-- branch : product-engine --- indra/newview/llselectmgr.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 050b87bbe0..21f8485e90 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3615,7 +3615,7 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info) // Attachments //---------------------------------------------------------------------- -void LLSelectMgr::sendAttach(U8 attachment_point) +void LLSelectMgr::sendAttach(U8 attachment_point, bool replace) { LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject(); @@ -3629,9 +3629,12 @@ void LLSelectMgr::sendAttach(U8 attachment_point) if (0 == attachment_point || get_if_there(gAgentAvatarp->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) { - - if (gSavedSettings.getBOOL("MultipleAttachments")) + if (!replace || attachment_point != 0) + { + // If we know the attachment point then we got here by clicking an + // "Attach to..." context menu item, so we should add, not replace. attachment_point |= ATTACHMENT_ADD; + } sendListToRegions( "ObjectAttach", -- cgit v1.2.3 From 671609239f63bc6dc293a0580e6f1b8e48239b26 Mon Sep 17 00:00:00 2001 From: jwolk Date: Fri, 13 Aug 2010 17:30:09 -0700 Subject: Added new UI to show linked set cost and object cost. Changed terminology in edit tools. Updated request payload when requesting object cost. Paired with davep --- indra/newview/llselectmgr.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 6aadf0afd2..42f09f7396 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6182,29 +6182,6 @@ S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) cleanupNodes(); S32 count = mList.size(); -#if LL_MESH_ENABLED - 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; - } - } - - } - } -#endif - return count; } -- cgit v1.2.3 From 2fea1d5d33ec1b41a3cfa4307a1bfa58d8014f88 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 19 Aug 2010 12:25:15 -0500 Subject: Integrate SIMD API from oreh/server-trunk-oreh --- indra/newview/llselectmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 42f09f7396..92903a6aa9 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1124,13 +1124,13 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & size.setSub(max_extents, min_extents); size.mul(0.5f); - mGridOrigin.set(center.getF32()); + mGridOrigin.set(center.getF32ptr()); LLDrawable* drawable = first_grid_object->mDrawable; if (drawable && drawable->isActive()) { mGridOrigin = mGridOrigin * first_grid_object->getRenderMatrix(); } - mGridScale.set(size.getF32()); + mGridScale.set(size.getF32ptr()); } } else // GRID_MODE_WORLD or just plain default @@ -3543,7 +3543,7 @@ void LLSelectMgr::deselectAllIfTooFar() { if (mDebugSelectMgr) { - llinfos << "Selection manager: auto-deselecting, select_dist = " << fsqrtf(select_dist_sq) << llendl; + llinfos << "Selection manager: auto-deselecting, select_dist = " << (F32) sqrt(select_dist_sq) << llendl; llinfos << "agent pos global = " << gAgent.getPositionGlobal() << llendl; llinfos << "selection pos global = " << selectionCenter << llendl; } -- cgit v1.2.3 From c42ed54b0a532cb4e0ad30a1b0b5038cef9938f2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 20 Sep 2010 18:45:56 -0500 Subject: Stop using ll_aligned_malloc/free in llvolume. Fix for garbage data in vertex weight array crashing software skinning. Proper integration of picking for rigged attachhments. Optimization in LLDrawable::updateDistance (don't call updateRelativeXform, just use spatial group position). --- indra/newview/llselectmgr.cpp | 50 +++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 11 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ff2929695d..21f7e780e2 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5395,6 +5395,42 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) return (mPermissions->allowOperationBy(op, proxy_agent_id, group_id)); } + +//helper function for pushing relevant vertices from drawable to GL +void pushWireframe(LLDrawable* drawable) +{ + if (drawable->isState(LLDrawable::RIGGED)) + { //render straight from rigged volume if this is a rigged attachment + LLVOVolume* vobj = drawable->getVOVolume(); + if (vobj) + { + vobj->updateRiggedVolume(); + LLRiggedVolume* rigged_volume = vobj->getRiggedVolume(); + if (rigged_volume) + { + LLVertexBuffer::unbind(); + gGL.pushMatrix(); + glMultMatrixf((F32*) vobj->getRelativeXform().mMatrix); + for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i) + { + const LLVolumeFace& face = rigged_volume->getVolumeFace(i); + glVertexPointer(3, GL_FLOAT, 16, face.mPositions); + glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + } + gGL.popMatrix(); + } + } + } + else + { + for (S32 i = 0; i < drawable->getNumFaces(); ++i) + { + LLFace* face = drawable->getFace(i); + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } + } +} + void LLSelectNode::renderOneWireframe(const LLColor4& color) { LLViewerObject* objectp = getObject(); @@ -5442,11 +5478,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) 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); - } + pushWireframe(drawable); } } @@ -5455,13 +5487,9 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) 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); + glPolygonOffset(3.f, 3.f); glLineWidth(3.f); - for (S32 i = 0; i < drawable->getNumFaces(); ++i) - { - LLFace* face = drawable->getFace(i); - pushVerts(face, LLVertexBuffer::MAP_VERTEX); - } + pushWireframe(drawable); glLineWidth(1.f); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); gGL.popMatrix(); -- cgit v1.2.3 From 90e3d83a5cb35e98a02a3017dd79ebc272bbfe85 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Sep 2010 13:26:52 -0400 Subject: Fix for build failures - disabling tcmalloc for now --- indra/newview/llselectmgr.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llselectmgr.cpp (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From 0c93da0501ab1debd6fa11af29a215be81f7b803 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 29 Sep 2010 16:09:21 -0500 Subject: SH-224 Add new streaming cost algorithm debug displays to viewer. Add the ability to clear LOD slots. Make triangle count UI more responsive to Generate LOD button. Add triangle count debug display for current selection. Reviewed by Nyx --- indra/newview/llselectmgr.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index d16685e088..57e04a43a2 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6230,6 +6230,40 @@ F32 LLObjectSelection::getSelectedObjectCost() return cost; } +F32 LLObjectSelection::getSelectedObjectStreamingCost() +{ + F32 cost = 0.f; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + cost += object->getStreamingCost(); + } + } + + return cost; +} + +U32 LLObjectSelection::getSelectedObjectTriangleCount() +{ + U32 count = 0; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + count += object->getTriangleCount(); + } + } + + return count; +} + F32 LLObjectSelection::getSelectedLinksetCost() { cleanupNodes(); -- cgit v1.2.3 From b70ccfe8e31cd253069a6e0ae0ec03e301d26578 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 7 Oct 2010 14:00:43 -0500 Subject: Add pure physics cost to UI --- indra/newview/llselectmgr.cpp | 65 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 8 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 57e04a43a2..f819e9fcbc 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6230,9 +6230,13 @@ F32 LLObjectSelection::getSelectedObjectCost() return cost; } -F32 LLObjectSelection::getSelectedObjectStreamingCost() +F32 LLObjectSelection::getSelectedLinksetCost() { + cleanupNodes(); F32 cost = 0.f; + + std::set me_roots; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) { LLSelectNode* node = *iter; @@ -6240,16 +6244,26 @@ F32 LLObjectSelection::getSelectedObjectStreamingCost() if (object) { - cost += object->getStreamingCost(); + LLViewerObject* root = static_cast(object->getRoot()); + if (root) + { + if (me_roots.find(root) == me_roots.end()) + { + me_roots.insert(root); + cost += root->getLinksetCost(); + } + } } } return cost; } -U32 LLObjectSelection::getSelectedObjectTriangleCount() +F32 LLObjectSelection::getSelectedPhysicsCost() { - U32 count = 0; + cleanupNodes(); + F32 cost = 0.f; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) { LLSelectNode* node = *iter; @@ -6257,14 +6271,14 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() if (object) { - count += object->getTriangleCount(); + cost += object->getPhysicsCost(); } } - return count; + return cost; } -F32 LLObjectSelection::getSelectedLinksetCost() +F32 LLObjectSelection::getSelectedLinksetPhysicsCost() { cleanupNodes(); F32 cost = 0.f; @@ -6284,7 +6298,7 @@ F32 LLObjectSelection::getSelectedLinksetCost() if (me_roots.find(root) == me_roots.end()) { me_roots.insert(root); - cost += root->getLinksetCost(); + cost += root->getLinksetPhysicsCost(); } } } @@ -6293,6 +6307,41 @@ F32 LLObjectSelection::getSelectedLinksetCost() return cost; } +F32 LLObjectSelection::getSelectedObjectStreamingCost() +{ + F32 cost = 0.f; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + cost += object->getStreamingCost(); + } + } + + return cost; +} + +U32 LLObjectSelection::getSelectedObjectTriangleCount() +{ + U32 count = 0; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + count += object->getTriangleCount(); + } + } + + return count; +} + + //----------------------------------------------------------------------------- // getTECount() //----------------------------------------------------------------------------- -- cgit v1.2.3 From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/newview/llselectmgr.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f819e9fcbc..728694117c 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2,31 +2,25 @@ * @file llselectmgr.cpp * @brief A manager for selected objects and faces. * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 5e57352e1295d33cf9815800393212824d53bb75 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 18 Nov 2010 16:42:57 -0500 Subject: SH-350 SH-351 SH-355 FIX Several fixes for ARC Fixed the texture resolution calculation against the rounding errors we had before. Fixed the bug where linking prims changed the combined cost Fixed the bug where twisting was not computed properly Code reviewed by davep. --- indra/newview/llselectmgr.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 728694117c..eb1ca66334 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6335,6 +6335,33 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return count; } +S32 LLObjectSelection::getSelectedObjectRenderCost() +{ + S32 cost = 0; + LLVOVolume::texture_cost_t textures; + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLVOVolume* object = (LLVOVolume*)node->getObject(); + + if (object) + { + cost += object->getRenderCost(textures); + } + + for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + { + // add the cost of each individual texture in the linkset + cost += iter->second; + llinfos << "adding texture cost of: " << iter->second << llendl; + } + textures.clear(); + } + + + return cost; +} + //----------------------------------------------------------------------------- // getTECount() -- cgit v1.2.3 From 52f397ec7a0f0698ea24c05c1bd538ec17161714 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 18 Nov 2010 17:28:13 -0500 Subject: SH-350 SH-351 SH-355 FIX ARC fixes Had a few debugging lines in my last checkin. Cleaning up unreviewed changes. --- indra/newview/llselectmgr.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index eb1ca66334..305b629cf7 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6353,7 +6353,6 @@ S32 LLObjectSelection::getSelectedObjectRenderCost() { // add the cost of each individual texture in the linkset cost += iter->second; - llinfos << "adding texture cost of: " << iter->second << llendl; } textures.clear(); } -- cgit v1.2.3 From c1db849c418d2cef8c321199ad1421b183aff9bf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 20 Jan 2011 15:50:03 -0600 Subject: SH-635 Fix for changing one physics parameter changing all physics parameters. --- indra/newview/llselectmgr.cpp | 136 ++++++++++++++++++++++++++++++------------ 1 file changed, 97 insertions(+), 39 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 305b629cf7..44ccbe22f7 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1889,6 +1889,103 @@ BOOL LLSelectMgr::selectionGetGlow(F32 *glow) return identical; } + +void LLSelectMgr::selectionSetPhysicsType(U8 type) +{ + struct f : public LLSelectedObjectFunctor + { + U8 mType; + f(const U8& t) : mType(t) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsShapeType(mType); + object->updateFlags(); + } + return true; + } + } sendfunc(type); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetFriction(F32 friction) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mFriction; + f(const F32& friction) : mFriction(friction) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsFriction(mFriction); + object->updateFlags(); + } + return true; + } + } sendfunc(friction); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetGravity(F32 gravity ) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mGravity; + f(const F32& gravity) : mGravity(gravity) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsGravity(mGravity); + object->updateFlags(); + } + return true; + } + } sendfunc(gravity); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetDensity(F32 density ) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mDensity; + f(const F32& density ) : mDensity(density) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsDensity(mDensity); + object->updateFlags(); + } + return true; + } + } sendfunc(density); + getSelection()->applyToObjects(&sendfunc); +} + +void LLSelectMgr::selectionSetRestitution(F32 restitution) +{ + struct f : public LLSelectedObjectFunctor + { + F32 mRestitution; + f(const F32& restitution ) : mRestitution(restitution) {} + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->setPhysicsRestitution(mRestitution); + object->updateFlags(); + } + return true; + } + } sendfunc(restitution); + getSelection()->applyToObjects(&sendfunc); +} + + //----------------------------------------------------------------------------- // selectionSetMaterial() //----------------------------------------------------------------------------- @@ -3936,45 +4033,6 @@ void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) getSelection()->applyToObjects(&func); } -struct LLSelectMgrApplyPhysicsParam : public LLSelectedObjectFunctor -{ - LLSelectMgrApplyPhysicsParam(U8 type, F32 gravity, F32 friction, - F32 density, F32 restitution) : - mType(type), - mGravity(gravity), - mFriction(friction), - mDensity(density), - mRestitution(restitution) - {} - U8 mType; - F32 mGravity; - F32 mFriction; - F32 mDensity; - F32 mRestitution; - virtual bool apply(LLViewerObject* object) - { - if ( object->permModify() ) // preemptive permissions check - { - object->setPhysicsShapeType( mType ); - object->setPhysicsGravity(mGravity); - object->setPhysicsFriction(mFriction); - object->setPhysicsDensity(mDensity); - object->setPhysicsRestitution(mRestitution); - object->updateFlags(); - } - return true; - } -}; - - -void LLSelectMgr::selectionUpdatePhysicsParam(U8 type, F32 gravity, F32 friction, - F32 density, F32 restitution) -{ - llwarns << "physics shape type ->" << (U32)type << llendl; - LLSelectMgrApplyPhysicsParam func(type, gravity, friction, density, restitution); - getSelection()->applyToObjects(&func); -} - //---------------------------------------------------------------------- // Helpful packing functions for sendObjectMessage() //---------------------------------------------------------------------- -- cgit v1.2.3 From 159afd141d1a4de595084c70f2025e783e3defa8 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Fri, 28 Jan 2011 16:37:27 -0800 Subject: SH-753 - Ghost meshes Fix the case where the silhouette shown when editing a mesh in an adjacent region was showing up in the wrong place. The silhouette was not being translated by the avs view with respect to the region. --- indra/newview/llselectmgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 44ccbe22f7..8ffbd5510d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5490,13 +5490,15 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); - + BOOL is_hud_object = objectp->isHUDAttachment(); if (!is_hud_object) { glLoadIdentity(); glMultMatrixd(gGLModelView); + LLVector3 trans = objectp->getRegion()->getOriginAgent(); + glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); } if (drawable->isActive()) -- cgit v1.2.3 From 8b15ca8d6b9cf516670e66ee57591e79b898394d Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 7 Feb 2011 21:03:10 -0500 Subject: SH-930 FIX revert ARC algorithm for merge to viewer-development Reverting incomplete changes to ARC so that we don't change RC when we merge down. --- indra/newview/llselectmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8ffbd5510d..e0b9f1d736 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6395,7 +6395,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return count; } -S32 LLObjectSelection::getSelectedObjectRenderCost() +/*S32 LLObjectSelection::getSelectedObjectRenderCost() { S32 cost = 0; LLVOVolume::texture_cost_t textures; @@ -6419,7 +6419,7 @@ S32 LLObjectSelection::getSelectedObjectRenderCost() return cost; -} +}*/ //----------------------------------------------------------------------------- -- cgit v1.2.3 From a242129b571daa8c6137c79931e31f9d43422abc Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 8 Feb 2011 15:53:50 -0600 Subject: SH-523 Fix for non-finite values in silhouette rendering resulting in silhouette segments pointing at center of screen. --- indra/newview/llselectmgr.cpp | 94 +++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 49 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8ffbd5510d..29a16ccc97 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5204,7 +5204,6 @@ LLSelectNode::LLSelectNode(const LLSelectNode& nodep) mSilhouetteVertices = nodep.mSilhouetteVertices; mSilhouetteNormals = nodep.mSilhouetteNormals; - mSilhouetteSegments = nodep.mSilhouetteSegments; mSilhouetteExists = nodep.mSilhouetteExists; mObject = nodep.mObject; @@ -5628,17 +5627,15 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.begin(LLRender::LINES); { - S32 i = 0; - for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) + for(S32 i = 0; i < mSilhouetteVertices.size(); i += 2) { - for(; i < mSilhouetteSegments[seg_num]; i++) - { - u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - - gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); - gGL.texCoord2f( u_coord, v_coord ); - gGL.vertex3fv( mSilhouetteVertices[i].mV ); - } + u_coord += u_divisor * LLSelectMgr::sHighlightUScale; + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + gGL.texCoord2f( u_coord, v_coord ); + gGL.vertex3fv( mSilhouetteVertices[i].mV); + u_coord += u_divisor * LLSelectMgr::sHighlightUScale; + gGL.texCoord2f( u_coord, v_coord ); + gGL.vertex3fv(mSilhouetteVertices[i+1].mV); } } gGL.end(); @@ -5649,51 +5646,50 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.begin(LLRender::TRIANGLES); { - S32 i = 0; - for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) + for(S32 i = 0; i < mSilhouetteVertices.size(); i+=2) { - S32 first_i = i; - LLVector3 v; - LLVector2 t; + if (!mSilhouetteNormals[i].isFinite() || + !mSilhouetteNormals[i+1].isFinite()) + { //skip skewed segments + continue; + } - for(; i < mSilhouetteSegments[seg_num]; i++) - { + LLVector3 v[4]; + LLVector2 tc[4]; + v[0] = mSilhouetteVertices[i] + (mSilhouetteNormals[i] * silhouette_thickness); + tc[0].set(u_coord, v_coord + LLSelectMgr::sHighlightVScale); - if (i == first_i) { - LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; - vert += mSilhouetteVertices[i]; + v[1] = mSilhouetteVertices[i]; + tc[1].set(u_coord, v_coord); - gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); - gGL.texCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); - gGL.vertex3fv( vert.mV ); - - u_coord += u_divisor * LLSelectMgr::sHighlightUScale; + u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); - gGL.texCoord2f( u_coord, v_coord ); - gGL.vertex3fv( mSilhouetteVertices[i].mV ); + v[2] = mSilhouetteVertices[i+1] + (mSilhouetteNormals[i+1] * silhouette_thickness); + tc[2].set(u_coord, v_coord + LLSelectMgr::sHighlightVScale); + + v[3] = mSilhouetteVertices[i+1]; + tc[3].set(u_coord,v_coord); - v = mSilhouetteVertices[i]; - t = LLVector2(u_coord, v_coord); - } - else { - LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; - vert += mSilhouetteVertices[i]; - - gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); - gGL.texCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); - gGL.vertex3fv( vert.mV ); - gGL.vertex3fv( vert.mV ); - - gGL.texCoord2fv(t.mV); - u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); - gGL.vertex3fv(v.mV); - gGL.texCoord2f( u_coord, v_coord ); - gGL.vertex3fv( mSilhouetteVertices[i].mV ); + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); + gGL.texCoord2fv(tc[0].mV); + gGL.vertex3fv( v[0].mV ); + + gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + gGL.texCoord2fv( tc[1].mV ); + gGL.vertex3fv( v[1].mV ); - } - } + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); + gGL.texCoord2fv( tc[2].mV ); + gGL.vertex3fv( v[2].mV ); + + gGL.vertex3fv( v[2].mV ); + + gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + gGL.texCoord2fv( tc[1].mV ); + gGL.vertex3fv( v[1].mV ); + + gGL.texCoord2fv( tc[3].mV ); + gGL.vertex3fv( v[3].mV ); } } gGL.end(); -- cgit v1.2.3 From 479b5ac8ac54ea0442a237ce55f439e465316ad0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 11 Feb 2011 13:30:37 -0600 Subject: SH-510 Fix for some mesh selection outlines appearing one region away. --- 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 746ba274ed..93c9131424 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5492,7 +5492,12 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) BOOL is_hud_object = objectp->isHUDAttachment(); - if (!is_hud_object) + if (drawable->isActive()) + { + glLoadMatrixd(gGLModelView); + glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); + } + else if (!is_hud_object) { glLoadIdentity(); glMultMatrixd(gGLModelView); @@ -5500,11 +5505,6 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glTranslatef(trans.mV[0], trans.mV[1], trans.mV[2]); } - if (drawable->isActive()) - { - glMultMatrixf((F32*) objectp->getRenderMatrix().mMatrix); - } - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) -- cgit v1.2.3 From a9412b6d2e43175081a764493126ac716ee828d3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 7 Mar 2011 17:28:04 -0600 Subject: SH-1085 Potential fix for crash when disabling mirror. --- indra/newview/llselectmgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 93c9131424..e57e38d141 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5468,7 +5468,10 @@ void pushWireframe(LLDrawable* drawable) for (S32 i = 0; i < drawable->getNumFaces(); ++i) { LLFace* face = drawable->getFace(i); - pushVerts(face, LLVertexBuffer::MAP_VERTEX); + if (face->verify()) + { + pushVerts(face, LLVertexBuffer::MAP_VERTEX); + } } } } -- cgit v1.2.3 From 9044526994bb51b631a9a0cb7d6d6911a15957c6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 10 Mar 2011 00:10:25 -0600 Subject: SH-755 Set physics shape type to convex hull on delink if physics shape type was none. --- indra/newview/llselectmgr.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 21a457c125..b139ba361e 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -3902,6 +3902,26 @@ void LLSelectMgr::sendDelink() return; } + struct f : public LLSelectedObjectFunctor + { //on delink, any modifyable object should + f() {} + + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + if (object->getPhysicsShapeType() == LLViewerObject::PHYSICS_SHAPE_NONE) + { + object->setPhysicsShapeType(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL); + object->updateFlags(); + } + } + return true; + } + } sendfunc; + getSelection()->applyToObjects(&sendfunc); + + // Delink needs to send individuals so you can unlink a single object from // a linked set. sendListToRegions( -- cgit v1.2.3 From 6b9a2d24cce8efaa72c2fd60655998844394312d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 30 Mar 2011 18:38:22 -0500 Subject: SH-477 Better mesh streaming cost estimation. --- indra/newview/llselectmgr.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b139ba361e..78ffc7908d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6374,7 +6374,7 @@ BOOL LLObjectSelection::isEmpty() const //----------------------------------------------------------------------------- // getObjectCount() - returns number of non null objects //----------------------------------------------------------------------------- -S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) +S32 LLObjectSelection::getObjectCount() { cleanupNodes(); S32 count = mList.size(); @@ -6478,7 +6478,7 @@ F32 LLObjectSelection::getSelectedLinksetPhysicsCost() return cost; } -F32 LLObjectSelection::getSelectedObjectStreamingCost() +F32 LLObjectSelection::getSelectedObjectStreamingCost(S32* total_bytes, S32* visible_bytes) { F32 cost = 0.f; for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) @@ -6488,7 +6488,19 @@ F32 LLObjectSelection::getSelectedObjectStreamingCost() if (object) { - cost += object->getStreamingCost(); + S32 bytes = 0; + S32 visible = 0; + cost += object->getStreamingCost(&bytes, &visible); + + if (total_bytes) + { + *total_bytes += bytes; + } + + if (visible_bytes) + { + *visible_bytes += visible; + } } } -- cgit v1.2.3 From a4e49310a57cab3d5041ec733d80ce50dadf4c64 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 2 May 2011 18:01:27 -0500 Subject: STORM-1210 fsqrtf cleanup --- indra/newview/llselectmgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f76cbcb465..9b264b81c7 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6983,7 +6983,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ, // factor the distance into the displacement vector. This will get us // equally visible movements for both close and far away selections. - F32 min_dist = sqrt(fsqrtf(min_dist_squared)) / 2; + F32 min_dist = sqrt((F32) sqrtf(min_dist_squared)) / 2; displ_global.setVec(displ.mV[0] * min_dist, displ.mV[1] * min_dist, displ.mV[2] * min_dist); -- cgit v1.2.3 From 781af27e9cd500f6d62bc2d4658180f154af8816 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 9 May 2011 13:49:20 -0400 Subject: SH-1419 Sim complains about changing physical materials when Physics, Temporary, or Phantom is changed. --- indra/newview/llselectmgr.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9b264b81c7..8fa4065fa6 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1997,7 +1997,7 @@ void LLSelectMgr::selectionSetPhysicsType(U8 type) if (object->permModify()) { object->setPhysicsShapeType(mType); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2016,7 +2016,7 @@ void LLSelectMgr::selectionSetFriction(F32 friction) if (object->permModify()) { object->setPhysicsFriction(mFriction); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2035,7 +2035,7 @@ void LLSelectMgr::selectionSetGravity(F32 gravity ) if (object->permModify()) { object->setPhysicsGravity(mGravity); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2054,7 +2054,7 @@ void LLSelectMgr::selectionSetDensity(F32 density ) if (object->permModify()) { object->setPhysicsDensity(mDensity); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } @@ -2073,7 +2073,7 @@ void LLSelectMgr::selectionSetRestitution(F32 restitution) if (object->permModify()) { object->setPhysicsRestitution(mRestitution); - object->updateFlags(); + object->updateFlags(TRUE); } return true; } -- cgit v1.2.3