Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Zero-ing out controller acceleration to prevent jitter
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterSloth committed Oct 25, 2018
1 parent fae4b87 commit 77c9a54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/openvr_plugin/driver_psmoveservice.cpp
Expand Up @@ -3410,9 +3410,13 @@ void CPSMoveControllerLatest::UpdateTrackingState()
* abs(pow(abs(physicsData.LinearVelocityCmPerSec.z), m_fLinearVelocityExponent))
* k_fScalePSMoveAPIToMeters * m_fLinearVelocityMultiplier;

m_Pose.vecAcceleration[0] = physicsData.LinearAccelerationCmPerSecSqr.x * k_fScalePSMoveAPIToMeters;
m_Pose.vecAcceleration[1] = physicsData.LinearAccelerationCmPerSecSqr.y * k_fScalePSMoveAPIToMeters;
m_Pose.vecAcceleration[2] = physicsData.LinearAccelerationCmPerSecSqr.z * k_fScalePSMoveAPIToMeters;
// Disable for now to prevent jitter
//m_Pose.vecAcceleration[0] = physicsData.LinearAccelerationCmPerSecSqr.x * k_fScalePSMoveAPIToMeters;
//m_Pose.vecAcceleration[1] = physicsData.LinearAccelerationCmPerSecSqr.y * k_fScalePSMoveAPIToMeters;
//m_Pose.vecAcceleration[2] = physicsData.LinearAccelerationCmPerSecSqr.z * k_fScalePSMoveAPIToMeters;
m_Pose.vecAcceleration[0] = 0.f;
m_Pose.vecAcceleration[1] = 0.f;
m_Pose.vecAcceleration[2] = 0.f;

m_Pose.vecAngularVelocity[0] = physicsData.AngularVelocityRadPerSec.x;
m_Pose.vecAngularVelocity[1] = physicsData.AngularVelocityRadPerSec.y;
Expand Down

0 comments on commit 77c9a54

Please sign in to comment.