Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
auto vr = engine->get<polar::system::vr>().lock();
auto head_view = vr->head_view();
auto hand4 = glm::inverse(head_view) * vr->right_hand_view() * Point4(0, 0, 0, 1);
auto last_hand4 = glm::inverse(head_view) * vr->last_right_hand_view() * Point4(0, 0, 0, 1);
auto hand = Point3(hand4 / hand4.w);
auto last_hand = Point3(last_hand4 / last_hand4.w);
hand = glm::normalize(hand);
last_hand = glm::normalize(last_hand);
auto cross = glm::cross(last_hand, hand);
auto axis = Point3(head_view * Point4(glm::normalize(cross), 0));
auto q = glm::angleAxis(0.01f, axis);
orientVel = glm::normalize(q * orientVel);
//orientVel = glm::normalize(orientVel * q);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.