Children transformation delayed

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
Nova
Competition winner
Posts: 99
Joined: Mon May 09, 2005 10:32 am

Children transformation delayed

Post 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
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post 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
Image
Image
Nimrod
Posts: 8
Joined: Sun Feb 22, 2009 8:10 pm

Post 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?
Post Reply