question: private float applyFriction ( float velocity , float simulationRate ) { if ( isZero ( velocity ) ) { velocity = 0.0f ; } else if ( velocity > 0 ) { velocity = Math . max ( 0.0f , velocity - ( FRICTION * simulationRate ) ) ; } else { velocity = Math . min ( 0.0f , velocity + ( FRICTION * simulationRate ) ) ; } return velocity ; }
target:  Friction slows velocity in the opposite direction of motion, until zero velocity is reached.