NOLOVR / NoloDeviceSDK

This SDK can read nolo device data via usb cable on Windows Platform.
7 stars 3 forks source link

FixedEyePosition is unaligned float data #5

Open m-7761 opened 5 years ago

m-7761 commented 5 years ago

I think FixedEyePosition is stored at 16bit address, because of pack to 1 char, and "UCHAR leftPackNumber" and "UCHAR rightPackNumber;" are 16-bit. #pragma pack(push,1) removes padding after the two CHAR data. #pragma pack(push,4) may be desirable to standardize for 32-bit and 64-bit.

What is FixedEyePosition?

#pragma pack(push,1) 
    struct NOLOData
    {
        Controller leftData;
        Controller rightData;
        HMD hmdData;
        BaseStation bsData;
        byte expandData[64];
        NoloSensorData NoloSensorData;

        //NEW
        UCHAR leftPackNumber;
        UCHAR rightPackNumber;
        NVector3 FixedEyePosition;
    };
    #pragma pack(pop)
sols000 commented 5 years ago

I will consider the memory alignment, Nolo Device HMD position is the hardware location of hmd, after we call SetHmdCenter(const NVector3 &hmdCenter); that will convert hmd pos to eye position, and set it in FixedEyePosition.

m-7761 commented 5 years ago

Thank you. So SetHmdCenter then is a vector from center of wearer's eyes to Nolo ball, correct? (I have wondered if it is to the center of the head or neck! or???)

sols000 commented 5 years ago

It is a vector from the center of wearer's eyes to Nolo ball.

m-7761 commented 5 years ago

Thank you. It seems like a "dumb" question now! I guess the name "SetHmdCenter" led my imagination to runaway from me.