-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.h
More file actions
39 lines (27 loc) · 679 Bytes
/
Node.h
File metadata and controls
39 lines (27 loc) · 679 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
31
32
33
34
35
36
37
38
39
#pragma once
#include <glm/glm.hpp>
namespace Raymarch {
class Node {
public:
virtual float SDF(const glm::vec3& point) const = 0;
};
class Sphera : public Node {
public:
Sphera() = default;
Sphera(double r, glm::vec3 center);
virtual float SDF(const glm::vec3& point) const override final;
void setCenter(glm::vec3 center);
void setRadius(double r);
private:
double r = 1;
glm::vec3 center = glm::vec3(0.0f, 0.0f, 3.0f);
};
class Plane : public Node {
public:
Plane() = default;
virtual float SDF(const glm::vec3& point) const override final;
private:
glm::vec3 normal = glm::vec3(0, 1, 0);
float distance = 1.0;
};
};