-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWavefrontIndexedTriangleList.h
More file actions
47 lines (40 loc) · 1.02 KB
/
Copy pathWavefrontIndexedTriangleList.h
File metadata and controls
47 lines (40 loc) · 1.02 KB
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
40
41
42
43
44
45
46
47
#pragma once
#include "PathTracer.h"
class WavefrontIndexedTriangleList : public Geometry
{
public:
struct Material
{
glm::vec3 diffuse;
glm::vec3 specular;
glm::vec3 emission;
float shininess;
int texId_diffuse;
int texId_specular;
int texId_emission;
int texId_bumpmap;
int texId_mask;
int mask; // bit 0 : has diffuse, bit 1: has specular, bit 2: has emission
};
struct Index
{
int vertex_index;
int normal_index;
int texcoord_index;
};
WavefrontIndexedTriangleList(const glm::mat4x4& model,
const std::vector<glm::vec3>& positions,
const std::vector<glm::vec3>& normals,
const std::vector<glm::vec2>& texcoords,
const std::vector<Index>& indices,
std::vector<Material>& materials, const int* materialIdx);
virtual ~WavefrontIndexedTriangleList();
virtual GeoCls cls() const;
virtual void get_view(void* view_buf) const;
private:
DeviceBuffer* m_normalBuffer;
DeviceBuffer* m_texcoordBuffer;
DeviceBuffer* m_indexBuffer;
DeviceBuffer* m_materialBuffer;
DeviceBuffer* m_faceBuffer;
};