Skip to content

Commit

Permalink
fix segment shape (#182)
Browse files Browse the repository at this point in the history
- Fixes #181
  • Loading branch information
Ughuuu authored Aug 5, 2024
1 parent 2af4d24 commit af84509
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/shapes/rapier_segment_shape_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ impl IRapierShape for RapierSegmentShape2D {
}
let r: Rect2 = data.try_to().unwrap_or_default();
self.a = r.position;
self.b = r.position + r.size;
self.b = r.size;
let handle = self.create_rapier_shape(physics_engine);
self.base.set_handle(handle, physics_engine);
}

fn get_data(&self) -> Variant {
let mut r = Rect2::new(self.a, self.b - self.a);
r.size = self.b - self.a;
let r = Rect2::new(self.a, self.b);
r.to_variant()
}

Expand Down

0 comments on commit af84509

Please sign in to comment.