Sphere - s void set_radius(const double r); s virtual bool...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef __SPHERE__ #define __SPHERE__ # // This file contains the declaration of the class Sphere / #include "GeometricObject.h" # //-------------------------------------------------------------------------------- class Sphere c class Sphere: public GeometricObject { c public: p Sphere(void); // Default constructor D Sphere(Point3D center, double r); // Constructor C Sphere(const Sphere& sphere); // Copy constructor C virtual GeometricObject* // Virtual copy constructor clone(void) const; c virtual // Destructor ~Sphere(void); ~ Sphere& // assignment operator operator= (const Sphere& sphere); o void set_center(const Point3D& c); s void set_center(const double x, const double y, const double z);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s void set_radius(const double r); s virtual bool hit(const Ray& ray, double& t, ShadeRec& s) const; h private: p Point3D center; // center coordinates as a point double radius; // the radius / static const double kEpsilon; // for shadows and secondary rays }; } inline void Sphere::set_center(const Point3D& c) { center = c; } inline void Sphere::set_center(const double x, const double y, const double z) { center.x = x; center.y = y; center.z = z; } inline void Sphere::set_radius(const double r) { radius = r; } #endif...
View Full Document

Page1 / 2

Sphere - s void set_radius(const double r); s virtual bool...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online