Finished porting raycasting example.