Skip to content

Commit

Permalink
renamed parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doe committed Jul 25, 2018
1 parent 722b771 commit cb27835
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
utility
circleAt: circlePos mustIntersectRectangleAt: rectanglePos withExtent: extent
^ ((self absDistanceFrom: circlePos to: rectanglePos) x <= (extent x / 2) or:
[(self absDistanceFrom: circlePos to: rectanglePos) y <= (extent y / 2)])
circleAt: circlePos mustIntersectRectangleAt: rectanglePos withExtent: rectangleExtent
^ ((self absDistanceFrom: circlePos to: rectanglePos) x <= (rectangleExtent x / 2) or:
[(self absDistanceFrom: circlePos to: rectanglePos) y <= (rectangleExtent y / 2)])
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
utility
circleAt: circlePos withRadius: radius canIntersectRectangleAt: rectanglePos withExtent: extent
^ (self absDistanceFrom: circlePos to: rectanglePos) x < (extent x / 2 + radius) and:
[(self absDistanceFrom: circlePos to: rectanglePos) y < (extent y / 2 + radius)]
circleAt: circlePos withRadius: circleRadius canIntersectRectangleAt: rectanglePos withExtent: rectangleExtent
^ (self absDistanceFrom: circlePos to: rectanglePos) x < (rectangleExtent x / 2 + circleRadius) and:
[(self absDistanceFrom: circlePos to: rectanglePos) y < (rectangleExtent y / 2 + circleRadius)]
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
utility
circleAt: circlePos withRadius: radius isCollidingWithRectangleAt: rectanglePos withExtent: extent
circleAt: circlePos withRadius: circleRadius isCollidingWithRectangleAt: rectanglePos withExtent: rectangleExtent
(self circleAt: circlePos
withRadius: radius
withRadius: circleRadius
canIntersectRectangleAt: rectanglePos
withExtent: extent)
withExtent: rectangleExtent)
ifFalse: [^ false].
(self circleAt: circlePos
mustIntersectRectangleAt: rectanglePos
withExtent: extent)
withExtent: rectangleExtent)
ifTrue: [^ true].
^ self circleAt: circlePos withRadius: radius isIntersectingRectangleAt: rectanglePos withExtent: extent
^ self circleAt: circlePos withRadius: circleRadius isIntersectingRectangleAt: rectanglePos withExtent: rectangleExtent
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
utility
circleAt: circlePos withRadius: radius isIntersectingRectangleAt: rectanglePos withExtent: extent
circleAt: circlePos withRadius: circleRadius isIntersectingRectangleAt: rectanglePos withExtent: rectangleExtent
"Because we calculated circleDistance we can now imagine the rectangle center in 0 @ 0,
the circle center at circleDistance and the rectangle corner at (aMorph extent)."
^ ((self absDistanceFrom: circlePos to: rectanglePos) squaredDistanceTo: extent / 2) <=
radius squared
^ ((self absDistanceFrom: circlePos to: rectanglePos) squaredDistanceTo: rectangleExtent / 2) <=
circleRadius squared
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
},
"instance" : {
"absDistanceFrom:to:" : "brh 7/25/2018 22:43",
"circleAt:mustIntersectRectangleAt:withExtent:" : "brh 7/25/2018 22:43",
"circleAt:withRadius:canIntersectRectangleAt:withExtent:" : "brh 7/25/2018 22:43",
"circleAt:withRadius:isCollidingWithRectangleAt:withExtent:" : "brh 7/25/2018 22:44",
"circleAt:withRadius:isIntersectingRectangleAt:withExtent:" : "brh 7/25/2018 22:43",
"circleAt:mustIntersectRectangleAt:withExtent:" : "AZ 7/25/2018 23:01",
"circleAt:withRadius:canIntersectRectangleAt:withExtent:" : "AZ 7/25/2018 23:02",
"circleAt:withRadius:isCollidingWithRectangleAt:withExtent:" : "AZ 7/25/2018 23:03",
"circleAt:withRadius:isIntersectingRectangleAt:withExtent:" : "AZ 7/25/2018 23:03",
"isCollidingWith:" : "TP 7/10/2018 16:20",
"isCollidingWithCircle:" : "brh 7/24/2018 20:48",
"isCollidingWithRectangle:" : "brh 7/25/2018 22:23",
Expand Down

0 comments on commit cb27835

Please sign in to comment.