moving an object after it has came to "rest"

yellowfever13
Posts: 2
Joined: Mon Oct 06, 2008 2:22 am

moving an object after it has came to "rest"

Post by yellowfever13 »

Hello,

after setting up my first demo project from scratch, it seems to be working fine. However, setRestitution is not making any difference in the objects behavior. I searched topics and saw a few people complaining of the issue several versions ago. I am using 2.72.

Is this still an issue? I am using a rigidbody and setting the restitution before i add it to the world.

EDIT: also at run time i am using ballbody->setWorldTransform( btTransform(btQuaternion(0,0,0,1),btVector3(0,50,0)) );
This doesnt seem to move the objects position? How do you move an object at runtime?

Thanks!
Last edited by yellowfever13 on Wed Oct 08, 2008 3:08 am, edited 1 time in total.
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: setRestitution not working

Post by mickey »

restitution seems to be working fine. You should set both restitution of the ground and the object. Try to render the actual object and then change the restitution values and you would see the change in behavior.

to move the object, you can either apply a linear velocity or do this:

btTransform trn;
trn.setIdentity();
trn.setOrigin( /* position here */ );
ballbody->setWorldTransform( trn );

Hope that helps
yellowfever13
Posts: 2
Joined: Mon Oct 06, 2008 2:22 am

Re: setRestitution not working

Post by yellowfever13 »

Indeed that worked thank you. It seems however that after the ball drops and comes to "rest" or at least its height is oscillating constantly the same, that setting the new position no longer works? Any ideas about this? Maybe a setting I need to tweak?

Also, since this object is moving still, I assume its using processing power even though it should be at rest, its slightly jiggling. Is there a way to set it to "dead" or something in order to save processing?

Thanks!