You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
382 B
20 lines
382 B
2 years ago
|
#ifndef RAYH
|
||
|
#define RAYH
|
||
|
#include "vec3.h"
|
||
|
|
||
|
class ray
|
||
|
{
|
||
|
public:
|
||
|
ray() {}
|
||
|
ray(const vec3& a, const vec3& b) { O = a; D = b; }
|
||
|
vec3 origin() const { return O; }
|
||
|
vec3 direction() const { return D; }
|
||
|
vec3 point_at_parameter(float t) const {
|
||
|
return vec3(D * t + O);
|
||
|
}
|
||
|
|
||
|
vec3 O;
|
||
|
vec3 D;
|
||
|
};
|
||
|
|
||
|
#endif
|