Implemented basic raycasting functions