Added CUBES!

This commit is contained in:
Godzil
2020-02-22 17:30:15 +00:00
parent c9021974f6
commit 81e323fdf4
11 changed files with 584 additions and 14 deletions

28
source/include/cube.h Normal file
View File

@@ -0,0 +1,28 @@
/*
* DoRayMe - a quick and dirty Raytracer
* Cube header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_CUBE_H
#define DORAYME_CUBE_H
#include <shape.h>
#include <ray.h>
#include <intersect.h>
class Cube : public Shape {
private:
void checkAxis(double axeOrigine, double axeDirection, double *axeMin, double *axeMax);
Intersect localIntersect(Ray r);
Tuple localNormalAt(Tuple point);
public:
Cube() : Shape(SHAPE_CUBE) {};
};
#endif /* DORAYME_CUBE_H */

View File

@@ -18,4 +18,7 @@ bool double_equal(double a, double b);
double deg_to_rad(double deg);
double min3(double a, double b, double c);
double max3(double a, double b, double c);
#endif /* DORAYME_MATH_HELPER_H */

View File

@@ -22,6 +22,8 @@ enum ShapeType
SHAPE_NONE,
SHAPE_SPHERE,
SHAPE_PLANE,
SHAPE_CUBE,
SHAPE_CONE,
};
/* Base class for all object that can be presented in the world */