Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
first attempt at mixed tracker orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ella authored and Ella committed Mar 4, 2021
1 parent a4c1bfe commit 1b25283
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions SFMLProject/KinectSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,25 @@ namespace KinectSettings
left_tracker_rot = glm::quat(0, 0, 0, 0);
right_tracker_rot = glm::quat(0, 0, 0, 0);
}
else if (feet_rotation_option == k_HipTrackerOrientationMixed)
{
if (positional_tracking_option == k_KinectFullTracking)
{
// create quats from the orientation filter and hip direction
glm::quat l_quat = glm::vec3(left_foot_raw_pose.x, waist_raw_pose.y, left_foot_raw_pose.x);
glm::quat r_quat = glm::vec3(right_foot_raw_pose.x, waist_raw_pose.y, right_foot_raw_pose.x);
if (!flip)
{
left_tracker_rot = l_quat;
right_tracker_rot = r_quat;
}
else
{
right_tracker_rot = inverse(l_quat);
left_tracker_rot = inverse(r_quat);
}
}
}

/*******************************************************/
glm::quat r = glm::vec3(0.f, hmdYaw, 0.f);
Expand Down
2 changes: 2 additions & 0 deletions SFMLProject/inc/GUIHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,8 @@ class GUIHandler
coptbox->AppendItem("Disable Feet Rotation");
coptbox->AppendItem("Disable Feet Yaw (+Y)");
coptbox->AppendItem("Use Head Orientation");
coptbox->AppendItem("Use Tracker Orientation");
coptbox->AppendItem("Mixed Tracker Orientation");

// Only if we're using kinect v1
if(KinectSettings::kinectVersion == 1)
Expand Down
4 changes: 4 additions & 0 deletions SFMLProject/inc/KinectSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ enum footRotationFilterOption
///don't rotate foots in +y
k_EnableOrientationFilter_HeadOrientation,
///use headset orientation for foots
k_HipTrackerOrientation,
///use the kinect/vive/owotrack hip yaw instead of head
k_HipTrackerOrientationMixed,
///same as previous but keep orientation filter for pitch/roll
k_EnableOrientationFilter_Software,
///use headset orientation for foots
};
Expand Down

0 comments on commit 1b25283

Please sign in to comment.