Howdy, all!
I've got an audio engine I've built from scratch that I'm pairing with Irrlicht, but I need to get the forward vector of the camera in order to properly set the Listener Orientation. Does Irrlicht provide a convenience method for that?
Please let me know!
Getting the forward vector of a FPS camera?
-
- Posts: 105
- Joined: Mon Jun 02, 2014 2:32 am
- Location: Washington, D.C.
- Contact:
Getting the forward vector of a FPS camera?
My blog: http://fsgdp.wordpress.com "The Free Software Game Development Pipeline"
Re: Getting the forward vector of a FPS camera?
Forward is:
camera->getTarget() - camera->getAbsolutePosition ();
You might need to normalize depending on use. Also getPosition instead of getAbsolutePosition is good enough if you don't have parents for your camera.
If you also need up-vector, it's just camera->getUpVector()
camera->getTarget() - camera->getAbsolutePosition ();
You might need to normalize depending on use. Also getPosition instead of getAbsolutePosition is good enough if you don't have parents for your camera.
If you also need up-vector, it's just camera->getUpVector()
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm