1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
use crate;
// #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
/// A collection of supported objects
// #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
/// All supported shapes
// impl<T, const CS: bool> SupportedShapes2D<T, CS> {
// /// This assumes that this shape is at fault for the collision
// pub fn collide(&mut self, other: &Self) {
// match self {
// Self::Circle(s1) => match other {
// Self::Circle(s2) => circle_circle(s1, s2),
// Self::Rectangle(s2) => circle_rectangle(s1, s2),
// Self::Point(s2) => circle_point(s1, s2),
// },
// Self::Rectangle(s1) => match other {
// Self::Circle(s2) => rectangle_circle(s1, s2),
// Self::Rectangle(s2) => rectangle_rectangle(s1, s2),
// Self::Point(s2) => rectangle_point(s1, s2),
// },
// Self::Point(s1) => match other {
// Self::Circle(s2) => point_circle(s1, s2),
// Self::Rectangle(s2) => point_rectangle(s1, s2),
// Self::Point(s2) => point_point::<T, CS>(s1, s2),
// },
// }
// }
// }
// #[allow(unused, clippy::nursery)]
// fn rectangle_circle<T, const CS: bool>(
// rectangle: &mut Rectangle<T, CS>,
// circle: &Circle<T, CS>,
// ) {
// if rectangle.(other)
// }
// #[allow(unused, clippy::nursery)]
// fn rectangle_rectangle<T, const CS: bool>(
// rectangle: &mut Rectangle<T, CS>,
// rectangle2: &Rectangle<T, CS>,
// ) {
// }
// #[allow(unused, clippy::nursery)]
// fn circle_circle<T, const CS: bool>(
// circle: &mut Circle<T, CS>,
// circle2: &Circle<T, CS>,
// ) {
// }
// #[allow(unused, clippy::nursery)]
// fn circle_rectangle<T, const CS: bool>(
// circle: &mut Circle<T, CS>,
// rectangle: &Rectangle<T, CS>,
// ) {
// }
// #[allow(unused, clippy::nursery)]
// fn rectangle_point<T, const CS: bool>(
// rectangle: &mut Rectangle<T, CS>,
// point: &(T, T),
// ) {
// }
// #[allow(unused, clippy::nursery)]
// fn point_point<T, const CS: bool>(point: &mut (T, T), point2: &(T, T)) {}
// #[allow(unused, clippy::nursery)]
// fn point_rectangle<T, const CS: bool>(
// point: &mut (T, T),
// rectangle: &Rectangle<T, CS>,
// ) {
// }
// #[allow(unused, clippy::nursery)]
// fn circle_point<T, const CS: bool>(circle: &mut Circle<T, CS>, point: &(T, T)) {
// }
// #[allow(unused, clippy::nursery)]
// fn point_circle<T, const CS: bool>(point: &(T, T), circle: &Circle<T, CS>) {}