2019-07-17 13:17:15 +02:00
|
|
|
import { Transform } from '../classes/Transform'
|
|
|
|
import { vector2 } from '../types/vector2'
|
2019-07-15 13:45:52 +02:00
|
|
|
|
|
|
|
export const pointInSquare = (point: vector2, square: Transform) => {
|
|
|
|
return (
|
|
|
|
point[0] >= square.x &&
|
|
|
|
point[0] <= square.maxX &&
|
|
|
|
point[1] >= square.y &&
|
|
|
|
point[1] <= square.maxY
|
|
|
|
)
|
|
|
|
}
|