d/ht_ctrl_emu: Fix pinch detection

This commit is contained in:
Moshi Turner 2023-03-01 22:45:31 -06:00
parent 4b6491aa16
commit c750d714a9

View file

@ -369,10 +369,10 @@ decide(xrt_vec3 one, xrt_vec3 two, bool *out)
float dist = m_vec3_len_sqrd(one - two);
// These used to be 0.02f and 0.04f, but I bumped them way up to compensate for bad tracking. Once our tracking
// is better, bump these back down.
float activation_dist = 0.04f;
float deactivation_dist = 0.1f;
float activation_dist = 0.02f;
float deactivation_dist = 0.04f;
const float pinch_activation_dist =
(*out ? activation_dist * activation_dist : deactivation_dist * deactivation_dist);
(*out ? deactivation_dist * deactivation_dist : activation_dist * activation_dist);
*out = (dist < pinch_activation_dist);
}