sources:


website:
more info here


screenshot:
studies/grafik2/Computergrafik-Code6/Aufgabe17/RAY.CPP
download file

  1 #include "ray.h"
  2
  3 Ray::Ray(const Vector& o,const Vector& d, double lightspeed) :
  4          origin_(o), direction_(d.normalized()), lightspeed_(lightspeed) {   
  5 }
  6
  7 const Vector& Ray::getOrigin() const {
  8     return origin_;
  9 }
 10
 11 void Ray::setOrigin(const Vector& v) {
 12     origin_ = v;
 13 }
 14
 15 const Vector& Ray::getDirection() const {
 16     return direction_;
 17 }
 18
 19 void Ray::setDirection(const Vector& n) {
 20     direction_ = n.normalized();
 21 }
 22
 23 double Ray::getLightspeed() const {
 24     return lightspeed_;
 25 }
 26
 27 void Ray::setLightspeed(double lightspeed) {
 28     lightspeed_ = lightspeed;
 29 }
 30
 31