From 9aaf4b3ba764cb29c806adb80f16b28436f1183f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 9 Feb 2011 22:08:43 -0800 Subject: STORM-981 : Fix Linux link issues when LL_TESTS is ON --- doc/contributions.txt | 1 + indra/cmake/GoogleMock.cmake | 5 +++-- indra/cmake/LLAddBuildTest.cmake | 5 ----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 516760aa5a..4377a83b33 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -86,6 +86,7 @@ Aleric Inglewood VWR-24320 VWR-24321 VWR-24354 + VWR-24366 VWR-24519 SNOW-84 SNOW-477 diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake index ca5a8034ba..06d6d847a0 100644 --- a/indra/cmake/GoogleMock.cmake +++ b/indra/cmake/GoogleMock.cmake @@ -8,9 +8,10 @@ set(GOOGLEMOCK_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) if (LINUX) + # VWR-24366: gmock is underlinked, it needs gtest. set(GOOGLEMOCK_LIBRARIES - gmock - gtest) + gmock -Wl,--no-as-needed + gtest -Wl,--as-needed) elseif(WINDOWS) set(GOOGLEMOCK_LIBRARIES gmock) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 05f0492234..cd0eada2d0 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -57,11 +57,6 @@ INCLUDE(GoogleMock) ${CMAKE_SOURCE_DIR}/test/test.h ) - # Use the default flags - if (LINUX) - SET(CMAKE_EXE_LINKER_FLAGS "") - endif (LINUX) - # start the source test executable definitions SET(${project}_TEST_OUTPUT "") FOREACH (source ${sources}) -- cgit v1.2.3 From c28fe65252a0d2bda2d0bc488aa8f9b683e51d95 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 14 Feb 2011 14:15:12 -0800 Subject: debug_console is now resizable Reviewed with Callum Linden. --- indra/newview/skins/default/xui/en/floater_region_debug_console.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml index cf95257b0a..7c7ee2df4c 100644 --- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml +++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml @@ -2,6 +2,7 @@ Date: Wed, 16 Feb 2011 14:45:41 -0800 Subject: SH-957 Turning off Atmospheric Shaders greys out Lighting and Shadows options in preferences but does not turn off shadows inworld --- indra/newview/llviewermenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index cfcce3e7bb..37aa080228 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2069,7 +2069,7 @@ class LLAdvancedEnableRenderDeferred: public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gGLManager.mHasFramebufferObject && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT > 0) && + bool new_value = gGLManager.mHasFramebufferObject && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1 && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0; return new_value; } @@ -2082,7 +2082,7 @@ class LLAdvancedEnableRenderDeferredOptions: public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = gGLManager.mHasFramebufferObject && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT > 0) && + bool new_value = gGLManager.mHasFramebufferObject && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WINDLIGHT) > 1 && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) > 0 && gSavedSettings.getBOOL("RenderDeferred"); return new_value; } -- cgit v1.2.3 From fcde7004475089985822867fa1ebd64202a3154d Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 16 Feb 2011 17:55:02 -0500 Subject: Fix for problem with pelvis offset --- indra/newview/llvoavatar.cpp | 58 ++++++++++++++++++++++++-------------------- indra/newview/llvoavatar.h | 3 ++- indra/newview/llvovolume.cpp | 13 ++++------ 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b1a5ea0fd6..439584c7e8 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -760,6 +760,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mRuthDebugTimer.reset(); mDebugExistenceTimer.reset(); mPelvisOffset = LLVector3(0.0f,0.0f,0.0f); + mLastPelvisToFoot = 0.0f; } //------------------------------------------------------------------------ @@ -1331,7 +1332,20 @@ const LLVector3 LLVOAvatar::getRenderPosition() const } else if (isRoot()) { - return mDrawable->getPositionAgent(); + if ( mHasPelvisOffset ) + { + LLVector3 returnVec( mDrawable->getPositionAgent() ); + //1. Move the pelvis down by the old amount + returnVec[VZ] -= (mLastPelvisToFoot); + //2. Now move the pelvis up by the new amount + returnVec[VZ] += mPelvisToFoot; + //3. Return the fixed up pelvis position + return returnVec; + } + else + { + return mDrawable->getPositionAgent(); + } } else { @@ -3454,20 +3468,13 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (isSelf()) { - if ( !mHasPelvisOffset ) - { - gAgent.setPositionAgent(getRenderPosition()); - } - else - { - gAgent.setPositionAgent( getRenderPosition() + mPelvisOffset ); - } + gAgent.setPositionAgent(getRenderPosition()); } root_pos = gAgent.getPosGlobalFromAgent(getRenderPosition()); resolveHeightGlobal(root_pos, ground_under_pelvis, normal); - F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]); + F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]); BOOL in_air = ((!LLWorld::getInstance()->getRegionFromPosGlobal(ground_under_pelvis)) || foot_to_ground > FOOT_GROUND_COLLISION_TOLERANCE); @@ -3479,22 +3486,21 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation - root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; - + if ( !mHasPelvisOffset ) + { + root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; + } + else + { + root_pos.mdV[VZ] -= (0.65f * mBodySize.mV[VZ]) - mPelvisToFoot; + } + LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); if (newPosition != mRoot.getXform()->getWorldPosition()) { - if ( !mHasPelvisOffset ) - { - mRoot.touch(); - mRoot.setWorldPosition( newPosition ); // regular update - } - else - { - mRoot.touch(); - mRoot.setWorldPosition( newPosition + mPelvisOffset ); - } + mRoot.touch(); + mRoot.setWorldPosition( newPosition ); // regular update } @@ -3770,7 +3776,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) return TRUE; } - //----------------------------------------------------------------------------- // updateHeadOffset() //----------------------------------------------------------------------------- @@ -3803,6 +3808,7 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount mHasPelvisOffset = hasOffset; if ( mHasPelvisOffset ) { + mLastPelvisToFoot = mPelvisToFoot; mPelvisOffset = offsetAmount; } } @@ -3810,9 +3816,10 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount // postPelvisSetRecalc //------------------------------------------------------------------------ void LLVOAvatar::postPelvisSetRecalc( void ) -{ +{ computeBodySize(); - mRoot.updateWorldMatrixChildren(); + mRoot.touch(); + mRoot.updateWorldMatrixChildren(); dirtyMesh(); updateHeadOffset(); } @@ -4543,7 +4550,6 @@ void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d start_pt, const LLVec LLWorld::getInstance()->resolveStepHeightGlobal(this, start_pt, end_pt, out_pos, out_norm, &obj); } - void LLVOAvatar::resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm) { LLVector3d zVec(0.0f, 0.0f, 0.5f); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 99d0ed76e5..1152475383 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -298,7 +298,7 @@ public: bool mHasPelvisOffset; LLVector3 mPelvisOffset; - + F32 mLastPelvisToFoot; LLVector3 mHeadOffset; // current head position LLViewerJoint mRoot; @@ -805,6 +805,7 @@ protected: //-------------------------------------------------------------------- public: void resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm); + bool distanceToGround( const LLVector3d &startPoint, LLVector3d &collisionPoint, F32 distToIntersectionAlongRay ); void resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm); void resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm); void slamPosition(); // Slam position to transmitted position (for teleport); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index be987a2310..1b7cd801da 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3919,22 +3919,19 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - //If joint is a pelvis then handle by setting avPos+offset + //Set the joint position + pJoint->storeCurrentXform( jointPos ); + //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) { - //Apply av pos + offset + pJoint->storeCurrentXform( jointPos ); if ( !pAvatarVO->hasPelvisOffset() ) { pAvatarVO->setPelvisOffset( true, jointPos ); //Trigger to rebuild viewer AV pelvisGotSet = true; } - } - else - { - //Straight set for ALL joints except pelvis - pJoint->storeCurrentXform( jointPos ); - } + } } } } -- cgit v1.2.3 From f41f7cb607b57a2ba78412e75e754d96a60a06fc Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Wed, 16 Feb 2011 15:24:11 -0800 Subject: SH-512 [REGRESSION] Linden trees scale up to 200m on Mesh regions SH-943 10 meters maximum Prim/Mesh size in latest Mesh Viewers --- indra/newview/llmanipscale.cpp | 20 +++++++++++--------- indra/newview/llmanipscale.h | 2 +- indra/newview/llpanelobject.cpp | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index d16c4c3bd0..683f455179 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -85,9 +85,11 @@ const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] = }; -F32 get_default_max_prim_scale() +F32 get_default_max_prim_scale(bool is_flora) { - if (gSavedSettings.getBOOL("MeshEnabled")) + // a bit of a hack, but if it's foilage, we don't want to use the + // new larger scale which would result in giant trees and grass + if (gSavedSettings.getBOOL("MeshEnabled") && !is_flora) { return DEFAULT_MAX_PRIM_SCALE; } @@ -960,9 +962,9 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { mInSnapRegime = FALSE; } - - F32 max_scale_factor = DEFAULT_MAX_PRIM_SCALE_NO_MESH / MIN_PRIM_SCALE; - F32 min_scale_factor = MIN_PRIM_SCALE / DEFAULT_MAX_PRIM_SCALE_NO_MESH; + + F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE; + F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale(); // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale for (LLObjectSelection::iterator iter = mObjectSelection->begin(); @@ -974,7 +976,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { const LLVector3& scale = selectNode->mSavedScale; - F32 cur_max_scale_factor = llmin( DEFAULT_MAX_PRIM_SCALE_NO_MESH / scale.mV[VX], DEFAULT_MAX_PRIM_SCALE_NO_MESH / scale.mV[VY], DEFAULT_MAX_PRIM_SCALE_NO_MESH / scale.mV[VZ] ); + F32 cur_max_scale_factor = llmin( get_default_max_prim_scale(LLPickInfo::isFlora(cur)) / scale.mV[VX], get_default_max_prim_scale(LLPickInfo::isFlora(cur)) / scale.mV[VY], get_default_max_prim_scale(LLPickInfo::isFlora(cur)) / scale.mV[VZ] ); max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor ); F32 cur_min_scale_factor = llmax( MIN_PRIM_SCALE / scale.mV[VX], MIN_PRIM_SCALE / scale.mV[VY], MIN_PRIM_SCALE / scale.mV[VZ] ); @@ -1271,7 +1273,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto F32 denom = axis * dir_local; F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters - F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, DEFAULT_MAX_PRIM_SCALE_NO_MESH); + F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, get_default_max_prim_scale(LLPickInfo::isFlora(cur))); // propagate scale constraint back to position offset desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position @@ -1971,7 +1973,7 @@ F32 LLManipScale::partToMaxScale( S32 part, const LLBBox &bbox ) const max_extent = bbox_extents.mV[i]; } } - max_scale_factor = bbox_extents.magVec() * DEFAULT_MAX_PRIM_SCALE_NO_MESH / max_extent; + max_scale_factor = bbox_extents.magVec() * get_default_max_prim_scale() / max_extent; if (getUniform()) { @@ -1986,7 +1988,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const { LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox ); bbox_extents.abs(); - F32 min_extent = DEFAULT_MAX_PRIM_SCALE_NO_MESH; + F32 min_extent = get_default_max_prim_scale(); for (U32 i = VX; i <= VZ; i++) { if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent) diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h index 2762433abf..5cb8898fd0 100644 --- a/indra/newview/llmanipscale.h +++ b/indra/newview/llmanipscale.h @@ -40,7 +40,7 @@ #include "llbbox.h" -F32 get_default_max_prim_scale(); +F32 get_default_max_prim_scale(bool is_flora = false); class LLToolComposite; class LLColor4; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 8fa6beb474..42da966b92 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1934,7 +1934,8 @@ void LLPanelObject::refresh() getChildView("Physics Density")->setVisible(enable_mesh); getChildView("Physics Restitution")->setVisible(enable_mesh); - F32 max_scale = DEFAULT_MAX_PRIM_SCALE_NO_MESH; + F32 max_scale = get_default_max_prim_scale(LLPickInfo::isFlora(mObject)); + getChild("Scale X")->setMaxValue(max_scale); getChild("Scale Y")->setMaxValue(max_scale); getChild("Scale Z")->setMaxValue(max_scale); -- cgit v1.2.3 From 800e93110462e1d6b91c09f1efe3164733006fc6 Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 17 Feb 2011 13:01:29 -0500 Subject: Another part of the pelvis fix. Sh-634 --- indra/newview/llvoavatar.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 439584c7e8..b90c136b21 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1332,14 +1332,26 @@ const LLVector3 LLVOAvatar::getRenderPosition() const } else if (isRoot()) { + //Rebase the pelvis position if the avatar contains a pelvis offset if ( mHasPelvisOffset ) { LLVector3 returnVec( mDrawable->getPositionAgent() ); - //1. Move the pelvis down by the old amount - returnVec[VZ] -= (mLastPelvisToFoot); - //2. Now move the pelvis up by the new amount - returnVec[VZ] += mPelvisToFoot; - //3. Return the fixed up pelvis position + if ( mLastPelvisToFoot > mPelvisToFoot ) + { + F32 diff = mLastPelvisToFoot - mPelvisToFoot; + //1. Move the pelvis down by the difference of the old amount and the new pelvis to foot amount + returnVec[VZ] -= (diff); + //2. Now move the pelvis up by the new pelvis to foot amount + returnVec[VZ] += mPelvisToFoot; + } + else + { + //1. Move the pelvis down by the old pelvis to foot amount + returnVec[VZ] -= (mLastPelvisToFoot); + //2. Now move the pelvis up by the new pelvis to foot amount + returnVec[VZ] += mPelvisToFoot; + } + //Return the fixed up pelvis position return returnVec; } else -- cgit v1.2.3 From 019585ed6c761a32b5d06990d7cf55388905113a Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 17 Feb 2011 13:52:58 -0500 Subject: SH-959 FIX crash in llflexibleobject.cpp Crash was a result of one of two possibilities: 1) trying to update geometry when it wasn't visible 2) mSimulateRes was non-zero when mInitialized was 0 Put code to handle both cases - initialize if mSimulateRes is 0 OR mInitialized is 0 But only do so if the object is visible. If the object is not visible, early out. Code reviewed by davep --- indra/newview/llflexibleobject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 689fa72958..bd939d8636 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -366,7 +366,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() LLFastTimer ftm(FTM_DO_FLEXIBLE_UPDATE); LLVolume* volume = mVO->getVolume(); LLPath *path = &volume->getPath(); - if (mSimulateRes == 0 && mVO->mDrawable->isVisible()) + if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible()) { mVO->markForUpdate(TRUE); if (!doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0)) @@ -375,6 +375,11 @@ void LLVolumeImplFlexible::doFlexibleUpdate() } } + if (!mVO->mDrawable->isVisible()) + { + return; + } + llassert_always(mInitialized); S32 num_sections = 1 << mSimulateRes; -- cgit v1.2.3