-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.h
36 lines (32 loc) · 1.16 KB
/
Model.h
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
#pragma once
#include "Mesh.h"
#include "MeshCache.h"
class Model {
public:
Model() {};
Model(std::wstring obj_path, std::wstring texture_path, XMFLOAT3 position, XMFLOAT4 rotation, bool solid);
bool LoadResources(ComPtr<ID3D12Device>&, ComPtr<ID3D12GraphicsCommandList>&,
ComPtr<ID3D12CommandAllocator>& command_allocator);
bool PopulateCommandList(ComPtr<ID3D12GraphicsCommandList>& command_list, UINT8* constant_buffer_gpu_address,
D3D12_GPU_VIRTUAL_ADDRESS constant_buffer_upload_heap);
void Update(float delta);
void Release();
void Unload();
bool Intersects(BoundingVolume& camera, XMFLOAT3& resolution);
bool CheckCull(BoundingVolume*& frustum);
XMFLOAT3 getPosition();
void setPosition(XMFLOAT3 pos);
Mesh* GetMesh();
void SetCull(bool cull, ComPtr<ID3D12GraphicsCommandList>& command_list,
ComPtr<ID3D12CommandAllocator>& command_allocator);
boolean m_reload_ = false;
private:
boolean m_is_culled_;
Mesh* m_mesh_;
ConstantBuffer m_constant_buffer_;
XMFLOAT3 m_position_;
XMFLOAT4 m_rotation_;
bool m_solid_;
std::wstring m_obj_path_;
std::wstring m_texture_path_;
};