Skip to content
Snippets Groups Projects
Commit 334dfe05 authored by ruslantproductengine's avatar ruslantproductengine
Browse files

MAINT-6275 - Child prim not touchable after being resized and moved relative...

MAINT-6275 - Child prim not touchable after being resized and moved relative to root prim by script.

FIXED.
It's a very important on each cycle on Drawable::update form(), when object
remained in move, list update the CurrentScale member, because if do not do that,
it remained in this list forever or when the delta time between two frames
a become a sufficiently large (due to interpolation)
for overcome the MIN_INTERPOLATE_DISTANCE_SQUARED.
parent cbffc819
No related branches found
No related tags found
No related merge requests found
...@@ -618,7 +618,7 @@ F32 LLDrawable::updateXform(BOOL undamped) ...@@ -618,7 +618,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
BOOL damped = !undamped; BOOL damped = !undamped;
// Position // Position
LLVector3 old_pos(mXform.getPosition()); const LLVector3 old_pos(mXform.getPosition());
LLVector3 target_pos; LLVector3 target_pos;
if (mXform.isRoot()) if (mXform.isRoot())
{ {
...@@ -632,7 +632,7 @@ F32 LLDrawable::updateXform(BOOL undamped) ...@@ -632,7 +632,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
} }
// Rotation // Rotation
LLQuaternion old_rot(mXform.getRotation()); const LLQuaternion old_rot(mXform.getRotation());
LLQuaternion target_rot = mVObjp->getRotation(); LLQuaternion target_rot = mVObjp->getRotation();
//scaling //scaling
LLVector3 target_scale = mVObjp->getScale(); LLVector3 target_scale = mVObjp->getScale();
...@@ -667,6 +667,8 @@ F32 LLDrawable::updateXform(BOOL undamped) ...@@ -667,6 +667,8 @@ F32 LLDrawable::updateXform(BOOL undamped)
{ {
// snap to final position (only if no target omega is applied) // snap to final position (only if no target omega is applied)
dist_squared = 0.0f; dist_squared = 0.0f;
mCurrentScale = target_scale;
if (getVOVolume() && !isRoot()) if (getVOVolume() && !isRoot())
{ //child prim snapping to some position, needs a rebuild { //child prim snapping to some position, needs a rebuild
gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
...@@ -683,11 +685,11 @@ F32 LLDrawable::updateXform(BOOL undamped) ...@@ -683,11 +685,11 @@ F32 LLDrawable::updateXform(BOOL undamped)
//dist_squared += dist_vec_squared(old_scale, target_scale); //dist_squared += dist_vec_squared(old_scale, target_scale);
} }
LLVector3 vec = mCurrentScale-target_scale; const LLVector3 vec = mCurrentScale-target_scale;
mCurrentScale = target_scale;
if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED) if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED)
{ //scale change requires immediate rebuild { //scale change requires immediate rebuild
mCurrentScale = target_scale;
gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
} }
else if (!isRoot() && else if (!isRoot() &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment