diff options
-rw-r--r-- | Spear/Collision/Collision.hs | 3 | ||||
-rw-r--r-- | Spear/Collision/Collisioner.hs | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/Spear/Collision/Collision.hs b/Spear/Collision/Collision.hs index 3a4c614..60c2f03 100644 --- a/Spear/Collision/Collision.hs +++ b/Spear/Collision/Collision.hs | |||
@@ -57,7 +57,6 @@ instance Collisionable Circle where | |||
57 | distance_centers = normSq $ c1 - c2 | 57 | distance_centers = normSq $ c1 - c2 |
58 | sum_radii = (r1 + r2)^2 | 58 | sum_radii = (r1 + r2)^2 |
59 | sub_radii = (r1 - r2)^2 | 59 | sub_radii = (r1 - r2)^2 |
60 | |||
61 | 60 | ||
62 | 61 | ||
63 | aabbPoints :: AABB -> [Vector2] | 62 | aabbPoints :: AABB -> [Vector2] |
@@ -73,7 +72,7 @@ aabbPoints (AABB min max) = [p1,p2,p3,p4,p5,p6,p7,p8] | |||
73 | p8 = vec2 (x max) (y max) | 72 | p8 = vec2 (x max) (y max) |
74 | 73 | ||
75 | 74 | ||
76 | -- | Create the minimal AABB fully containing the specified Sphere. | 75 | -- | Create the minimal box fully containing the specified circle. |
77 | aabbFromCircle :: Circle -> AABB | 76 | aabbFromCircle :: Circle -> AABB |
78 | aabbFromCircle (Circle c r) = AABB bot top | 77 | aabbFromCircle (Circle c r) = AABB bot top |
79 | where | 78 | where |
diff --git a/Spear/Collision/Collisioner.hs b/Spear/Collision/Collisioner.hs index af6fee5..19114e6 100644 --- a/Spear/Collision/Collisioner.hs +++ b/Spear/Collision/Collisioner.hs | |||
@@ -25,12 +25,12 @@ data Collisioner | |||
25 | | CircleCol { getSphere :: !Circle } | 25 | | CircleCol { getSphere :: !Circle } |
26 | 26 | ||
27 | 27 | ||
28 | -- | Create a 'Collisioner' from the specified 'AABB'. | 28 | -- | Create a 'Collisioner' from the specified box. |
29 | aabbCollisioner :: AABB -> Collisioner | 29 | aabbCollisioner :: AABB -> Collisioner |
30 | aabbCollisioner = AABBCol | 30 | aabbCollisioner = AABBCol |
31 | 31 | ||
32 | 32 | ||
33 | -- | Create a 'Collisioner' from the specified 'BSphere'. | 33 | -- | Create a 'Collisioner' from the specified circle. |
34 | sphereCollisioner :: Circle -> Collisioner | 34 | sphereCollisioner :: Circle -> Collisioner |
35 | sphereCollisioner = CircleCol | 35 | sphereCollisioner = CircleCol |
36 | 36 | ||
@@ -40,7 +40,7 @@ buildAABB :: [Collisioner] -> AABB | |||
40 | buildAABB cols = aabb $ generatePoints cols | 40 | buildAABB cols = aabb $ generatePoints cols |
41 | 41 | ||
42 | 42 | ||
43 | -- | Create the minimal 'AABB' collisioner fully containing the specified 'BSphere'. | 43 | -- | Create the minimal 'AABB' collisioner fully containing the specified circle. |
44 | boxFromSphere :: Circle -> Collisioner | 44 | boxFromSphere :: Circle -> Collisioner |
45 | boxFromSphere = AABBCol . aabbFromCircle | 45 | boxFromSphere = AABBCol . aabbFromCircle |
46 | 46 | ||