summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Buzzard <no-email>2011-02-17 12:14:32 -0800
committerTofu Buzzard <no-email>2011-02-17 12:14:32 -0800
commit3362fc17f93cbd7e6bfa23dc7af64ef749609ee2 (patch)
tree4fd4be7a8e52b0e746468fd8822db8dab9c4861d /indra
parent8921bdf0577c1282d5aa9cd920f0b57b77d95682 (diff)
parent0ba198b94b85979bc970f2fcabf9df652d94e669 (diff)
merge
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/GoogleMock.cmake5
-rw-r--r--indra/cmake/LLAddBuildTest.cmake5
-rw-r--r--indra/newview/llflexibleobject.cpp7
-rw-r--r--indra/newview/llmanipscale.cpp20
-rw-r--r--indra/newview/llmanipscale.h2
-rw-r--r--indra/newview/llpanelobject.cpp3
-rwxr-xr-xindra/newview/llviewermenu.cpp4
-rw-r--r--indra/newview/llvoavatar.cpp70
-rw-r--r--indra/newview/llvoavatar.h3
-rw-r--r--indra/newview/llvovolume.cpp13
-rw-r--r--indra/newview/skins/default/xui/en/floater_region_debug_console.xml3
11 files changed, 78 insertions, 57 deletions
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})
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;
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<LLSpinCtrl>("Scale X")->setMaxValue(max_scale);
getChild<LLSpinCtrl>("Scale Y")->setMaxValue(max_scale);
getChild<LLSpinCtrl>("Scale Z")->setMaxValue(max_scale);
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;
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index b1a5ea0fd6..b90c136b21 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,32 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
- return mDrawable->getPositionAgent();
+ //Rebase the pelvis position if the avatar contains a pelvis offset
+ if ( mHasPelvisOffset )
+ {
+ LLVector3 returnVec( mDrawable->getPositionAgent() );
+ 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
+ {
+ return mDrawable->getPositionAgent();
+ }
}
else
{
@@ -3454,20 +3480,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 +3498,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 +3788,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
return TRUE;
}
-
//-----------------------------------------------------------------------------
// updateHeadOffset()
//-----------------------------------------------------------------------------
@@ -3803,6 +3820,7 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount
mHasPelvisOffset = hasOffset;
if ( mHasPelvisOffset )
{
+ mLastPelvisToFoot = mPelvisToFoot;
mPelvisOffset = offsetAmount;
}
}
@@ -3810,9 +3828,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 +4562,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 );
- }
+ }
}
}
}
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 @@
<floater
name="region_debug_console"
title="Region Debug"
+ can_resize="true"
layout="topleft"
min_height="300"
min_width="300"
@@ -12,7 +13,7 @@
left="10"
type="string"
length="1"
- follows="left|top|right|bottom"
+ follows="left|right|bottom"
font="Monospace"
height="366"
width="576"