-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtransform.h
executable file
·68 lines (52 loc) · 1.42 KB
/
transform.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
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
/******************************************************
g-Matrix3D Neo Engine
Copyright (c)2003 Kim Seong Wan (kaswan, Â𻧱ͽÅ)
E-mail: [email protected]
http://www.g-matrix.pe.kr
*******************************************************/
#ifndef TRANSFORM_H
#define TRANSFORM_H
#include "matrix.h"
typedef enum _MATRIXMODETYPE {
MM_WORLD = 0,
MM_VIEW = 1,
MM_PROJECT = 2,
MM_VIEWPORT = 3,
MM_FORCE_DWORD = 0x7fffffff
}MATRIXMODETYPE;
//#define PI 3.1415926535f
class CTransform {
MATRIXMODETYPE CurrentMode;
Matrix4 WorldTM;
Matrix4 ViewTM;
Matrix4 ProjectTM;
Matrix4 ViewportTM;
Matrix4 TM[4];
Matrix3 NormalTM;
Matrix4 WorldViewTM;
Matrix4 WorldViewProjectTM;
friend class CRenBuffer;
public:
void LoadMatrix(const Matrix4 & M)
{
TM[CurrentMode] = M;
}
void SetMatrixMode(const MATRIXMODETYPE i)
{
CurrentMode = i;
}
void RotateX(float theta);
void RotateY(float theta);
void RotateZ(float theta);
void Scale(float x, float y, float z);
void Translate(float x, float y, float z);
void LoadIndentity(void);
void SimplePerspective(void);
void Perspective(float width, float height, float nearz, float farz);
void PerspectiveFOVW(float fovw, float aspectw, float nearz, float farz);
void PerspectiveFOVH(float fovh, float aspecth, float nearz, float farz);
void SetTransform(void);
//private:
// void CalcNormalTM(void){};
};
#endif