28 lines
664 B
C++
28 lines
664 B
C++
#ifndef RAYTRYCPP_RAY_H
|
|
#define RAYTRYCPP_RAY_H
|
|
|
|
#include <QDebug>
|
|
#include <QVector3D>
|
|
#include <utility>
|
|
|
|
namespace raytry {
|
|
struct Ray {
|
|
Ray(QVector3D originVec, QVector3D directionVec) : originVec{originVec}, directionVec{directionVec} {}
|
|
|
|
QVector3D originVec;
|
|
QVector3D directionVec;
|
|
|
|
#ifndef QT_NO_DEBUG_STREAM
|
|
QDebug operator<<(QDebug dbg) const {
|
|
return dbg << "Ray(" << originVec << "->" << directionVec << ")";
|
|
}
|
|
friend QDebug operator<<(QDebug dbg, const Ray& ray) {
|
|
return ray.operator<<(std::move(dbg));
|
|
}
|
|
#endif
|
|
};
|
|
}// namespace raytry
|
|
|
|
|
|
#endif//RAYTRYCPP_RAY_H
|