forked from microsoft/Xbox-GDK-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDolphin.h
More file actions
59 lines (45 loc) · 2.21 KB
/
Copy pathDolphin.h
File metadata and controls
59 lines (45 loc) · 2.21 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
//--------------------------------------------------------------------------------------
// Dolphin.h
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#pragma once
#include "DeviceResources.h"
class Dolphin
{
public:
Dolphin();
void Load(ID3D12Device *device, DirectX::RenderTargetState rtState, unsigned int backbufferCount);
void Update(float totalTime, float elapsedTime);
ATG::VS_CONSTANT_BUFFER* MapVSConstants(unsigned int bufferIndex);
void UnmapAndSetVSConstants(
ID3D12GraphicsCommandList* commandList,
unsigned int bufferIndex,
bool wireframe,
ID3D12DescriptorHeap *Heap,
D3D12_GPU_DESCRIPTOR_HANDLE dolphinResourceView,
D3D12_GPU_DESCRIPTOR_HANDLE causticResourceView);
void Render(ID3D12GraphicsCommandList * commandList);
void Translate(DirectX::XMVECTOR t);
DirectX::XMMATRIX GetWorld();
float GetBlendWeight();
private:
DirectX::SimpleMath::Vector3 m_translation;
DirectX::SimpleMath::Matrix m_world;
float m_animationTime;
float m_blendWeight;
D3D12_PRIMITIVE_TOPOLOGY m_primitiveType;
unsigned int m_indexCount;
Microsoft::WRL::ComPtr<ID3D12RootSignature> m_rootSignature;
Microsoft::WRL::ComPtr<ID3D12PipelineState> m_pipelineState;
Microsoft::WRL::ComPtr<ID3D12PipelineState> m_pipelineStateWireframe;
D3D12_VERTEX_BUFFER_VIEW m_vertexBufferView[3];
D3D12_INDEX_BUFFER_VIEW m_indexBufferView;
Microsoft::WRL::ComPtr<ID3D12Resource> m_VSConstants;
ATG::VS_CONSTANT_BUFFER* m_mappedVSConstantData;
D3D12_GPU_VIRTUAL_ADDRESS m_VSConstantDataGpuAddr;
std::unique_ptr<DirectX::Model> m_dolphinModel1;
std::unique_ptr<DirectX::Model> m_dolphinModel2;
std::unique_ptr<DirectX::Model> m_dolphinModel3;
};