Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
aee0766f
Commit
aee0766f
authored
12 years ago
by
Kelly Washington
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-2275 Child prims are "left behind" by animated, moving (physical) linksets
* A fix that doesn't break doors. Reverst MAINT-2247
parent
da9442b3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/lldrawable.cpp
+31
-31
31 additions, 31 deletions
indra/newview/lldrawable.cpp
with
31 additions
and
31 deletions
indra/newview/lldrawable.cpp
+
31
−
31
View file @
aee0766f
...
@@ -517,45 +517,45 @@ F32 LLDrawable::updateXform(BOOL undamped)
...
@@ -517,45 +517,45 @@ F32 LLDrawable::updateXform(BOOL undamped)
F32
dist_squared
=
0.
f
;
F32
dist_squared
=
0.
f
;
F32
camdist2
=
(
mDistanceWRTCamera
*
mDistanceWRTCamera
);
F32
camdist2
=
(
mDistanceWRTCamera
*
mDistanceWRTCamera
);
if
(
isVisible
())
if
(
damped
&&
isVisible
())
{
{
if
(
damped
)
F32
lerp_amt
=
llclamp
(
LLCriticalDamp
::
getInterpolant
(
OBJECT_DAMPING_TIME_CONSTANT
),
0.
f
,
1.
f
);
{
LLVector3
new_pos
=
lerp
(
old_pos
,
target_pos
,
lerp_amt
);
F32
lerp_amt
=
llclamp
(
LLCriticalDamp
::
getInterpolant
(
OBJECT_DAMPING_TIME_CONSTANT
),
0.
f
,
1.
f
);
dist_squared
=
dist_vec_squared
(
new_pos
,
target_pos
);
LLVector3
new_pos
=
lerp
(
old_pos
,
target_pos
,
lerp_amt
);
dist_squared
=
dist_vec_squared
(
new_pos
,
target_pos
);
LLQuaternion
new_rot
=
nlerp
(
lerp_amt
,
old_rot
,
target_rot
);
LLQuaternion
new_rot
=
nlerp
(
lerp_amt
,
old_rot
,
target_rot
);
dist_squared
+=
(
1.
f
-
dot
(
new_rot
,
target_rot
))
*
10.
f
;
// FIXME: This can be negative! It is be possible for some rots to 'cancel out' pos or size changes.
dist_squared
+=
(
1.
f
-
dot
(
new_rot
,
target_rot
))
*
10.
f
;
LLVector3
new_scale
=
lerp
(
old_scale
,
target_scale
,
lerp_amt
);
LLVector3
new_scale
=
lerp
(
old_scale
,
target_scale
,
lerp_amt
);
dist_squared
+=
dist_vec_squared
(
new_scale
,
target_scale
);
dist_squared
+=
dist_vec_squared
(
new_scale
,
target_scale
);
if
((
dist_squared
>=
MIN_INTERPOLATE_DISTANCE_SQUARED
*
camdist2
)
&&
if
((
dist_squared
>=
MIN_INTERPOLATE_DISTANCE_SQUARED
*
camdist2
)
&&
(
dist_squared
<=
MAX_INTERPOLATE_DISTANCE_SQUARED
))
(
dist_squared
<=
MAX_INTERPOLATE_DISTANCE_SQUARED
))
{
{
// interpolate
// interpolate
target_pos
=
new_pos
;
target_pos
=
new_pos
;
target_rot
=
new_rot
;
target_rot
=
new_rot
;
target_scale
=
new_scale
;
target_scale
=
new_scale
;
}
else
if
(
mVObjp
->
getAngularVelocity
().
isExactlyZero
())
{
// snap to final position (only if no target omega is applied)
dist_squared
=
0.0
f
;
if
(
getVOVolume
()
&&
!
isRoot
())
{
//child prim snapping to some position, needs a rebuild
gPipeline
.
markRebuild
(
this
,
LLDrawable
::
REBUILD_POSITION
,
TRUE
);
}
}
}
}
else
else
if
(
mVObjp
->
getAngularVelocity
().
isExactlyZero
())
{
{
dist_squared
=
dist_vec_squared
(
old_pos
,
target_pos
);
// snap to final position (only if no target omega is applied)
dist_squared
+=
(
1.
f
-
dot
(
old_rot
,
target_rot
))
*
10.
f
;
dist_squared
=
0.0
f
;
dist_squared
+=
dist_vec_squared
(
old_scale
,
target_scale
);
if
(
getVOVolume
()
&&
!
isRoot
())
{
//child prim snapping to some position, needs a rebuild
gPipeline
.
markRebuild
(
this
,
LLDrawable
::
REBUILD_POSITION
,
TRUE
);
}
}
}
}
}
else
{
dist_squared
=
dist_vec_squared
(
old_pos
,
target_pos
);
// The following "makes sense" and fixes MAINT-2247 but causes MAINT-2275
//dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f;
//dist_squared += dist_vec_squared(old_scale, target_scale);
}
LLVector3
vec
=
mCurrentScale
-
target_scale
;
LLVector3
vec
=
mCurrentScale
-
target_scale
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment