Jump to content

Possible bug and fix in GetGazeRay()


Recommended Posts

I think I've found a bug in GetGazeRay(), specifically in the origin output. Look at the code below:

    if (gazeIndex == GazeIndex.COMBINE)
    {
        valid = eyesData[(int)GazeIndex.COMBINE].GetValidity(SingleEyeDataValidity.SINGLE_EYE_DATA_GAZE_DIRECTION_VALIDITY);
        if (valid)
        {
            origin = eyesData[(int)GazeIndex.COMBINE].gaze_origin_mm * 0.001f;
            direction = eyesData[(int)GazeIndex.COMBINE].gaze_direction_normalized;
            direction.x *= -1;
        }
    }
    else if (gazeIndex == GazeIndex.LEFT || gazeIndex == GazeIndex.RIGHT)
    {
        valid = eyesData[(int)gazeIndex].GetValidity(SingleEyeDataValidity.SINGLE_EYE_DATA_GAZE_DIRECTION_VALIDITY);
        if (valid)
        {
            origin = eyesData[(int)gazeIndex].gaze_origin_mm * 0.001f;
            direction = eyesData[(int)gazeIndex].gaze_direction_normalized;
            direction.x *= -1;
        }
    }
    
Notice that the direction vector's x component gets flipped as a coordinate system conversion, but the origin of the ray does not. This video shows that the ray's orientation gets applied to the opposite eye:

Video
For reference, Left is red, right is blue. You can see that the origin is coming from the closed eye, but the direction is coming from the open one

Applying the flip to the origin as well as the direction results in the following:

Video

@Daniel_Y @Andy.YC_Wang @Corvus @Jad

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...