Changed collision detection to use ray-plane check