Translating and rotating objects by mouse
Posted: Wed Jan 26, 2011 11:22 am
Hi all,
I'm trying to simulate some behavior of table football/footzy/bar football/foosball/table soccer//Futbolìn/baby-foot/fußball/Kicker/Calcio balilla (tha name varies, see this video to understand the play which i refer to: http://www.youtube.com/watch?v=3fHL8wYb ... DD&index=6). More in detail, I would like to simulate the translation and rotations of its rods. I'm trying to develope this using OSG and Bullet Physics. I loaded a model from sketchup and I'm currently able to pick the rigid body of each rod (setted as kinematic, with mass 0).
Reading the following post - http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=4517 - I've seen that to apply a translation or a rotation, i need to:
1) remove the rod rigidbody from bulletWorld;
2) get the current rod position and orientation (from the rod's motionstate)
3) set new matrix applying new rotation and position to the rod's motionstate);
4) re-add the rod rigidbody to the bulletWorld
Do I understand right?
And, supposing that these operations really rotate/translate the rod, the second issue is:
does the ball (dynamic object) collide with players and be kicked from these while applying the rotation/translation?
If I understand wrong, could anyone help me? I've already spent a lot of time to develope the scene and correct the original model of the table... I'm quite desperate with physics simulation.
Cheers,
Axel
I'm trying to simulate some behavior of table football/footzy/bar football/foosball/table soccer//Futbolìn/baby-foot/fußball/Kicker/Calcio balilla (tha name varies, see this video to understand the play which i refer to: http://www.youtube.com/watch?v=3fHL8wYb ... DD&index=6). More in detail, I would like to simulate the translation and rotations of its rods. I'm trying to develope this using OSG and Bullet Physics. I loaded a model from sketchup and I'm currently able to pick the rigid body of each rod (setted as kinematic, with mass 0).
Reading the following post - http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=4517 - I've seen that to apply a translation or a rotation, i need to:
1) remove the rod rigidbody from bulletWorld;
2) get the current rod position and orientation (from the rod's motionstate)
3) set new matrix applying new rotation and position to the rod's motionstate);
4) re-add the rod rigidbody to the bulletWorld
Do I understand right?
And, supposing that these operations really rotate/translate the rod, the second issue is:
does the ball (dynamic object) collide with players and be kicked from these while applying the rotation/translation?
If I understand wrong, could anyone help me? I've already spent a lot of time to develope the scene and correct the original model of the table... I'm quite desperate with physics simulation.
Cheers,
Axel