diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-08 22:47:28 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-08 22:47:28 -0500 |
commit | 5e630fbd360181dccbe1e54793bf218e4124614d (patch) | |
tree | 13cc814aa1c53a4069fa0608101b759fe50a56e3 | |
parent | 806db25561bd23a52ccaa09af727bd26ea04fb41 (diff) |
add friction to platforms
-rw-r--r-- | sim.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -247,7 +247,12 @@ static void platform_make_body(State *state, Platform *platform) { b2PolygonShape shape; shape.SetAsBox(half_size, state->platform_thickness); - body->CreateFixture(&shape, 0.0f); + + b2FixtureDef fixture; + fixture.shape = &shape; + fixture.friction = 0.8f; + + body->CreateFixture(&fixture); if (platform->moves) { float speed = platform->move_speed; v2 p1 = platform->move_p1, p2 = platform->move_p2; |