Added func to Ray

This commit is contained in:
seba 2009-09-18 14:30:40 +02:00
parent 314b2602be
commit a9b6ce3000
2 changed files with 6 additions and 0 deletions

View File

@ -75,6 +75,11 @@ void Ray::set(Punkt3D _pos, Punkt3D _dir) {
dir = _dir;
}
void Ray::setFromPoints(Punkt3D a, Punkt3D b) {
pos = a;
dir = b - a;
}
Punkt3D Ray::get(float x) {
return pos + dir*x;
}

View File

@ -60,6 +60,7 @@ class Ray {
Ray(Punkt3D _pos, Punkt3D _dir);
void set(Punkt3D _pos, Punkt3D _dir);
void setFromPoints(Punkt3D a, Punkt3D b);
Punkt3D get(float x);
bool onRay(Punkt3D p, int rnd=-1);
float dist(Punkt3D p);