## Real snake movements with anisotropic friction

mkk13
Posts: 2
Joined: Tue Apr 18, 2017 10:28 am

### Real snake movements with anisotropic friction

Hello,

I'm currently trying to implement snake simulator, where You move a snake based on basic principles of snakes movements.

Snake is built from simple cubes, joined with ConeTwist constraints. Swing limit is 30 degrees, twist limit is 45 degrees.

Main plan was to use friction, that snakeskin normally has - biggest friction when sliding backwards, smaller when sliding to the side, smallest when sliding forward. Using this, snake moves forward by using his muscles to bend and kinda "push off" using friction.

When I read that anisotropic friction is implemented, I was sure that it's doable...but later on I saw that it's only linear friction per axis (which is still good, but not what I'm looking for).

Is it possible to somehow implement this kind of friction? Maybe by combining multiple functionalities from bullet and multiple dampings, frictions etc? Maybe I could implement a function that would give bullet friction for a given rigidBody and a direction - if so, where could I put it or how could I 'attach' it to Bullet?

All answers are really appreciated, as I am in a little bit of a hurry

mkk13
Posts: 2
Joined: Tue Apr 18, 2017 10:28 am

### Re: Real snake movements with anisotropic friction

Right now I'm just using my own Solver, which is almost copy/paste btSequentialImpulseConstraintSolver, but with applyAnisotropicFriction() function changed.
Function checks whether local direction is forward or backward (basically...it just checks sign) and if it's backwards, it multiplies vector in that direction.

If anyone has better idea how to implement this or how to improve current solution, please share with me