Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualwildbunny

Posted 07 October 2012 - 11:51 AM

First of all you'll need an equation which lets you remove velocity in one dimension via an impulse. If you have frictionless collision resolution working already, you have this equation to hand (you're using it to remove velocity in the contact normal direction).

So, next step is to find the velocity component in the tangential direction that you want to remove to create friction.

* Form the tangent vector using the perp operator on the contact normal
* Get the relative tangential velocity by dotting total relative contact point velocity against the tangent vector
* Now, you can then generate an impulse to remove some or all of this tangential velocity (most text books say the magnitude of this impulse should be bounded by the magnitude of the normal impulse, but if you just want infinite friction, remove the whole lot)

Job done Posted Image

#1wildbunny

Posted 07 October 2012 - 11:50 AM

First of all you'll need an equation which lets you remove velocity in one dimension via an impulse. If you have frictionless collision resolution working already, you have this equation to hand (you're using it to remove velocity in the contact normal direction).

So, next step is to find the velocity component in the tangential direction that you want to remove to create friction.

* Form the tangent vector using the perp operator on the contact normal
* Get the relative tangential velocity by dotting total relative contact point velocity against the tangent vector
* Now, you can then generate an impulse to remove some or all of this tangential velocity (most text boxes say the magnitude of this impulse should be bounded by the magnitude of the normal impulse, but if you just want infinite friction, remove the whole lot)

Job done :)

PARTNERS