Hello. I'm trying to attach a node to another node in my code, both nodes of type IAnimatedMeshSceneNode and using skeletal animated models in the x format (exported with Blender and its native x exporter). I do so with the following code and in the following order:
Code: Select all
child->setParent(parent);
child->setPosition(offset_position);
child->setRotation(offset_rotation);
child->updateAbsolutePosition();
If parent is the mesh node of our parent object, everything works fine. But my code is also meant to support attachment to joints of the animation skeleton. In that case, parent is set in the following way (then the code above happens):
Code: Select all
parent = parent_node->getJointNode(bone_name);
What happens is: The child appears to be attached at the origin and rotation of the bone (not sure yet). But as the parent mesh is animated (by playing an animation via setFrameLoop(start, end)) the attachment does not stick to the bone and keep following it. It does however stick to the parent and move / rotate with its mesh node.
What could be causing this? Could it be something I'm forgetting in the Irrlicht configuration, or something else I might have messed up in my code?