implemented basic photon casting