Added func to Ray

master
seba il y a 15 ans
Parent 314b2602be
révision a9b6ce3000

@ -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;
}

@ -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);

Chargement…
Annuler
Enregistrer