mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-19 11:00:35 +02:00
fix spaces and touch duration
This commit is contained in:
parent
e7743cd8e2
commit
cea0d74c35
2 changed files with 4 additions and 4 deletions
|
@ -221,12 +221,12 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, const control
|
||||||
{
|
{
|
||||||
Locker locker(_lock);
|
Locker locker(_lock);
|
||||||
if (_leftHapticDuration > 0.0f) {
|
if (_leftHapticDuration > 0.0f) {
|
||||||
_leftHapticDuration -= deltaTime;
|
_leftHapticDuration -= deltaTime * 1000.0f; // milliseconds
|
||||||
} else {
|
} else {
|
||||||
stopHapticPulse(true);
|
stopHapticPulse(true);
|
||||||
}
|
}
|
||||||
if (_rightHapticDuration > 0.0f) {
|
if (_rightHapticDuration > 0.0f) {
|
||||||
_rightHapticDuration -= deltaTime;
|
_rightHapticDuration -= deltaTime * 1000.0f; // milliseconds
|
||||||
} else {
|
} else {
|
||||||
stopHapticPulse(false);
|
stopHapticPulse(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,8 +477,8 @@ void ViveControllerManager::InputDevice::hapticsHelper(float deltaTime, bool lef
|
||||||
|
|
||||||
// Vive Controllers only support duration up to 4 ms, which is short enough that any variation feels more like strength
|
// Vive Controllers only support duration up to 4 ms, which is short enough that any variation feels more like strength
|
||||||
const float MAX_HAPTIC_TIME = 3999.0f; // in microseconds
|
const float MAX_HAPTIC_TIME = 3999.0f; // in microseconds
|
||||||
float hapticTime = strength*MAX_HAPTIC_TIME;
|
float hapticTime = strength * MAX_HAPTIC_TIME;
|
||||||
if (hapticTime < duration*1000.0f) {
|
if (hapticTime < duration * 1000.0f) {
|
||||||
_system->TriggerHapticPulse(deviceIndex, 0, hapticTime);
|
_system->TriggerHapticPulse(deviceIndex, 0, hapticTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue