I've been having fun with Bullet for some time, and right now I'm in the process of making a character move on a variable terrain.
Overview
I have two objects: a btKinematicCharacterController for the character, and a heightfield-based rigid body for the terrain.
Using the character controller's setWalkDirection() method, I can move it around on the terrain.
Problem
General movement on the terrain is a bit rough, and when the character goes down a hill, he appears to bounce.
I believe this is because there is too much friction, which prevents the character's shape from rubbing against the ground smoothly.
What I've tried
I've looked around and found a few suggestions, none of which have made any noticeable changes. I've seen the following line of code several times throughout the forums:
Code: Select all
discreteDynamicsWorld->getSolverInfo().m_splitImpulse = true;
- using setMargin() on the character's collision shape, then on the terrain's
- retrieving the character's ghost object and calling its setRestitution() method
- calling the ghost object's setFriction() method
I know btKinematicCharacterController is still experimental, but I'm sure there's just something I haven't tried yet.
Question
Is there a well-suited way to soften contact between the character and the terrain?