Files
dorayme/source/include/triangle.h
Godzil e57b5715e8 Smooth triangles! And support for them in the OBJ File parser.
Also add an interesting tea party scene!
2020-03-06 15:07:26 +00:00

35 lines
601 B
C++

/*
* DoRayMe - a quick and dirty Raytracer
* Triangle header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_TRIANGLE_H
#define DORAYME_TRIANGLE_H
#include <shape.h>
#include <stdio.h>
class Triangle : public Shape
{
protected:
Intersect localIntersect(Ray r);
Tuple localNormalAt(Tuple point, Intersection *hit = nullptr);
public:
Tuple p1, p2, p3;
Tuple e1, e2;
Tuple normal;
public:
Triangle(Point p1, Point p2, Point p3);
BoundingBox getLocalBounds();
void dumpMe(FILE *fp);
};
#endif /* DORAYME_TRIANGLE_H */