Daydream Laser Pointer

Hello!

I would like to be able to get the location / orientation of the daydream controller or something similar so that I can perform line traces to work with the laser pointer. I haven’t however been able to get anything that seems to work - does somebody know how to access this using the Daydream plugin?

Thanks!

Here’s an article on that topic:
https://docs.unrealengine.com/latest/INT/Platforms/GoogleVR/Daydream/

Thanks, but that article does not answer my question at all. I already recompiled the plugin for 4.14, have the plugin setup and the controller working.I need to know the transform for the laser pointer as so I can actually do implementation in UE4…

You know once GoogleVRMotionController added in blueprint You could access it as variable, right?

Have you used Daydream? When I try to get the location / orientation of the component, I do not get a valid result back. I was hoping there was a blueprint node within the plugin that will specifically give me what I need. I’m sure one must exist.

Oh. Now I’m get it. Sorry.

4.13 version not working in 4.14, so You have to use Motion Controller component (default one). And Epic has fix for it but only for 4.15.

Hope You’re not using it with Vive. It has orientation issue.

I have it working in 4.14; I can see the controller and move it around just fine. I’m using a Daydream headset, I’m not sure why you’d think I was using the Vive?

Normal motion controller components do not work on Daydream, the documentation is entirely incorrect.

You need to use the special “GoogleVRMotionControllerComponent

Documentation on it here: https://developers.google.com/vr/unreal/arm-model

it handles the laser pointer out of the box for you then :wink:

It’s only available in 4.15 from Epic, or 4.13 & 4.13 from the googlevr branches: https://github.com/googlevr-unreal/UnrealEngine

EDIT: see dsternfeld’s answer above as it is spot on! I had previously only been using the default motion controller which reports the rotation fine and stumbled across the same problem when using the GoogleVRMotionControllerComponent

I am using that component. I want to know where the laser pointer is pointing; the documentation doesn’t talk about that and I can’t find a way to get what I need out of it. The only function documented is one that tells you if a given actor is under the pointer.

What is the purpose of your linetrace then if you don’t want to know which object is being hit?

If you just want to know the direction the pointer is pointing can’t you just get the rotation of the motion controller?

Like I’ve already said:
“When I try to get the location / orientation of the component, I do not get a valid result back”

I might for example want to do manual line intersection tests, for example making an object avoid the pointer.

I believe it’s because the entire motion controller setup is self-contained inside a single component (visible mesh, particle system, arm model approximation, the works) - the component itself is just attached to the player, the mesh belongs to the component and has a different transform.

It’s incredibly annoying, to be honest, it doesn’t use the normal motion controller class as a base at all and as such does not work the same way. I’m beginning to think that in order to be able to do much with it at all, you’re going to have to heavily modify the plugin yourself, which I really don’t want to do with something that is currently under active development.

Im curious is there any calibration involved with the controller? Just taking a stab in the dark as to why you might not be getting valid results back.

While using the GoogleVRMotionControllerComponent, you can call GetMotionController from either a blueprint or code to access the underlying MotionController component used internally. You can then access the location and orientation through that MotionController.

The laser points at an angle offset from the motion controller based on the ArmModelPointerTiltAngle which can be modified via the GoogleVRControllerFunctionLibrary. To get the laser you can call GetLaser via the GoogleVRMotionControllerComponent if you want to find the exact direction that the laser is facing.

However, in most cases you shouldn’t need to linetrace yourself. You can use GoogleVRPointerInputComponent which will do the line tracing for you. You can then use GoogleVRActorPointerResponder or GoogleVRComponentPointerResponder to respond to events from the GoogleVRPointerInputComponent. GoogleVRPointerInputComponent also works with widgets.

The underlying UMotionControllerComponent is accessible via the GoogleVRMotionControllerComponent by calling GetMotionController.

What are you experiencing when trying to use the normal motion controller? It should work with daydream (although it won’t have the laser or the 3d model of the controller).