You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think i have found a problem in findCollisionType function.
In findCollisionType to determine if an object is a circle, the existence of diameter member is tested :
[...]
if (a.diameter && b.diameter) {
//They're circles
return circleVsCircle(a, b);
} else if (a.diameter && !b.diameter) {
//The first one is a circle and the second is a rectangle
return circleVsRectangle(a, b);
[...]
But diameter is never added in addCollisionProperties, while the radius is it, so I suggest to use radius instead of diameter, and the code of findCollisionType become :
[...]
if (a.radius && b.radius) {
//They're circles
return circleVsCircle(a, b);
} else if (a.radius && !b.radius) {
//The first one is a circle and the second is a rectangle
return circleVsRectangle(a, b);
[...]
The text was updated successfully, but these errors were encountered:
Hi everyone,
I think i have found a problem in findCollisionType function.
In findCollisionType to determine if an object is a circle, the existence of diameter member is tested :
[...]
if (a.diameter && b.diameter) {
//They're circles
return circleVsCircle(a, b);
} else if (a.diameter && !b.diameter) {
//The first one is a circle and the second is a rectangle
return circleVsRectangle(a, b);
[...]
But diameter is never added in addCollisionProperties, while the radius is it, so I suggest to use radius instead of diameter, and the code of findCollisionType become :
[...]
if (a.radius && b.radius) {
//They're circles
return circleVsCircle(a, b);
} else if (a.radius && !b.radius) {
//The first one is a circle and the second is a rectangle
return circleVsRectangle(a, b);
[...]
The text was updated successfully, but these errors were encountered: