-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtriangle.h
More file actions
27 lines (24 loc) · 947 Bytes
/
Copy pathtriangle.h
File metadata and controls
27 lines (24 loc) · 947 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
#include "Vec3.h"
#include "ray.h"
#include "material.h"
#include "quaternion.h"
#include <utility>
#pragma once
class Triangle {
private:
__host__ __device__ Vec3 calcNorm() const;
public:
Vec3 p1,p2,p3;
Vec3 norm;
Material material;
__host__ __device__ Triangle(Vec3 p1,Vec3 p2,Vec3 p3, Material material = Material(Vec3(200,200,200)));
__host__ __device__ Triangle(Vec3 p1,Vec3 p2,Vec3 p3,Vec3 norm, Material material = Material(Vec3(200,200,200)));
__host__ __device__ const Material& getMaterial() const;
__host__ __device__ float getMinX() const;
__host__ __device__ float getMinY() const;
__host__ __device__ float getMinZ() const;
__host__ __device__ float getMaxX() const;
__host__ __device__ float getMaxY() const;
__host__ __device__ float getMaxZ() const;
__host__ __device__ Vec3 getCentroid() const;
};