mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Applied low velocity filter to palm tip position
This commit is contained in:
parent
baf825789e
commit
4d591de762
1 changed files with 4 additions and 2 deletions
|
@ -173,8 +173,10 @@ void SixenseManager::update(float deltaTime) {
|
|||
// Use a velocity sensitive filter to damp small motions and preserve large ones with
|
||||
// no latency.
|
||||
float velocityFilter = glm::clamp(1.0f - glm::length(rawVelocity), 0.0f, 1.0f);
|
||||
palm->setRawPosition(palm->getRawPosition() * velocityFilter + position * (1.0f - velocityFilter));
|
||||
palm->setRawRotation(safeMix(palm->getRawRotation(), rotation, 1.0f - velocityFilter));
|
||||
position = palm->getRawPosition() * velocityFilter + position * (1.0f - velocityFilter);
|
||||
rotation = safeMix(palm->getRawRotation(), rotation, 1.0f - velocityFilter);
|
||||
palm->setRawPosition(position);
|
||||
palm->setRawRotation(rotation);
|
||||
} else {
|
||||
palm->setRawPosition(position);
|
||||
palm->setRawRotation(rotation);
|
||||
|
|
Loading…
Reference in a new issue