export function getDirectionFromRotation(rotation) {
    return ["south", "west", "north", "east"][Math.round(rotation.y / 90) & 3];
}
export function getRotationFromDirection(direction) {
    switch (direction) {
        case "north":
            return { x: 0, y: 180 };
        case "east":
            return { x: 0, y: 270 };
        case "south":
            return { x: 0, y: 0 };
        case "west":
            return { x: 0, y: 90 };
    }
}
