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

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

#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);

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

View Full Document
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

This note was uploaded on 02/19/2010 for the course CS 390 taught by Professor Hu during the Spring '10 term at Westminster UT.

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
Ask a homework question - tutors are online