I think it could be a bug in the setSceneNodeAsParentOfBone method:
- First call setSceneNodeAsParentOfBone with a nodeParent to be set to the bone
- Then call again, but use nullptr like nodeParent, so we can remove the attachment
The first if (line 340) will go in (because the bone exists in the mCustomParentSceneNodes), so we would call nodeParent->_detachBone although the nodeParent is nullptr =(. Also, when call the second time using a not null nodeParent, it crash when try to detach the bone.
I think the right code must be this:
Code: Select all
if( itor != end && itor->boneChild == bone )
{
itor->sceneNodeParent->_detachBone( this, itor->boneChild );
efficientVectorRemove( mCustomParentSceneNodes, itor );
}