-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depth adjustment key combo; WIP Convergence
- Loading branch information
Showing
4 changed files
with
110 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <openvr.h> | ||
#include "driverlog.h" | ||
|
||
void SetStandingPose(float userHeight) { | ||
vr::IVRChaperoneSetup* chaperoneSetup = vr::VRChaperoneSetup(); | ||
|
||
if (!chaperoneSetup) { | ||
DriverLog("Unable to get ChaperoneSetup interface."); | ||
return; | ||
} | ||
|
||
// Define the standing center matrix (4x4 identity matrix with translation for user height) | ||
vr::HmdMatrix34_t standingCenter = { | ||
1.0f, 0.0f, 0.0f, 0.0f, | ||
0.0f, 1.0f, 0.0f, userHeight, | ||
0.0f, 0.0f, 1.0f, 0.0f | ||
}; | ||
|
||
// Set the working standing zero pose to the new height | ||
chaperoneSetup->SetWorkingStandingZeroPoseToRawTrackingPose(&standingCenter); | ||
|
||
// Commit the changes | ||
bool success = chaperoneSetup->CommitWorkingCopy(vr::EChaperoneConfigFile_Live); | ||
if (!success) { | ||
DriverLog("Failed to commit Chaperone setup."); | ||
} | ||
else { | ||
DriverLog("Standing pose set to user height: ", userHeight, " meters."); | ||
} | ||
} |
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
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
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