-
Notifications
You must be signed in to change notification settings - Fork 1
/
cylinder_ring.h
42 lines (31 loc) · 1.1 KB
/
cylinder_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
33
34
35
36
37
38
39
40
41
42
#ifndef _CYLINDER_RING_H_
#define _CYLINDER_RING_H_
#include "primitive.h"
#include "vectors.h"
// ====================================================================
// ====================================================================
// Simple implicit repesentation of a ring, that can also be
// rasterized for use in radiosity.
class CylinderRing : public Primitive {
public:
// CONSTRUCTOR & DESTRUCTOR
CylinderRing(const Vec3f &c, double h, double i_r, double o_r, Material *m) {
center = c; height = h; inner_radius = i_r; outer_radius = o_r; material = m;
assert (height > 0);
assert (inner_radius > 0);
assert (outer_radius > inner_radius); }
~CylinderRing() {}
// for ray tracing
bool intersect(const Ray &r, Hit &h) const;
// for OpenGL rendering & radiosity
void addRasterizedFaces(Mesh *m, ArgParser *args);
private:
// REPRESENTATION
Vec3f center;
double height;
double inner_radius;
double outer_radius;
};
// ====================================================================
// ====================================================================
#endif