The Re-Inventing the Wheel Thread

Hey OuttaSpace how would you change the trace to sphere trace instead of line trace and also get surface hits. Can you help on this?