-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshape.h
More file actions
30 lines (29 loc) · 793 Bytes
/
shape.h
File metadata and controls
30 lines (29 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include <vector>
#include "render.h"
class Shape
{
public:
virtual bool doesIntersect(std::vector<double> coords) = 0;
// virtual Color getColor(std::vector<double> coords) = 0;
private:
};
class Rectangle : public Shape
{
public:
bool doesIntersect(std::vector<double> coords);
Rectangle(std::vector<double> center, double width, double height, double length)
: center(center), width(width), height(height), length(length){};
std::vector<double> center;
double width;
double height;
double length;
};
class Sphere : public Shape
{
public:
bool doesIntersect(std::vector<double> coords);
Sphere(std::vector<double> center, double radius): center(center), radius(radius){};
std::vector<double> center;
double radius;
};