History

Improve hold action by using controller velocity

The AvatarHoldAction now derives the body velocity by using data from the controller::Pose. Rather then trying to derive it based on previous positions. This results in more acurate motion of the held object when the hold is released. OpenVR input plugin: pass the velocity and angularVelocity directly from the controller pose to the controller::Pose.

Anthony Thibault committed 10 years ago

Commit 3b87cd01 parent e6ccf508 files · +88 −28Browse files

Showing the changes to interface/src/Application.cpp (1 of 8 files). Show all

Unified · Split

interface/src/Application.cpp+9−0
@@ -5037,6 +5037,8 @@ void Application::setPalmData(Hand* hand, const controller::Pose& pose, float de · 5036 unmodified lines
50375037 glm::vec3 position = pose.getTranslation();
50385038 glm::quat rotation = pose.getRotation();
50395039
5040+ // AJT: REMOVE
5041+ /*
50405042 // Compute current velocity from position change
50415043 glm::vec3 rawVelocity;
50425044 if (deltaTime > 0.0f) {
@@ -5057,6 +5059,13 @@ void Application::setPalmData(Hand* hand, const controller::Pose& pose, float de · 14 unmodified lines
50575059 } else {
50585060 palm.setRawAngularVelocity(glm::vec3(0.0f));
50595061 }
5062+ */
5063+
5064+ glm::vec3 rawVelocity = pose.getVelocity();
5065+ glm::vec3 angularVelocity = pose.getAngularVelocity();
5066+
5067+ palm.setRawVelocity(rawVelocity);
5068+ palm.setRawAngularVelocity(angularVelocity);
50605069
50615070 if (controller::InputDevice::getLowVelocityFilter()) {
50625071 // Use a velocity sensitive filter to damp small motions and preserve large ones with

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t