Shape is now an abstract class and can't be instanciated.
Change derived shape to only deal with local calculation they don't need anymore to deal with how they've been transformed.
This commit is contained in:
@@ -15,11 +15,13 @@
|
||||
|
||||
class Sphere : public Shape
|
||||
{
|
||||
private:
|
||||
Intersect localIntersect(Ray r);
|
||||
Tuple localNormalAt(Tuple point);
|
||||
|
||||
public:
|
||||
Sphere() : Shape(SHAPE_SPHERE) { };
|
||||
/* All sphere are at (0, 0, 0) and radius 1 in the object space */
|
||||
virtual Intersect intersect(Ray r);
|
||||
virtual Tuple normalAt(Tuple point);
|
||||
};
|
||||
|
||||
#endif /* DORAYME_SPHERE_H */
|
||||
|
||||
Reference in New Issue
Block a user