Hi Guys,
so I am basically trying to make a plugin for Unreal Engine for the pupil labs HTC Vive device in VR. This device does eyetracking and has as inputs the following
Inputs:
2 floats representing the current position of the eye in the square (x,y)
(0, 0) representing the down left corner
(1, 1) representing the up right corner
I basically get data such as (0.5 , 0.5) which represent the center or (0.33, 0.65) some position in the field of view.
Output
The projection of the input in the world.
What I tryed to do
UPupilPlayerController->GetPlayerViewPoint(CameraLocation, CameraRotator);
const FVector StartTrace = CameraLocation;
const FVector ForwardVector = CameraRotator.Vector();
FVector *PlanePoint = new FVector(x, y, 1);
FVector *EndPlanePointTrace = new FVector(); ///REAL ■■■■■■■■■■■■
*EndPlanePointTrace = ((ForwardVector *220.f) + *PlanePoint);
(GetWorld()->LineTraceSingleByChannel(*HitResult, StartTrace, *EndPlanePointTrace, ECC_Visibility, *TraceParams)
Also there is the implementation for this already in Unity which looks something like this line 64
I am basically trying to mimic sceneCamera.ViewportPointToRay (viewportPoint);
The current status of my project is free on git.