I wanted to add some weights to a existing joint of a iskinnedmesh.
Adding the vertices and triangles worked fine but when I tried
to add weights with the following function it either had no effect
at all or I received an error (depends on the amount of added weights).
Code: Select all
void AddWeight(IAnimatedMesh* mesh, int i, int wv, u32 vertex, u16 buffer, f32 strength)
{
if(mesh->getMeshType()==EAMT_SKINNED){
ISkinnedMesh* m = (ISkinnedMesh*)mesh;
irr::scene::ISkinnedMesh::SWeight* weight = m->addWeight(m->getAllJoints()[i]);
weight->strength=strength;
weight->buffer_id=buffer;
weight->vertex_id=vertex;
}
}
I also had a look into the source of the b3d loader but this also uses
the addWeight method so I have no idea what's going on.
Can anybody help me?