1 #ifndef _SPHERE_H
2 #define _SPHERE_H
3
4 #include "shape.h"
5
6 //- Sphere
7 class Sphere : public Shape {
8 //. Sphere Class.
9 public:
10 //- Sphere
11 Sphere(const Vector& center, double radius);
12
13 const Vector& getCenter() const;
14 void setCenter(const Vector& c);
15
16 double getRadius() const;
17 void setRadius(double r);
18
19 // intersect
20 virtual bool intersect(const Ray& r,Vector& p,Vector& n, double& d) const;
21
22 private:
23 Vector center_;
24 double radius_;
25 };
26
27 #endif // _Sphere_H
28
29