GetAbsolutePosition doesn't work for mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
dart_theg
Posts: 53
Joined: Sun Dec 29, 2024 3:13 am

GetAbsolutePosition doesn't work for mesh

Post by dart_theg »

I parented my mesh object to an empty object and called getAbsolutePosition (and forced an update prior) and it still says that its position is at 0,0,0 (should not be because the empty is offset). Is this a known issue and how should I get around this? Do I need to update the positions of the parent empty too?
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: GetAbsolutePosition doesn't work for mesh

Post by CuteAlien »

It's an old Irrlicht optimization. Absolute positions are usually only updated during rendering (or in OnAnimate to be exact which is called in SceneManager::drawAll). If you need the absolute position before that you have to manually call updateAbsolutePosition() on your node first.
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
Post Reply