Update Sphere to inherit from Object

- Had to do a couple updates here to adapt to the new code style...
- Update DoesIntersect for code style and to pass back t values in the vector
instead of the float array.
This commit is contained in:
Eryn Wells 2014-07-20 16:49:15 -07:00
parent 2036521f42
commit 19aeb7b14e
2 changed files with 51 additions and 50 deletions

View file

@ -11,9 +11,10 @@
#include "basics.h"
#include "object.h"
namespace charles {
class Sphere
: public Shape
: public Object
{
public:
Sphere();
@ -23,11 +24,13 @@ public:
float get_radius();
void set_radius(float r);
int does_intersect(const Ray &ray, float **t) const;
bool DoesIntersect(const Ray& ray, TVector& t) const;
bool point_is_on_surface(const Vector3 &p) const;
Vector3 compute_normal(const Vector3 &p) const;
private:
float radius;
};
} /* namespace charles */
#endif