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
5037 glm::vec3 position = pose.getTranslation();5037 glm::vec3 position = pose.getTranslation();
5038 glm::quat rotation = pose.getRotation();5038 glm::quat rotation = pose.getRotation();
5039 5039
5040 // AJT: REMOVE
5041 /*
5040 // Compute current velocity from position change5042 // Compute current velocity from position change
5041 glm::vec3 rawVelocity;5043 glm::vec3 rawVelocity;
5042 if (deltaTime > 0.0f) {5044 if (deltaTime > 0.0f) {
@@ -5057,6 +5059,13 @@ void Application::setPalmData(Hand* hand, const controller::Pose& pose, float de · 14 unmodified lines
5057 } else {5059 } else {
5058 palm.setRawAngularVelocity(glm::vec3(0.0f));5060 palm.setRawAngularVelocity(glm::vec3(0.0f));
5059 }5061 }
5062 */
5063
5064 glm::vec3 rawVelocity = pose.getVelocity();
5065 glm::vec3 angularVelocity = pose.getAngularVelocity();
5066
5067 palm.setRawVelocity(rawVelocity);
5068 palm.setRawAngularVelocity(angularVelocity);
5060 5069
5061 if (controller::InputDevice::getLowVelocityFilter()) {5070 if (controller::InputDevice::getLowVelocityFilter()) {
5062 // Use a velocity sensitive filter to damp small motions and preserve large ones with5071 // 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