Renaming Object to Shape (part 1)
This commit is contained in:
@@ -11,16 +11,16 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
class Object;
|
||||
class Shape;
|
||||
|
||||
class Intersection
|
||||
{
|
||||
public:
|
||||
double t;
|
||||
Object *object;
|
||||
Shape *object;
|
||||
|
||||
public:
|
||||
Intersection(double t, Object *object) : t(t), object(object) { };
|
||||
Intersection(double t, Shape *object) : t(t), object(object) { };
|
||||
bool nothing() { return (this->object == nullptr); };
|
||||
|
||||
bool operator==(const Intersection &b) const { return ((this->t == b.t) && (this->object == b.object)); };
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef DORAYME_OBJECT_H
|
||||
#define DORAYME_OBJECT_H
|
||||
|
||||
class Object;
|
||||
class Shape;
|
||||
|
||||
#include <ray.h>
|
||||
#include <tuple.h>
|
||||
@@ -18,7 +18,7 @@ class Object;
|
||||
#include <material.h>
|
||||
|
||||
/* Base class for all object that can be presented in the world */
|
||||
class Object
|
||||
class Shape
|
||||
{
|
||||
public:
|
||||
Matrix transformMatrix;
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
Material material;
|
||||
|
||||
public:
|
||||
Object();
|
||||
Shape();
|
||||
|
||||
virtual Intersect intersect(Ray r);
|
||||
virtual Tuple normalAt(Tuple point);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <ray.h>
|
||||
#include <intersect.h>
|
||||
|
||||
class Sphere : public Object
|
||||
class Sphere : public Shape
|
||||
{
|
||||
public:
|
||||
/* All sphere are at (0, 0, 0) and radius 1 in the object space */
|
||||
|
||||
Reference in New Issue
Block a user