-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeometryClass.h
More file actions
83 lines (65 loc) · 1.75 KB
/
Copy pathGeometryClass.h
File metadata and controls
83 lines (65 loc) · 1.75 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include <d3d11.h>
#include <directxmath.h>
using namespace DirectX;
#include <vector>
using namespace std;
#include "modelclass.h"
#include "colourshaderclass.h"
#include "lightclass.h"
#define COLOUR_RED {1.f, 0.f, 0.f, 1.f}
#define COLOUR_GREEN {0.f, 1.f, 0.f, 1.f}
#define COLOUR_BLUE {0.f, 0.f, 1.f, 0.5f}
#define COLOUR_CYAN {0.f, 1.f, 1.f, 1.f}
#define COLOUR_YELLOW {1.f, 1.f, 0.f, 1.f}
#define COLOUR_WHITE {1.f, 1.f, 1.f, 1.f}
#define COLOUR_PURPLE {1.f, 0.f, 1.f, 1.f}
#define COLOUR_ORANGE {1.f, .6f, 0.f, 1.f}
#define COLOUR_BONE {1.f, .94f, 0.81f, 1.f}
#define COLOUR_BONE_TRANS {1.f, .94f, 0.81f, 0.05f}
struct primitiveType
{
XMMATRIX position;
bool visible;
float alpha;
XMFLOAT4 colour;
//colour
};
struct lineType
{
XMFLOAT3 p1;
XMFLOAT3 p2;
float length;
XMFLOAT4 colour;
bool visible;
};
struct rectType
{
XMFLOAT3 centre;
XMFLOAT3 dir;
XMFLOAT3 up;
float width;
float height;
XMFLOAT4 colour;
};
class GeometryClass
{
public:
GeometryClass();
virtual ~GeometryClass();
void Initialise(ID3D11Device * device, ID3D11DeviceContext * deviceContext);
void Render(ID3D11DeviceContext * deviceContext, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ColorShaderClass * shader, LightClass * light);
void AddSphere(XMFLOAT3 pos, float scale, XMFLOAT4 c);
void AddLine(XMFLOAT3 pnt1, XMFLOAT3 pnt2, XMFLOAT4 c);
void ClearAll();
private:
int numSpheres;
int numLines;
int numPlanes;
vector<primitiveType> spheres;
vector<lineType> lines;
ID3D11Buffer *m_vertexBufferSphere, *m_indexBufferSphere; //model data for the sphere model
ID3D11Buffer *m_vertexBufferLine, *m_indexBufferLine;
ModelClass* model_Sphere;
ModelClass* model_Line;
};