Created
September 30, 2018 23:13
-
-
Save jdavidberger/4f2099202484b70a36c8e6ed045b6f7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static SurvivePose survivePoseFromDevicePose(const vr::TrackedDevicePose_t &dpose) { | |
auto &mat = dpose.mDeviceToAbsoluteTracking.m; | |
FLT matrix33[] = {mat[0][0], mat[0][1], mat[0][2], mat[1][0], mat[1][1], | |
mat[1][2], mat[2][0], mat[2][1], mat[2][2]}; | |
SurvivePose p = {}; | |
for (int i = 0; i < 3; i++) { | |
p.Pos[i] = mat[i][3]; | |
} | |
quatfrommatrix33(p.Rot, matrix33); | |
return p; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment