-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.h
More file actions
49 lines (39 loc) · 2.23 KB
/
Copy pathpatch.h
File metadata and controls
49 lines (39 loc) · 2.23 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
#ifndef PATCH_H
#define PATCH_H
//############################################################################
//## ##
//## PATCH.H ##
//## ##
//## Converts a Quake3 Bezier patch into a hard coded polygon mesh. ##
//## ##
//## OpenSourced 12/5/2000 by John W. Ratcliff ##
//## ##
//## No warranty expressed or implied. ##
//## ##
//## Part of the Q3BSP project, which converts a Quake 3 BSP file into a ##
//## polygon mesh. ##
//############################################################################
//## ##
//## Contact John W. Ratcliff at [email protected] ##
//############################################################################
#include "vformat.h"
class PatchSurface
{
public:
PatchSurface(const LightMapVertex *control_points,int npoints,int controlx,int controly);
~PatchSurface(void);
const LightMapVertex * GetVerts(void) const { return mPoints; };
const unsigned short * GetIndices(void) const { return mIndices; };
int GetIndiceCount(void) const { return mCount; };
private:
bool FindSize(int controlx,int controly,const LightMapVertex *cp,int &sizex,int &sizey) const;
void FillPatch(int controlx,int controly,int sizex,int sizey,LightMapVertex *points);
void FillCurve(int numcp, int size, int stride,LightMapVertex *p);
int FindLevel(const Vector3d<float> &cv0,
const Vector3d<float> &cv1,
const Vector3d<float> &cv2) const;
int mCount;
LightMapVertex *mPoints; // vertices produced.
unsigned short *mIndices; // indices into those vertices
};
#endif