body->setNode(node) or node = body->getNode()?

Immoho

24-12-2007 06:16:19

Hi.
Here's the code.

body = mScene->createBody("monster.mesh",new CubeShape(0.01f),Vector3(500,40,800),"mass:10");
pMonsterNode = body->getNode();

I found that the pMonsterNode's center is not the same as the entity's.
Another problem is the setNode();
When I use the code above I can move the entity by moving the pMonsternode.
But when I use

body->setNode(pMonsterNode);

I cant move the entity when the pMonsterNode is moving.

How to adjust the entity's center to the node's center?
What's the diffence between body->setNode(node) and node = body->getNode()?
Thanks.

betajaen

24-12-2007 08:18:23

You should adjust the mesh center in your modeller or use an external tool such as MeshMagic which can be found on the main forums.

Immoho

24-12-2007 09:05:11

You should adjust the mesh center in your modeller or use an external tool such as MeshMagic which can be found on the main forums.
OK,I will try it out.
Thanks betajaen.