Page 1 of 1

Children transformation delayed

Posted: Tue Jan 06, 2009 12:17 pm
by Nova
Hi everyone,

this has possibly been discussed before, but I wasn't able to find any useful information. So here it goes:

I want to attach a sword to the hand bone of my character.

Code: Select all

Sword = Core->Smgr->addAnimatedMeshSceneNode( mesh, Node->getJointNode( "Bip01 R Hand" ) );
This works as expected, the problem is that the swords position is not updated in time. It is delayed. I drew the debugData of the skeleton but the debug Lines are updated correctly. Only my sword is late...

Hopefully someone understands my explanation. Thank you in advance for any help

Posted: Tue Jan 06, 2009 7:51 pm
by B@z
i had the same problem before, and rogerborg helped to me with this code:

Code: Select all

void UpdateAbsoluteTransformationAndChildren(ISceneNode *Node)
{
   Node->updateAbsolutePosition();
   core::list<ISceneNode*>::ConstIterator it = Node->getChildren().begin();
   for (; it != Node->getChildren().end(); ++it)
   {
      UpdateAbsoluteTransformationAndChildren((*it));
   }
}
call it to your node before drawAll

Posted: Tue Feb 24, 2009 10:47 pm
by Nimrod
I ran into the same problem and tried to fix it with the UpdateAbsoluteTransformationAndChildren codes.
However, it still doesn't work if I have animators attach to the character node.

After looking through the source code (v 1.5), I found that the problem is there because somehow in CBoneSceneNode.cpp line 77, the line with "updateAbsolutePosition();" is being commented out.

Seems like the problem is solved by uncommenting that line and recompile the irrlicht engine.

Is there any particular reason that the line is being commented out?