Fixed ray tracing failing to work when crossing from positive to negative