-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ring.h
32 lines (25 loc) · 849 Bytes
/
Ring.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef Ring_h
#define Ring_h
#include "Vector.h"
#include "Primitive.h"
class HitRecord;
class Point;
class RenderContext;
class Ring : public Primitive {
public:
Ring(Material* material, const Vector& n, double r, double r2, const Point& q);
virtual ~Ring();
virtual void getBounds(BoundingBox& bbox, const RenderContext&) const;
virtual void intersect(HitRecord& hit, const RenderContext& context, const Ray& ray) const;
virtual void normal(Vector& normal, const RenderContext& context,
const Point & hitpos, const Ray& ray, const HitRecord& hit) const;
private:
Ring(const Ring&);
Ring& operator=(const Ring&);
Vector n; //normal
double r; //radius
double r2; //radius 2
Point q; //center
double d;
};
#endif //Ring_h