@Override
	public boolean doesCollide(BasicBoundingSphere sphere) {
		Vector4D planenormal = new Vector4(_mainPlane.getNormalVector());
		double dist = _mainPlane.distanceToIntersection(new SRay(sphere
				.getPosition(), planenormal));
		if (Math.abs(dist) >= sphere.getRadius())
			return false;

		// w 3D punkt
		Vector4D circlecenter = (Vector4D) new Vector4(sphere.getPosition())
				.add(planenormal.multiply(dist));
		//		
		// Vector2D circlecent = new Vector2(circlecenter.getX(),
		// circlecenter.getY());
		// promien przekroju kuli
		double radius = Math.sqrt(sphere.getRadius() * sphere.getRadius()
				- dist * dist);
		
		circlecenter.substract(_limitCenter);
		double length = circlecenter.length();
		circlecenter.setZ(0).normalize().multiply(length);

		// Vector2D kwadratcenter = new Vector2(circlecent);
		// kwadratcenter.add(new
		// Vector2((Vector4D)(circlecenter.setZ(0).normalize().multiply(length))));
		//		
		// System.out.println("X: " + circlecenter.getX() + " Y: " +
		// circlecenter.getY());
		// System.out.println("Limit X: " + -_limit.getWidth()/2);
		// System.out.println("Limit Y: " + -_limit.getHeight()/2);
		if (circlecenter.getX() <= -_limit.getWidth() / 2 - radius)
			return false;
		if (circlecenter.getX() >= +_limit.getWidth() / 2 + radius)
			return false;
		if (circlecenter.getY() <= -_limit.getHeight() / 2 - radius)
			return false;
		if (circlecenter.getY() >= +_limit.getHeight() / 2 + radius)
			return false;

		return true;
	}