sources:
BOX.CPP (3.1k)
BOX.H (507 bytes)
RAY.CPP (609 bytes)
RAY.H (604 bytes)
SPHERE.CPP (1.9k)
SPHERE.H (564 bytes)
TRIANGLE.CPP (2.1k)
TRIANGLE.H (1.2k)
UTIL.H (1.7k)
VECTOR.CPP (1.6k)
VECTOR.H (5.0k)
cgapplication.cpp (3.2k)
cgapplication.h (3.5k)
cgraytracer.cpp (18.8k)
cgraytracer.h (1.6k)
shape.h (754 bytes)


binaries:
Release/raytracer.exe (38.0k)


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