Consolidate ray sweeping functions

Also, add the skin thickness to the length of ray
Merge branch 'eric-conversion' of https://github.com/whtt-eric/mage-gunner into eric-conversion