-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMDLModel.h
85 lines (57 loc) · 2.12 KB
/
MDLModel.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef _MDLMODEL_H_
#define _MDLMODEL_H_
#include <windows.h>
#include "MdlFormat.h"
class TMDLModel
{
// protected:
public:
vec3_t Origin; // Origin
vec3_t Rotation; // Rotation
long CurrentSequence; // Current sequence
float CurrentFrame; // Current frame
long CurrentBodyPart; // Current body part
long CurrentSkin; // Current skin
BYTE Controller[4]; // Controllers
BYTE Blending[2]; // Animation blending
BYTE MouthPosition; // Mouth position
tagMDLHeader *Header; // Model header
tagMDLModel *Model; // Model
tagMDLHeader *TextureHeader; // Texture
tagMDLSeqHeader *AnimationHeader[32]; // Animation header
public:
void Init(char *Filename); //
void DrawModel(); //
void AdvanceFrame(float Time); //
long SetSequence(long Sequence);//
//нӿÚ
void AdvanceFrame2(); //
protected:
void ExtractBoundBox(float *Minimums, float *Maximums);
long GetSequence();
void GetSequenceInfo(float *FrameRate, float *GroundSpeed);
float SetController(long ControllerIndex, float Value);
float SetMouth(float Value);
float SetBlending(long Blender, float Value);
long SetBodyGroup(long Group, long Value);
long SetSkin(long Value);
/////////////////////////////////////////////////////////////////////////////////////
// protected:
tagMDLHeader *LoadModel(char *Filename);
tagMDLSeqHeader *LoadDemandSequences(char *Filename);
void CalcBoneQuaternion(long Frame, float Value, tagMDLBone *Bone, tagAnimation *Anim,
float *Q);
void CalcBonePosition(long Frame, float Value, tagMDLBone *Bone, tagAnimation *Anim,
float *Pos);
void CalcRotations (vec3_t *Pos, vec4_t *Q, tagMDLSeqDescription *SeqDescription,
tagAnimation *Anim, float FrameValue);
tagAnimation *GetAnim(tagMDLSeqDescription *SeqDescription);
void SlerpBones(vec4_t Q1[], vec3_t Pos1[], vec4_t Q2[], vec3_t Pos2[], float Value);
void SetUpBones();
void DrawPoints();
void Lighting(float *lv, long Bone, long Flags, vec3_t Normal);
void SetupLighting();
void SetupModel(long BodyPart);
void UploadTexture(tagMDLTexture *Texture, BYTE *Data, BYTE *Palette);
};
#endif