Created
April 22, 2019 14:14
-
-
Save Adamcbrz/3b6545ec606585e02d1dda8159076513 to your computer and use it in GitHub Desktop.
Tracker Tutorial: Tick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ATracker::Tick(float DeltaTime) | |
{ | |
Super::Tick(DeltaTime); | |
// Find Tracker if trackerID is -1 else update tracker | |
if (trackerID == -1) | |
{ | |
// Loop through tracker ids skipping the first one because that is our null HMD. | |
for (uint32_t i = 1; i <= 8; i++) { | |
vr::HmdMatrix34_t posMat = UpdateTracker(i); | |
// Verify the postion of the tracker isn't vector zero. | |
if (posMat.m[0][3] != 0 && posMat.m[1][3] != 0 && posMat.m[2][3] != 0) | |
{ | |
trackerID = i; | |
break; | |
} | |
} | |
} | |
else | |
{ | |
UpdateTracker(trackerID); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment