-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.h
More file actions
62 lines (46 loc) · 1.27 KB
/
Model.h
File metadata and controls
62 lines (46 loc) · 1.27 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include"OBJFVLib.h"
#include"SubModel.h"
#include<Windows.h>
#include<tchar.h>
#include<d3d12.h>
#include<dxgi1_6.h>
#include<DirectXMath.h>
#include<vector>
#include<map>
#include<d3dcompiler.h>
#include<DirectXTex.h>
#include<d3dx12.h>
#include<wrl.h>
#pragma comment(lib,"DirectXTex.lib")
#pragma comment(lib,"d3d12.lib")
#pragma comment(lib,"dxgi.lib")
#pragma comment(lib,"d3dcompiler.lib")
using namespace std;
using namespace DirectX;
class Model
{
public:
string _OBJFileName = "";
string _MTLFileName = "";
bool _isMTLExist;
Transform _transform;
SRTMatrices* _srt = nullptr;
int _subModelNum = 0;
vector<SubModel*> _subModels;
public:
string _name;
vector<Vertex> _vertices;
Microsoft::WRL::ComPtr<ID3D12Resource> _vertexBuffer = nullptr;
D3D12_VERTEX_BUFFER_VIEW _vertexBufferView = {};
unsigned int _materialNum = 0;
Microsoft::WRL::ComPtr<ID3D12DescriptorHeap> _heap = nullptr; // _basicBufferのViewを保持する
Microsoft::WRL::ComPtr<ID3D12Resource> _basicBuffer = nullptr; // モデルの座標、回転、拡大を保持
string _mtlPath;
Microsoft::WRL::ComPtr<ID3D12Resource> _materialBuffer = nullptr;
D3D12_CONSTANT_BUFFER_VIEW_DESC _cbvDesc = {};
Model(string fileName, bool exist);
~Model();
void Update();
void AddSubModel(SubModel* sm);
};