mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
Set userdata on the body instead of on fixture
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user