public Vector2f checkIntersection(Vector2f lineStart, Vector2f lineEnd, boolean hurtMonsters){
        Vector2f nearestIntersection = null;

        for(int i = 0; i < collisionPosStart.size(); i++){
            Vector2f collisionVector = lineIntersect(lineStart, lineEnd, collisionPosStart.get(i), collisionPosEnd.get(i));

            nearestIntersection = findNearestVector2f(nearestIntersection, collisionVector, lineStart);
        }

        for(Door d : doors){
            Vector2f doorSize = d.getDoorSize();
            Vector3f doorPos3f = d.getTransform().getTranslation();
            Vector2f doorPos2f = new Vector2f(doorPos3f.getX(), doorPos3f.getZ());
            Vector2f collisionVector = lineIntersectRect(lineStart, lineEnd, doorPos2f, doorSize);

            findNearestVector2f(nearestIntersection, collisionVector, lineStart);
        }
        if(hurtMonsters){
            Vector2f nearestEnemyIntersect = null;
            Enemy nearestEnemy = null;

            for(Enemy e : enemies){
                Vector2f enemySize = e.getSize();
                Vector3f enemyPos3f = e.getTransform().getTranslation();
                Vector2f enemyPos2f = new Vector2f(enemyPos3f.getX(), enemyPos3f.getZ());
                Vector2f collisionVector = lineIntersectRect(lineStart, lineEnd, enemyPos2f, enemySize);

                nearestEnemyIntersect = findNearestVector2f(nearestEnemyIntersect, collisionVector, lineStart);

                if(nearestEnemyIntersect == collisionVector)
                    nearestEnemy = e;

            }
            if(nearestEnemyIntersect != null && (nearestIntersection == null ||
                    nearestEnemyIntersect.sub(lineStart).length() < nearestIntersection.sub(lineStart).length()))
            {
                if(nearestEnemy != null)
                    nearestEnemy.damage(player.getDamage());
            }
        }

        return nearestIntersection;
    }