Jump to content

About GetValidity() in SRanipal Unreal SDK


Assc

Recommended Posts

I would like to make sure about GetValidity() in SRanipal Unreal SDK.
(I'm using Unreal Engine 4.22.3, SRanipal_Runtime 1.1.2.0, SRanipalSDK 1.1.0.1.)

I have checked the source code concerned to GetValidity() in SDK (see TEXT1 below) and seemed to discover that GetValidity() is incorrect in a part of the code.
If the validity as an argument with GetValidity() is SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY and its flug also be been on in an eye_data_validata_bit_mask, the function should return the TRUE, however, it returns FALSE.
Because, SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY defines 0 in the SingleEyeDataValidity(TEXT1) as enum.
Therefore, the source code should be corrected as GetValidity() in TEXT2, or SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY should be not 0, how is this?

-TEXT1(This is SRanipal_Eyes_Enums.h)-

enum SingleEyeDataValidity {
        SINGLE_EYE_DATA_GAZE_ORIGIN_VALIDITY,
        SINGLE_EYE_DATA_GAZE_DIRECTION_VALIDITY,
        SINGLE_EYE_DATA_PUPIL_DIAMETER_VALIDITY,
        SINGLE_EYE_DATA_EYE_OPENNESS_VALIDITY,
        SINGLE_EYE_DATA_PUPIL_POSITION_IN_SENSOR_AREA_VALIDITY
};

typedef struct SingleEyeData
{
        /** The bits containing all validity for this frame.*/
        uint64_t eye_data_validata_bit_mask;

        bool GetValidity(SingleEyeDataValidity validity) {
                 return (eye_data_validata_bit_mask & (uint64)validity) > 0;
        }
}SingleEyeData;


-TEXT2-

bool GetValidity(SingleEyeDataValidity validity) {
        return (eye_data_validata_bit_mask & ((uint64)1 << (uint64)validity)) > 0;
}


Thank you.

 

 

@Daniel_Y @zzy

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

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...