how to attach joint to node

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
cosmo
Posts: 17
Joined: Sat May 06, 2017 1:29 pm

how to attach joint to node

Post by cosmo »

Hi,
I need a brief explanation about how to attach joints and nodes, like ad example a weapon to hand bone.
I used this code:

Code: Select all

myChar->setJointMode(EJUOR_READ);
[...]
ISceneNode* hand = myChar->getJointNode("mixamorig:LeftHand");
if (hand)
{
    hand->addChild(weapon);
    hand->updateAbsolutePosition();
}
But, at runtime, the weapon node (previosly in the scene) seems neither to be attached to the hand bone nor to be rendered.

Which is the right way to perform this task?
Thanks.
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: how to attach joint to node

Post by CuteAlien »

getJointNode even seems to set EJUOR_READ already (on first call) and updateAbsolutePosition also only necessary if you want to check position immediately afterwards. Stupid question - but do you actually get the hand node? And are there any messages on console?
Maybe print out the weapons position to see where it ends up.

So in theory it should work already. If it fails I need the involved models for testing, otherwise no clue.
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
cosmo
Posts: 17
Joined: Sat May 06, 2017 1:29 pm

Re: how to attach joint to node

Post by cosmo »

Yeah, the weapon mesh is too small. :oops: As soon as I modified the scale, the issue is solved and the weapon appears in the right spot, just beneth the left hand joint.
My bad, sorry, thanks!
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: how to attach joint to node

Post by CuteAlien »

Haha, happens :-D
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