Crystal Space
Welcome, Guest. Please login or register.
September 19, 2014, 07:18:03 am

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8481 Members
Latest Member: Cex18145xu
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Attaching a cal3d model to an iRigidBody
« previous next »
Pages: [1] Print
Author Topic: Attaching a cal3d model to an iRigidBody  (Read 1441 times)
TimothyM
Newbie
*
Posts: 4


View Profile Email
« on: May 04, 2006, 04:15:15 pm »

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:

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.
Logged
koocake
Jr. Member
**
Posts: 54


View Profile
« Reply #1 on: May 04, 2006, 04:25:33 pm »

Bo Hannon says get nerdling to do it Wink
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 8.255 seconds with 17 queries.