[sldev] VWR-1203 (cross eyes) not fixed
Richard Nelson
richard at lindenlab.com
Wed Jun 27 17:17:03 PDT 2007
So I found a fix that will be in some upcoming release (not sure that it will make 1.18). For those who care, the bug was the result of applying angular constraints to the eyes separately, instead of to the initial target orientation...
Index: D:/code/maintenance/indra/llcharacter/llheadrotmotion.cpp
===================================================================
--- D:/code/maintenance/indra/llcharacter/llheadrotmotion.cpp (revision 61992)
+++ D:/code/maintenance/indra/llcharacter/llheadrotmotion.cpp (revision 64407)
@@ -418,6 +418,8 @@
up.setVec(eye_look_at % left);
target_eye_rot = LLQuaternion(eye_look_at, left, up);
+ // constrain target orientation to be in front of avatar's face
+ target_eye_rot.constrain(EYE_ROT_LIMIT_ANGLE);
// calculate vergence
F32 interocular_dist = (mLeftEyeState.getJoint()->getWorldPosition() - mRightEyeState.getJoint()->getWorldPosition()).magVec();
@@ -472,13 +474,11 @@
// start with left
LLQuaternion tQw = mLeftEyeState.getJoint()->getParent()->getWorldRotation();
LLQuaternion tQh = left_eye_rot * ~tQw;
- tQh.constrain(EYE_ROT_LIMIT_ANGLE);
mLeftEyeState.setRotation( tQh );
// now do right eye
tQw = mRightEyeState.getJoint()->getParent()->getWorldRotation();
tQh = right_eye_rot * ~tQw;
- tQh.constrain(EYE_ROT_LIMIT_ANGLE);
mRightEyeState.setRotation( tQh );
return TRUE;
Richard
On Wed, 27 Jun 2007 16:50:00 -0700, Jason Giglio <gigstaggart at gmail.com> wrote:
> Richard Nelson wrote:
>> The zero rotation vergence was a bug. Not sure when it was introduced, but probably a long time ago, early in Second Life's existence.
>
> Yeah, I assumed so. I'm not good enough with rotations to actually fix
> the vergence code, and I figured that if it's been "broken" this long,
> people have come to expect the old behavior, and the safest thing to do
> for a minor point release hotfix is to just revert back to the old way
> (hence my patch).
>
> Since 1.18 is on the plate now, it may be a better time to actually make
> it work the way the original coder intended.
>
> If someone good with rotations can spare the time to explain, how can
> you have a version of SetQuat that takes a floating point angle and a
> Vector3 and come out with a single unambiguous answer?
>
> It seems to me that would only define a conic section, or if it were
> axis aligned, two possible orientations.
>
>
> -Jason
>
More information about the SLDev
mailing list