Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #412 from zelmon64/tracker_status
Browse files Browse the repository at this point in the history
Fix for #411 and others
  • Loading branch information
cboulay authored Apr 10, 2017
2 parents 3ae777b + 5c5672a commit 807fb4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/psmoveclient/PSMoveClient_CAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,9 @@ PSMResult PSM_GetIsControllerStable(PSMControllerID controller_id, bool *out_is_

*out_is_stable =
is_nearly_equal(1.f, acceleration_magnitude, 0.1f) &&
PSM_Vector3fDot(&k_identity_gravity_calibration_direction, &acceleration_direction) >= k_cosine_10_degrees;
(PSM_Vector3fDot(&k_identity_gravity_calibration_direction, &acceleration_direction)
/ (PSM_Vector3fLength(&k_identity_gravity_calibration_direction)
* PSM_Vector3fLength(&acceleration_direction))) >= k_cosine_10_degrees;

result= PSMResult_Success;
} break;
Expand Down
18 changes: 13 additions & 5 deletions src/psmoveconfigtool/AppStage_ComputeTrackerPoses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,9 @@ void AppStage_ComputeTrackerPoses::renderUI()
go_previous_tracker();
}
ImGui::SameLine();
ImGui::Text("Tracker ID: #%d", m_renderTrackerIter->second.trackerView->tracker_info.tracker_id);
int TrackerID = m_renderTrackerIter->second.trackerView->tracker_info.tracker_id;
ImGui::Text("Tracker ID: #%d", TrackerID);
m_app->getAppStage<AppStage_TrackerSettings>()->set_selectedTrackerIndex(TrackerID);
ImGui::SameLine();
if (ImGui::Button(">##Next Tracker"))
{
Expand Down Expand Up @@ -1236,15 +1238,21 @@ bool AppStage_ComputeTrackerPoses::does_tracker_see_any_controller(const PSMTrac
if (controllerView->ControllerType == PSMControllerType::PSMController_Move &&
controllerView->ControllerState.PSMoveState.bIsCurrentlyTracking)
{
screenSample= controllerView->ControllerState.PSMoveState.RawTrackerData.ScreenLocations[tracker_id];
bTrackerSeesAnyController = true;
for (int id = 0; id < controllerView->ControllerState.PSMoveState.RawTrackerData.ValidTrackerLocations; ++id)
{
if (controllerView->ControllerState.PSMoveState.RawTrackerData.TrackerIDs[id] == tracker_id)
bTrackerSeesAnyController = true;
}
break;
}
else if (controllerView->ControllerType == PSMControllerType::PSMController_DualShock4 &&
controllerView->ControllerState.PSDS4State.bIsCurrentlyTracking)
{
screenSample= controllerView->ControllerState.PSDS4State.RawTrackerData.ScreenLocations[tracker_id];
bTrackerSeesAnyController = true;
for (int id = 0; id < controllerView->ControllerState.PSMoveState.RawTrackerData.ValidTrackerLocations; ++id)
{
if (controllerView->ControllerState.PSMoveState.RawTrackerData.TrackerIDs[id] == tracker_id)
bTrackerSeesAnyController = true;
}
break;
}
}
Expand Down

0 comments on commit 807fb4c

Please sign in to comment.