Implemented all raycast functions.