Skip to content
Snippets Groups Projects
Commit 40c934b7 authored by Malte Christian Kögel's avatar Malte Christian Kögel
Browse files

WIP, NOT TESTED. removed delegate, now it compiles. It will probably not work...

WIP, NOT TESTED. removed delegate, now it compiles. It will probably not work as is, I'm pretty sure passing the bools with MoveTemp is wrong. Also there is some more cleaning up to do once tested.
parent f43363e8
No related branches found
No related tags found
No related merge requests found
...@@ -27,13 +27,15 @@ bool USFGazeTracker::Tick(float DeltaTime) ...@@ -27,13 +27,15 @@ bool USFGazeTracker::Tick(float DeltaTime)
#ifdef WITH_SRANIPAL #ifdef WITH_SRANIPAL
bIsAsyncEyeTrackingTaskRunning = true; bIsAsyncEyeTrackingTaskRunning = true;
ViveSR::anipal::Eye::EyeData_v2 TempEyeData; ViveSR::anipal::Eye::EyeData_v2 TempEyeData;
AsyncTask(ENamedThreads::AnyThread, [TempEyeDataAddr = MoveTemp(&TempEyeData), OnEyeTrackingDataReceived]() AsyncTask(ENamedThreads::AnyThread, [TempEyeDataAddr = &TempEyeData, SranipalEyeData = MoveTemp(SranipalEyeData), bIsAsyncEyeTrackingTaskRunning = MoveTemp(bIsAsyncEyeTrackingTaskRunning), bDataLogged = MoveTemp(bDataLogged)]()
{ {
ViveSR::anipal::Eye::GetEyeData_v2(TempEyeDataAddr); ViveSR::anipal::Eye::GetEyeData_v2(TempEyeDataAddr);
AsyncTask(ENamedThreads::GameThread, [TempEyeDataAddr = MoveTemp(TempEyeDataAddr), OnEyeTrackingDataReceived]() mutable AsyncTask(ENamedThreads::GameThread, [TempEyeDataAddr =TempEyeDataAddr, SranipalEyeData, bIsAsyncEyeTrackingTaskRunning, bDataLogged]() mutable
{ {
OnEyeTrackingDataReceived.ExecuteIfBound(*TempEyeDataAddr); SranipalEyeData = *TempEyeDataAddr;
bDataLogged = false;
bIsAsyncEyeTrackingTaskRunning = false;
}); });
}); });
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#ifdef WITH_SRANIPAL #ifdef WITH_SRANIPAL
//Use this to broadcast the data from async thread to game thread for logging //Use this to broadcast the data from async thread to game thread for logging
DECLARE_DYNAMIC_DELEGATE_OneParam(FOnEyeTrackingDataReceived, const ViveSR::anipal::Eye::EyeData_v2, EyeData); //DECLARE_DYNAMIC_DELEGATE_OneParam(FOnEyeTrackingDataReceived, const ViveSR::anipal::Eye::EyeData_v2, EyeData);
#endif #endif
UENUM() UENUM()
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
#ifdef WITH_SRANIPAL #ifdef WITH_SRANIPAL
FOnEyeTrackingDataReceived& OnEyeTrackingDataReceived; //FOnEyeTrackingDataReceived& OnEyeTrackingDataReceived;
void OnEyeTrackingDataReceived(ViveSR::anipal::Eye::EyeData_v2 EyeData); void OnEyeTrackingDataReceived(ViveSR::anipal::Eye::EyeData_v2 EyeData);
#endif #endif
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment