How to attach nodes to bones ?

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
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

How to attach nodes to bones ?

Post by johann_gambolputty »

Hi i saw some post about this issue but i don't know it was solved or not... So if i attach a scene node to a joint node (myAnimatedMeshSceneNode->getJointNode("blah")) no matter what i do those attached nodes are always "late" one frame i've tried updating the absolute positions in any possible way but nothing helped...

Can someone help me with this ? or is there a patch ?
Thanks
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to attach nodes to bones ?

Post by CuteAlien »

Try to set setJointMode to EJUOR_READ. Looking at the code this might work -but no guarantees.
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
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Re: How to attach nodes to bones ?

Post by johann_gambolputty »

Hm... EJUOR_READ didn't helped , however as been mentioned in other threads if i uncomment the updateAbsolutePosition() in the CBoneSceneNode 's OnAnimate() method , then it works fine...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to attach nodes to bones ?

Post by CuteAlien »

Yeah, I was also confused why that is commented out. But then noticed that it should be updated in another place when EJUOR_READ is set, so I suppose that might have been the reason. But I'm not familliar enough with the animation system to know what's going on. Do you maybe have a test-case to debug this? I have never used this, so I have no examples or anything for that available.
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
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: How to attach nodes to bones ?

Post by thanhle »

There is a function called.

updateAbsolutePositionOfAllChildren()

Have you tried it yet.

If that doesn't work just call update positions before the begin scene. I think that would work.

Regards
thanh
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to attach nodes to bones ?

Post by CuteAlien »

@thanhle: That's what I also thought at first. But I think the problem is that animation happens inside rendering - so the children nodes have to be updated after the animation but before rendering. Which is not yet possible. So that's what I thought the EJUOR_READ is about, it seemed to do that from a quick look at the code. But I guess I'm missing something in what's happening, that's why I need an example to see the bug in action.
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
johann_gambolputty
Posts: 28
Joined: Mon Nov 02, 2009 9:51 am

Re: How to attach nodes to bones ?

Post by johann_gambolputty »

Hi i tried updateAbsolutePositionOfAllChildren() , unfortunately that didn't worked either. Well i tried updating the absoulute positions in all possible ways in all posible points of my app it just didn't woked. One approach would be is to update them before device->run() but thats impossible :D , From the other hand i'm not sure writing a separate update code for some nodes is a good idea , that breaks the good old scene graph rule. It just should work by setting it's parent anywhere anytime in the game regardless what type the ISceneNode is. (Bone ligtht mesh or custom)

CureAlien : i'm busy today but i will create a demo maybe tonight or tomorrow
Regards
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to attach nodes to bones ?

Post by CuteAlien »

johann_gambolputty wrote:CureAlien : i'm busy today but i will create a demo maybe tonight or tomorrow
Take your time, it'll be a while until I get to it as well.
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