Nik
Nik

Reputation: 1033

Bullet Physics Rigid Body bounces off surfaces

I wrote a player controller for my game that uses a rigid body to give the player physics. I set both restitution and friction to 0, and the mass to 80. My terrain has the exact same properties, just that the mass is also 0. Whenever the player falls from a great height, it bounces on the terrain surface a few times. This isn't really how I want my player to react. Is there a way to prevent this kind of behaviour?

Here is a video illustrating my problem. It is slightly laggy because I recorded it using QuickTime, but it should get the point across.

http://www.youtube.com/watch?v=2eQ1cj7hpWw

Upvotes: 3

Views: 3885

Answers (1)

Max
Max

Reputation: 6394

You set restitution 0 and expect it to not bounce. But that small jump (comparing with height from which your felt) is coursed by solver when your body collides with earth. Solver applies certain impulse to resolve collision and stop your movement. Impulse is bit bigger then necessary to avoid situation when collision is not resolved.

You may consider to implement different simulation when your body is kinematic and not dynamic.

You will have to process collisions and movements manually but you will have full control on how you wish your body to move.

Upvotes: 6

Related Questions