Just a quick beginners question i could not find anything about on the Forums...
I am using FMOD for sound in my program, and for the listener position it uses 4 vectors: position, velocity, forward and up. Mapping position to a camerascenenode is not difficult, and i have not looked at velocity yet, but what about forward? There is a 'getUpVector' function, but nothing for the forward vector. Or is there?
What values correlate to this?
getForwardVector?
some progress, but not quite there
I found this code in the forums:
the vector should be the 'Forward' vector I am looking for. However it doesn't seem to be exactly right, because sound is now constantly swapping between left and right very fast.
any ideas?
Code: Select all
irr::core::vector3df vector = irr::core::vector3df(0,0,1);
irr::core::matrix4 m;
m.setRotationDegrees(camera->getRotation());
m.transformVect(vector);
any ideas?
You could try (no guarantee):
Code: Select all
irr::core::vector3f forward = camera->getTarget() - camera->getPosition();
// maybe also needed (not sure what fmod expects):
forward.normalize();
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