@@ -12,21 +12,19 @@ class AABB {
1212 final Vector2 upperBound;
1313
1414 /// Creates the default object, with vertices at 0,0 and 0,0.
15- AABB ()
16- : lowerBound = Vector2 .zero (),
17- upperBound = Vector2 .zero ();
15+ AABB () : lowerBound = Vector2 .zero (), upperBound = Vector2 .zero ();
1816
1917 /// Copies from the given object.
2018 AABB .copy (AABB copy)
21- : lowerBound = Vector2 .copy (copy.lowerBound),
22- upperBound = Vector2 .copy (copy.upperBound);
19+ : lowerBound = Vector2 .copy (copy.lowerBound),
20+ upperBound = Vector2 .copy (copy.upperBound);
2321
2422 /// Creates an AABB object using the given bounding vertices.
2523 /// [lowerVertex] should be the bottom left vertex of the bounding box.
2624 /// [upperVertex] should be the top right vertex of the bounding box.
2725 AABB .withVec2 (Vector2 lowerVertex, Vector2 upperVertex)
28- : lowerBound = Vector2 .copy (lowerVertex),
29- upperBound = Vector2 .copy (upperVertex);
26+ : lowerBound = Vector2 .copy (lowerVertex),
27+ upperBound = Vector2 .copy (upperVertex);
3028
3129 /// Sets this object from the given object.
3230 void set (AABB aabb) {
@@ -101,14 +99,18 @@ class AABB {
10199
102100 /// Combines another aabb with this one
103101 void combine (AABB aabb) {
104- lowerBound.x =
105- lowerBound.x < aabb.lowerBound.x ? lowerBound.x : aabb.lowerBound.x;
106- lowerBound.y =
107- lowerBound.y < aabb.lowerBound.y ? lowerBound.y : aabb.lowerBound.y;
108- upperBound.x =
109- upperBound.x > aabb.upperBound.x ? upperBound.x : aabb.upperBound.x;
110- upperBound.y =
111- upperBound.y > aabb.upperBound.y ? upperBound.y : aabb.upperBound.y;
102+ lowerBound.x = lowerBound.x < aabb.lowerBound.x
103+ ? lowerBound.x
104+ : aabb.lowerBound.x;
105+ lowerBound.y = lowerBound.y < aabb.lowerBound.y
106+ ? lowerBound.y
107+ : aabb.lowerBound.y;
108+ upperBound.x = upperBound.x > aabb.upperBound.x
109+ ? upperBound.x
110+ : aabb.upperBound.x;
111+ upperBound.y = upperBound.y > aabb.upperBound.y
112+ ? upperBound.y
113+ : aabb.upperBound.y;
112114 }
113115
114116 /// Does this aabb contain the provided AABB.
0 commit comments