Thanks!
The physics are all 2D, but the logic for figuring out dice orientation is actually 3D - the code has no idea which face is which, it calculates it on the fly by checking the 3D object's orientation and seeing which axis is pointing away from the screen. Similarly, for rotating the dice it does a 3D rotation toward the axis closest to the swiped direction.