summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcontrolavatar.cpp24
-rw-r--r--indra/newview/llspatialpartition.cpp4
2 files changed, 7 insertions, 21 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 18d6e6d6e7..64f8423a66 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -102,34 +102,20 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
// correction to the control avatar position if
// needed.
const LLVector3 *extents = getLastAnimExtents();
+ LLVector unshift_extents;
+ unshift_extents[0] = extents[0] - mPositionConstraintFixup;
+ unshift_extents[1] = extents[1] - mPositionConstraintFixup;
LLVector3 box_dims = extents[1]-extents[0];
F32 max_size = llmax(box_dims[0],box_dims[1],box_dims[2]);
- LLVector3 pos_box_offset = point_to_box_offset(vol_pos, extents);
+ LLVector3 pos_box_offset = point_to_box_offset(vol_pos, unshift_extents);
F32 offset_dist = pos_box_offset.length();
if (offset_dist > max_legal_offset)
{
F32 target_dist = (offset_dist - max_legal_offset);
- new_pos_fixup = mPositionConstraintFixup + (target_dist/offset_dist)*pos_box_offset;
+ new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;
LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
<< new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
}
- else if (offset_dist < max_legal_offset-1)
- {
- if (mPositionConstraintFixup.length()>0.01f)
- {
- new_pos_fixup = mPositionConstraintFixup * 0.9;
- }
- else
- {
- new_pos_fixup = LLVector3();
- }
- LL_DEBUGS("ConstraintFix") << getFullname() << " pos fixup reduced "
- << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
- }
- else
- {
- new_pos_fixup = mPositionConstraintFixup;
- }
if (max_size/mScaleConstraintFixup > max_legal_size)
{
new_scale_fixup = mScaleConstraintFixup*max_legal_size/max_size;
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index f25ab0709b..32aa974bf1 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2178,8 +2178,8 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
{
bool has_pos_constraint = (cav->mPositionConstraintFixup != LLVector3());
bool has_scale_constraint = (cav->mScaleConstraintFixup != 1.0f);
- F32 r = 1.0f * has_scale_constraint;
- F32 g = 1.0f * has_pos_constraint;
+ F32 r = 0.5 + 0.5 * has_scale_constraint;
+ F32 g = 0.5 + 0.5 * has_pos_constraint;
gGL.diffuseColor4f(r,g,0,1);
}
else