Is colliding with other on current or optional destLocation?
Source
bool isCollidingWith(Actor other, [Vector2 destLocation])
{
if (destLocation == null)
{
destLocation = this.location.clone();
}
final noBoxColl = !this.isCircleCollider && (this.colliderBoxExtent.x * this.colliderBoxExtent.y <= 0.0 || other.colliderBoxExtent.x * other.colliderBoxExtent.y <= 0.0);
final noCircleColl = this.isCircleCollider && (max(this.colliderBoxExtent.y, this.colliderBoxExtent.x) <= 0.0 || max(other.colliderBoxExtent.y, other.colliderBoxExtent.x) <= 0.0);
if(other == null || noBoxColl || noCircleColl)
{
return false;
}
if(other.isCircleCollider)
{
return _isCollidingWithCircle(other, destLocation);
}
else
{
return _isCollidingWithRectangle(other, destLocation);
}
}