Reworked portal logic to support more gneeral position/directions
refactored ray enttering portal logic