Moved all the gross camera stuff into a function, tweaking raycasting