Skip to content

Commit 0a9e8b2

Browse files
authored
Move check_collision_circle_line out of Rectangle impl (#149)
1 parent bdc64b2 commit 0a9e8b2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

raylib/src/core/collision.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,16 @@ impl Rectangle {
4141
pub fn check_collision_point_rec(&self, point: impl Into<ffi::Vector2>) -> bool {
4242
unsafe { ffi::CheckCollisionPointRec(point.into(), self.into()) }
4343
}
44+
}
4445

45-
/// Check if circle collides with a line created betweeen two points [p1] and [p2]
46-
pub fn check_collision_circle_line(
47-
&self,
48-
center: impl Into<ffi::Vector2>,
49-
radius: f32,
50-
p1: impl Into<ffi::Vector2>,
51-
p2: impl Into<ffi::Vector2>,
52-
) -> bool {
53-
unsafe { ffi::CheckCollisionCircleLine(center.into(), radius, p1.into(), p2.into()) }
54-
}
46+
/// Check if circle collides with a line created betweeen two points [p1] and [p2]
47+
pub fn check_collision_circle_line(
48+
center: impl Into<ffi::Vector2>,
49+
radius: f32,
50+
p1: impl Into<ffi::Vector2>,
51+
p2: impl Into<ffi::Vector2>,
52+
) -> bool {
53+
unsafe { ffi::CheckCollisionCircleLine(center.into(), radius, p1.into(), p2.into()) }
5554
}
5655

5756
// Collision Handling

0 commit comments

Comments
 (0)