Trace problem with HMD

hello.

if i trace from camera location to forward the origin ins’t the HMD position, i can’t get its working.

the same problem in the VR template from the other member. the camara location ins’t the actual HMD position and that not work ok.

anyone have a solution?.

I need to get a world or component space location for the HMD too. The game must have it somewhere, since it’s rendering the view from that position. Right now the Blueprint nodes only give you either the camera location in world space, or the HMD position in camera-relative space.

Quite difficult to debug, too, since the Rift only works when you launch in a stand alone window, so no blueprint debug.

Edit: Device position is always 0, 0, 0 for me, even when positional tracking works fine. (on 4.3.1 with 0.4.1 SDK… trying it with the same project in 4.4.3 now).

there are a old bug in the hmd position, i submit weeks ago. they fixed in 4.4.3.

Anyway not work i try sum camera position location vector + hmd position but nothing change (i don’t if this its correct and should work, there are another bug or i doing it incorrectly)

Hey, I finally fixed that bug in the VR template just now actually, traces work like a charm. I’m uploading the changes to now but here is the quick rundown on how I fixed it.

let me know how it goes, thanks

that way works fine! thanks!

If anyone is interested, this is what the blueprint looks like in code:


FVector posTmp;
FQuat rot;
GEngine->HMDDevice->GetCurrentOrientationAndPosition(rot, posTmp);
FTransform trans = GEngine->GetFirstLocalPlayerController(GetWorld())->PlayerCameraManager->GetTransform();
const FQuat & rotInv = rot.Inverse();
posTmp = rotInv.RotateVector(posTmp);
FVector HMDPosInWorldSpace = trans.TransformPosition(posTmp);

Edit (03/18/15): Fixed bug: Was using rot to rotate posTmp, must be rotInv.