def intersect(self, ray): hit = Hit(self, ray, None, None) for o in self.objs: hit = hit.union(o.intersect(ray)) if hit.entry < hit.exit: return hit return None
def intersect(self, ray): hit = Hit(self, ray, float('-inf'), float('-inf')) for o in self.objs: hit = hit.union(o.intersect(ray)) if hit.entry < hit.exit: return hit return None