Moving kinematic objects

deathangel
Posts: 4
Joined: Mon Jun 20, 2011 12:15 pm

Moving kinematic objects

Post by deathangel »

Hello everybody.

I'm new to bullet, all works pretty well but something seems strange to me...

I'm currently trying to move kinematic objects and I have two solutions that doesn't works the same :

1st solution :

Code: Select all

		btDefaultMotionState* myMotionState = (btDefaultMotionState*)body->getMotionState();
		myMotionState->setWorldTransform(transfo);
with this solution, when a contact occurs with a dynamic objects, the dynamic one is pushed far away, it "bounces" on my kinematic object and I don't know why...

2nd solution, il add the following line :

Code: Select all

		body->setInterpolationWorldTransform(transfo);
I use the setInterpolationWorldTransform function. My object is well updated, the collisions works pretty (less exact than before) well but the Joints linked to this object are not updated correctly.


Can somebody explain me what is the best solution to update kinematics ?

Thank you and sorry for my bad english
ologon
Posts: 5
Joined: Thu Jun 16, 2011 11:44 am

Re: Moving kinematic objects

Post by ologon »

I'm also trying to move a kinematic object but no matter what I try, they do not move :(
If I set the transform through the motion state only the graphical object is updated. Translate, setWorldTransform don't move the object.

Could someone explain how to do this :?:
deathangel
Posts: 4
Joined: Mon Jun 20, 2011 12:15 pm

Re: Moving kinematic objects

Post by deathangel »

I have found the bug for my joints that weren't updated !

It was a problem with the deactivation of objects. If a dynamic body is attached to a joint, and the joint attached to a kinematic body, if you update the kinematic body, the dynamic one doesn't reactivate.

Is it a bug or a feature ?

EDIT :
It works on some case but not all, I still have the problem :(