public static boolean hitPlane(SpaceRegion region, Direction plane,
			Vec3 position, Vec3 direction) {
		
		Vec3 normal = null;
		Vec3 p0;
		Vec3 p1;
		float D; //because math.
		Vec3 pointInPlane;
		//Extracting each plane can, for once, be done with some trickery.
		//also, notice how N and S have the same plane, with only the normal switched around.
		switch ( plane ) {
		
		case N:
			normal = new Vec3( 0.0f, 0.0f, -1.0f );
			pointInPlane = region.localPosition;
			break;
		case S:
			normal = new Vec3( 0.0f, 0.0f, 1.0f );
			pointInPlane = region.localPosition.add( region.size );
			break;
			
		case W:
			normal = new Vec3( 1.0f, 0.0f, 0.0f );
			pointInPlane = region.localPosition;
			break;
		case E:
			normal = new Vec3( -1.0f, 0.0f, 0.0f );
			pointInPlane = region.localPosition.add( region.size );
			break;
			
		case FLOOR:
			normal = new Vec3( 0.0f, 1.0f, 0.0f );
			pointInPlane = region.localPosition;
			break;
		case CEILING:
			default:
			normal = new Vec3( 0.0f, -1.0f, 0.0f );
			pointInPlane = region.localPosition.add( region.size );
			break;
		}
		
		D = normal.scaled( -1.0f ).dotProduct( pointInPlane );

		float t = Math.max( 0.0f,  ( - ( normal.dotProduct( position ) + D )) / ( normal.dotProduct( direction ) ) );
		
		Vec3 projection = getParametricVecFromRay(position, direction, t);
		
		return region.isInside( projection );
	}