Start working on dumping the world (to a JSON file) for debug purposes.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <colour.h>
|
||||
#include <pattern.h>
|
||||
#include <light.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class Shape;
|
||||
|
||||
@@ -47,6 +48,8 @@ public:
|
||||
double_equal(this->refractiveIndex, b.refractiveIndex) &&
|
||||
(this->colour == b.colour); };
|
||||
bool operator!=(const Material &b) const { return !(*this == b); };
|
||||
|
||||
void dumpMe(FILE *fp);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <colour.h>
|
||||
#include <tuple.h>
|
||||
#include <matrix.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class Shape;
|
||||
|
||||
@@ -28,6 +29,7 @@ public:
|
||||
Pattern(Colour a, Colour b);
|
||||
|
||||
virtual Colour patternAt(Tuple point) = 0;
|
||||
virtual void dumpMe(FILE *fp);
|
||||
|
||||
void setTransform(Matrix transform);
|
||||
Colour patternAtObject(Shape *object, Tuple point);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
class Shape;
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ray.h>
|
||||
#include <tuple.h>
|
||||
#include <matrix.h>
|
||||
@@ -63,6 +64,8 @@ public:
|
||||
|
||||
virtual void updateTransform();
|
||||
|
||||
virtual void dumpMe(FILE *fp);
|
||||
|
||||
Tuple worldToObject(Tuple point) { return this->inverseTransform * point; };
|
||||
Tuple objectToWorld(Tuple point) { return this->transformMatrix * point; };
|
||||
Tuple normalToWorld(Tuple normalVector);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <shape.h>
|
||||
#include <intersect.h>
|
||||
#include <ray.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class World
|
||||
{
|
||||
@@ -51,6 +52,7 @@ public:
|
||||
|
||||
Intersect intersect(Ray r);
|
||||
|
||||
void dumpMe(FILE *fp);
|
||||
};
|
||||
|
||||
#endif /* DORAYME_WORLD_H */
|
||||
|
||||
Reference in New Issue
Block a user