chgatla-microsoft / QRTracking

MRTK sample app for QRtracking
MIT License
74 stars 69 forks source link

QR Code Visualizer not handling update correct #9

Closed AMollis closed 3 years ago

AMollis commented 4 years ago

During a qr code update the visualizer code is assigning the qr code's instance id to the SpatialGraphCoordinateSystem's id. It should be assigning the qr code's SpatialGraphNodeId to SpatialGraphCoordinateSystem's id.

The bug is in this block of code....

else if (action.type == ActionData.Type.Updated)
{
    if (!qrCodesObjectsList.ContainsKey(action.qrCode.Id))
    {
        GameObject qrCodeObject = Instantiate(qrCodePrefab, new Vector3(0, 0, 0), Quaternion.identity);
        qrCodeObject.GetComponent<SpatialGraphCoordinateSystem>().Id = action.qrCode.Id;
        qrCodeObject.GetComponent<QRCode>().qrCode = action.qrCode;
        qrCodesObjectsList.Add(action.qrCode.Id, qrCodeObject);
    }
}
AMollis commented 4 years ago

Tagging @chgatla-microsoft

andreasanta commented 3 years ago

@AMollis It seems to be fixed in the latest version, can you please double check and close? Thanks!

-- EDIT-> My bad still not fixed, I see QR Codes floating all around, but in wrong places :(

andreasanta commented 3 years ago

Submitted PR, hopefully will be merged soon!

chgatla-microsoft commented 3 years ago

This is already fixed.