How to control forces of kinematic body against rigid body

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
JayAr
Posts: 9
Joined: Tue Nov 02, 2010 1:28 pm

How to control forces of kinematic body against rigid body

Post by JayAr »

Hi,
Lets say I have Kinematic Body A which has a specific velocity and pushes against Ridig Body B. It now applies some force against the Rigid Body, pushing it away. Now since Body A is Kinematic, it doesnt matter which mass the Rigid Body B has. It always gets pushed away the same distance, if the velocity of A doesnt change.

But is there a way to control the amount of forces a Kinematic Body can apply to a Rigid Body??

Because in the end, I have a Ping Pong simulation where I can control the Ping Pong Racket (which is Kinematic) and I can hit a ball with it, but in my opinion the forces applied to the ball are way too much. Can I just at some point set a flag which says the Kinematic Body should always apply half the forces it normally would?

Code: Select all

// This is my Kinematic Body:
btRigidBody* kinematicBody;                          // I set it Kinematic somewhere else

//And this is how I update the position and orientation of the body
btTransform T;
kinematicBody->getMotionState()->setWorldTransform(T);
So I'd really like to have more control over the simulation with Kinematic Bodies.
Johan Gidlund
Posts: 26
Joined: Mon Jun 01, 2009 2:21 pm
Location: Sweden
Contact:

Re: How to control forces of kinematic body against rigid bo

Post by Johan Gidlund »

I have not worked with Bullet in a long time so I don't know exactly how things work in it.
But talking for a general perspective mass should effect the force of the collision even for a keyframed object?
Tweaking restitution should also change the behavior.
JayAr
Posts: 9
Joined: Tue Nov 02, 2010 1:28 pm

Re: How to control forces of kinematic body against rigid bo

Post by JayAr »

Thanks, changing restitution of the Kinematic and Rigid Body actually did change the effect a bit. But the lowest value you can set is 0 and even then the forces applied are too high, plus the ball needs at least some restitution to be able to bounce.
Changing the mass of the kinematic body is not possible, since kinematic bodies always have a mass of 0, and changing the mass of the rigid body doesnt change anything regarding the interaction with the kinematic body.

So I hope I can somehow change the effect by changing something in the motion state, but I dont know how exactly.
Post Reply