Hello everyone!
I'm new to using IrrLicht, glad to be here! Straight to the problem:
It seems that ICameraSceneNode::getUpVector() always returns the same vector even when I change its target!
Here is what I'm doing:
ICameraSceneNode* camNode = sceneManager->addCameraSceneNode();
auto camUp = camera->getUpVector(); // is initially {0,1,0}
auto camTarget = camera->getTarget();
camNode->setTarget({camTarget.X,camTarget.Y + 10,camTarget.Z})
camUp = camNode->getUpVector(); // is STILL {0,1,0}
It seems changing the camera target does not change the up vector? Is this a bug? If not, How am I supposed to get the ACTUAL camera up vector?
Thanks so much!
ICameraSceneNode::getUpVector() buggy?
Re: ICameraSceneNode::getUpVector() buggy?
The up-vector is set - it's not automatic. Interestingly similar thread was just brought up a few days ago, so explanation why that wouldn't work in there: http://irrlicht.sourceforge.net/forum/v ... =2&t=52241
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
Re: ICameraSceneNode::getUpVector() buggy?
The up vector is currently only a hint. it doesn't get updated because it is necesary that it remains as such, but you can change it so the proper up vector is calculated according to it. You can calculate the up vector doing the cross product of the view vector AND that hint to get a left vector (the vector thet points to the left as seen from the camera), and then crossing that left vector with the view vector again to get the proper up vector. Take a look at the CBillboardSceneNode source to get actual code (AFAIK) that calculates the up vector correctly
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt