Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Friction in Box2d [closed]

Tags:

physics

box2d

I am using Box2d for a topdown game. The "ground" is a series of tiles, where each tile is a static body with a sensor shape. Can I make friction take effect for this, even though the objects aren't really "colliding" with the ground?

If Box2d won't let me do this, I considered trying to implement my own by detecting what force is currently moving the object, and applying a force opposite to it, but I'm not quite sure how to detect that force.

like image 482
Nick Heiner Avatar asked Apr 02 '10 21:04

Nick Heiner


1 Answers

Another way of doing this is to set linearDamping on your body. You could set this differently depending on the tile your object is on.

like image 200
Colin Gislason Avatar answered Nov 13 '22 14:11

Colin Gislason