Skip to content

Commit

Permalink
Rewrite Pose updating logic; Make Config access thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
oneup03 committed Sep 22, 2024
1 parent 9cd350f commit f9cc0c2
Show file tree
Hide file tree
Showing 4 changed files with 326 additions and 243 deletions.
8 changes: 8 additions & 0 deletions utils/vrmath/vrmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ static vr::HmdQuaternion_t HmdQuaternion_FromSwingTwist( const vr::HmdVector2_t
return result;
}

static float AngleDifference(float currentAngle, float lastAngle)
{
float diff = currentAngle - lastAngle;
while (diff > M_PI) diff -= 2 * M_PI;
while (diff < -M_PI) diff += 2 * M_PI;
return diff;
}

static vr::HmdQuaternion_t HmdQuaternion_Normalize( const vr::HmdQuaternion_t &q )
{
vr::HmdQuaternion_t result{};
Expand Down
3 changes: 0 additions & 3 deletions vrto3d/src/device_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ bool MyDeviceProvider::ShouldBlockStandbyMode()
//-----------------------------------------------------------------------------
void MyDeviceProvider::RunFrame()
{
// Run user control tasks
my_hmd_device_->PoseUpdate();

vr::VREvent_t vrEvent;
while (vr::VRServerDriverHost()->PollNextEvent(&vrEvent, sizeof(vrEvent)))
{
Expand Down
Loading

0 comments on commit f9cc0c2

Please sign in to comment.