00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef LIGHTRAY_H
00022
#define LIGHTRAY_H
00023
00024
#include "ray.h"
00025
#include "colour.h"
00026
#include "insidelist.h"
00027
00028
class Scene;
00029
00033 class LightRay:
public Ray {
00034
00035
public:
00036
LightRay(
const Vector3& start,
const Vector3& end,
Scene* s,
00037
const Colour lightcolour,
const InsideList* l):
00038
Ray(start, Vector3::sub(end,start)), myscene(s), colour(lightcolour),
00039 inside(), length(direction.length()) {
00040
00041 direction.
scale(1/length);
00042
if (l) inside =
InsideList(*l);
00043
00044 }
00045
00046
LightRay(
const LightRay& l):
Ray(l), myscene(l.
myscene), colour(l.
colour),
00047 inside(l.
inside), length(l.
length) {}
00048
00049 ~
LightRay() {}
00050
00051
private:
00052
LightRay& operator=(
const LightRay&);
00053
00054
public:
00058
Colour shoot();
00059
00060
private:
00061
Scene* myscene;
00062
Colour colour;
00063
InsideList inside;
00064 DBL length;
00065
00066 };
00067
00068
#endif