Renaming Object to Shape (part 1)

This commit is contained in:
Godzil
2020-02-18 11:40:55 +00:00
parent df4ec9794a
commit 5a4f9f4dc4
12 changed files with 19 additions and 19 deletions

View File

@@ -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)); };

View File

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

View File

@@ -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 */