Set userdata on the body instead of on fixture

This commit is contained in:
Lukas Klingsbo
2020-05-03 12:59:50 +02:00
parent ac6abfcd24
commit 94cd8b6f2b
3 changed files with 12 additions and 4 deletions

View File

@ -38,14 +38,14 @@ class Ball extends BodyComponent {
shape.radius = radius;
final fixtureDef = FixtureDef()
// To be able to determine object in collision
..setUserData(this)
..shape = shape
..restitution = 1.0
..density = 1.0
..friction = 0.1;
final bodyDef = BodyDef()
// To be able to determine object in collision
..setUserData(this)
..position = position
..type = BodyType.DYNAMIC;