Exemplo n.º 1
0
ray_intersection plane::shoot_ray(const ray &r) const
{

	/**
	 * Planes go on forever, therefore there will
	 * 	always be an intersection. We will use the
	 * 	Config.MAX_RENDER_DISTANCE to trim plane's
	 * 	extending too far into the distance
	 */
	double distance = dot(normal, point - r.get_point())
                           / dot(normal, r.get_slope());
	ray_intersection ri(this, normal, r, distance);

    return ri;
}