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
Below is an example of my own utility I ended up making which might be useful to others.
Perhaps the exact behavior I needed is not important, but the isOverlapping() helper wouldn't work for me.
I did JUST notice the isIntersecting() helper though ... maybe that's good enough. I could just specify the same position for the start and end parameters...
/** * Checks if a position is inside a rect. * Important that it doesn't generously accept points on the far edges. * This is so that engine objects can belong to exactly 1 sector, even though they may overlap multiple. * So points will match on the lower end, but not the upper end. */exportfunctionposInRect(pos: Vector2,rectPos: Vector2,rectSize: Vector2){constbottomLeft=rectPos.subtract(rectSize.scale(0.5));consttopRight=rectPos.add(rectSize.scale(0.5));if(pos.x>=bottomLeft.x&&pos.y>=bottomLeft.y&&pos.x<topRight.x&&pos.y<topRight.y){returntrue;}returnfalse;}
The text was updated successfully, but these errors were encountered:
Below is an example of my own utility I ended up making which might be useful to others.
Perhaps the exact behavior I needed is not important, but the
isOverlapping()
helper wouldn't work for me.I did JUST notice the
isIntersecting()
helper though ... maybe that's good enough. I could just specify the same position for the start and end parameters...The text was updated successfully, but these errors were encountered: