diff --git a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.mustIntersectRectangleAt.withExtent..st b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.mustIntersectRectangleAt.withExtent..st index e327b9c8..5fd531f6 100644 --- a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.mustIntersectRectangleAt.withExtent..st +++ b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.mustIntersectRectangleAt.withExtent..st @@ -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)]) \ No newline at end of file +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)]) \ No newline at end of file diff --git a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.canIntersectRectangleAt.withExtent..st b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.canIntersectRectangleAt.withExtent..st index 743b4c60..ea5689b9 100644 --- a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.canIntersectRectangleAt.withExtent..st +++ b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.canIntersectRectangleAt.withExtent..st @@ -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)] \ No newline at end of file +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)] \ No newline at end of file diff --git a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isCollidingWithRectangleAt.withExtent..st b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isCollidingWithRectangleAt.withExtent..st index ce913682..d8d0f51b 100644 --- a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isCollidingWithRectangleAt.withExtent..st +++ b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isCollidingWithRectangleAt.withExtent..st @@ -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 \ No newline at end of file + ^ self circleAt: circlePos withRadius: circleRadius isIntersectingRectangleAt: rectanglePos withExtent: rectangleExtent \ No newline at end of file diff --git a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isIntersectingRectangleAt.withExtent..st b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isIntersectingRectangleAt.withExtent..st index 7ea4819a..3eb3a427 100644 --- a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isIntersectingRectangleAt.withExtent..st +++ b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/instance/circleAt.withRadius.isIntersectingRectangleAt.withExtent..st @@ -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 \ No newline at end of file + ^ ((self absDistanceFrom: circlePos to: rectanglePos) squaredDistanceTo: rectangleExtent / 2) <= + circleRadius squared \ No newline at end of file diff --git a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/methodProperties.json b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/methodProperties.json index 5c57e0c9..61f1eeaf 100644 --- a/source/GM-Core.package/GMCircleCollisionDetectionShape.class/methodProperties.json +++ b/source/GM-Core.package/GMCircleCollisionDetectionShape.class/methodProperties.json @@ -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",