@@ -18,19 +18,18 @@ impl Rectangle {
1818
1919 /// Checks collision between circle and rectangle.
2020 #[ inline]
21- pub fn check_collision_circle_rec ( & self , center : Vector2 , radius : f32 ) -> bool {
21+ pub fn check_collision_circle_rec ( & self , center : impl Into < Vector2 > , radius : f32 ) -> bool {
2222 unsafe { crate :: CheckCollisionCircleRec ( center. into ( ) , radius, * self ) }
2323 }
2424
2525 /// Gets the overlap between two colliding rectangles.
2626 /// ```rust
2727 /// use raylib::prelude::*;
28- /// fn main() {
29- /// let r1 = Rectangle::new(0.0, 0.0, 10.0, 10.0);
30- /// let r2 = Rectangle::new(20.0, 20.0, 10.0, 10.0);
31- /// assert_eq!(None, r1.get_collision_rec(&r2));
32- /// assert_eq!(Some(r1), r1.get_collision_rec(&r1));
33- /// }
28+ ///
29+ /// let r1 = Rectangle::new(0.0, 0.0, 10.0, 10.0);
30+ /// let r2 = Rectangle::new(20.0, 20.0, 10.0, 10.0);
31+ /// assert_eq!(None, r1.get_collision_rec(&r2));
32+ /// assert_eq!(Some(r1), r1.get_collision_rec(&r1));
3433 /// ```
3534 #[ inline]
3635 pub fn get_collision_rec ( & self , other : Rectangle ) -> Option < Rectangle > {
@@ -40,7 +39,7 @@ impl Rectangle {
4039
4140 /// Checks if point is inside rectangle.
4241 #[ inline]
43- pub fn check_collision_point_rec ( & self , point : Vector2 ) -> bool {
42+ pub fn check_collision_point_rec ( & self , point : impl Into < Vector2 > ) -> bool {
4443 unsafe { crate :: CheckCollisionPointRec ( point. into ( ) , * self ) }
4544 }
4645}
@@ -54,7 +53,11 @@ impl BoundingBox {
5453
5554 /// Detects collision between box and sphere.
5655 #[ inline]
57- pub fn check_collision_box_sphere ( & self , center_sphere : Vector3 , radius_sphere : f32 ) -> bool {
56+ pub fn check_collision_box_sphere (
57+ & self ,
58+ center_sphere : impl Into < Vector3 > ,
59+ radius_sphere : f32 ,
60+ ) -> bool {
5861 unsafe { crate :: CheckCollisionBoxSphere ( * self , center_sphere. into ( ) , radius_sphere) }
5962 }
6063
0 commit comments