Download

Get angle between 2 FRotators

I have a VR camera parented to a “Play space” object which is the one I move around with the controller.

I am trying to make the VR camera face a object in the world when the player interacts with it. Of course I can’t simply rotate the camera as that is controlled by the HMD so I’ve been trying to work out how to get the angle between the camera and the interactive object so I know how much to rotate the “play space” or top node.

I already rotate this top node to allow the player to snap rotate for front facing set ups that can’t track as well turned away from the sensors, but I can’t work out how to calculate the amount I need to turn this top node so the camera is facing the object.

Can anyone point me in the right direction?

A dot product comparing location of camera vs object would help there.
Dot product value around close to “-1” would mean they are facing eachother, this page has some details on the bottom:

http://blog.wolfire.com/2009/07/line…lopers-part-2/

Thank you for the link, I think I can work it all out from this.