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, 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…
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.
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.
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.
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.
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).