Hello,
I'm trying to attach a cal3d animation of a person to a iRigidBody, so I can apply physics to it,etc. I'm using the code:
1 csRef<iMeshFactoryWrapper> imeshfact(loader->LoadMeshObjectFactory("mummie/mummie.cal3d"));
2 if (!imeshfact)
3 {
4 csPrintf("Error loading iMeshFactory for mummie model, aborting\n");
5 }
6 mummieWrapper = engine->CreateMeshWrapper(imeshfact, "mummie", levelsector,mummieLocation);
7 dynSys = app->GetDynSys();
8 mummie=dynSys->CreateBody();
9 mummie->SetProperties(0.1,csVector3(0),csMatrix3());
10 mummie->AttachMesh(mummieWrapper);
11 mummie->SetPosition(mummieLocation);
12 mummieWrapper->GetMovable()->UpdateMove();
13 mummie->Update();
mummie is an csRef<iRigidBody>.
If I omit lines 7 through 13, then the model appears in the level, but upon using those lines the model no longer appears. Both mummie->GetPosition() and mummieWrapper->GetMovable()->GetPosition() return the same value, which is the position I want them to be in.
Any ideas how to make the model appear in the level?
Thanks,
Timothy.