-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsphere.h
More file actions
31 lines (27 loc) · 849 Bytes
/
Copy pathsphere.h
File metadata and controls
31 lines (27 loc) · 849 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
#include "Vec3.h"
#include "ray.h"
#include "material.h"
#include "quaternion.h"
#include <utility>
#pragma once
#define EPSILON 0.00001
struct RayIntersectResult {
bool hit;
float t;
float u;
float v;
};
class Sphere {
private:
Vec3 Pos;
Material material;
public:
__host__ __device__ Sphere(Vec3 Pos, Material material = Material(Color3(200,200,200)));
__host__ __device__ RayIntersectResult rayIntersect(Ray ray);
__host__ __device__ const Vec3 getNorm() const;
__host__ __device__ void setColor(uint8_t r, uint8_t g, uint8_t b);
__host__ __device__ void setColor(Color3 color);
__host__ __device__ const Color3& getColor() const;
__host__ __device__ const Material& getMaterial() const;
__host__ __device__ void updatePos(Vec3& Diff);
};