| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#if !defined( AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_ ) |
| 25 |
#define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_ |
| 26 |
|
| 27 |
#if _MSC_VER > 1000 |
| 28 |
#pragma once |
| 29 |
#endif |
| 30 |
|
| 31 |
#include <stdio.h> |
| 32 |
#include <list> |
| 33 |
#include "mathlib.h" |
| 34 |
#include "str.h" |
| 35 |
|
| 36 |
class DPlane; |
| 37 |
class DWinding; |
| 38 |
class DPoint; |
| 39 |
class _QERFaceData; |
| 40 |
|
| 41 |
namespace scene |
| 42 |
{ |
| 43 |
class Node; |
| 44 |
class Instance; |
| 45 |
} |
| 46 |
|
| 47 |
const int POINT_IN_BRUSH = 0; |
| 48 |
const int POINT_ON_BRUSH = 1; |
| 49 |
const int POINT_OUT_BRUSH = 2; |
| 50 |
|
| 51 |
class DBrush |
| 52 |
{ |
| 53 |
public: |
| 54 |
DPlane* AddFace( const vec3_t va, const vec3_t vb, const vec3_t vc, const char* textureName, bool bDetail ); |
| 55 |
void SaveToFile( FILE* pFile ); |
| 56 |
|
| 57 |
void Rotate( vec3_t vOrigin, vec3_t vRotation ); |
| 58 |
void RotateAboutCentre( vec3_t vRotation ); |
| 59 |
|
| 60 |
DPlane* HasPlaneInverted( DPlane* chkPlane ); |
| 61 |
DPlane* HasPlane( DPlane* chkPlane ); |
| 62 |
DPlane* AddFace( const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData ); |
| 63 |
|
| 64 |
bool ResetTextures( const char* textureName, float fScale[2], float fShift[2], int rotation, const char* newTextureName, int bResetTextureName, int bResetScale[2], int bResetShift[2], int bResetRotation ); |
| 65 |
bool IsDetail(); |
| 66 |
bool HasTexture( const char* textureName ); |
| 67 |
bool IntersectsWith( DBrush *chkBrush ); |
| 68 |
bool IntersectsWith( DPlane* p1, DPlane* p2, vec3_t v ); |
| 69 |
bool IsCutByPlane( DPlane* cuttingPlane ); |
| 70 |
bool GetBounds( vec3_t min, vec3_t max ); |
| 71 |
bool HasPoint( vec3_t pnt ); |
| 72 |
bool BBoxCollision( DBrush* chkBrush ); |
| 73 |
bool BBoxTouch( DBrush* chkBrush ); |
| 74 |
|
| 75 |
int BuildPoints(); |
| 76 |
void BuildBounds(); |
| 77 |
void BuildFromWinding( DWinding* w ); |
| 78 |
scene::Node* BuildInRadiant( bool allowDestruction, int* changeCnt, scene::Node* entity = NULL ); |
| 79 |
|
| 80 |
void ResetChecks( std::list<Str>* exclusionList ); |
| 81 |
|
| 82 |
void ClearFaces(); |
| 83 |
void ClearPoints(); |
| 84 |
|
| 85 |
int RemoveRedundantPlanes( void ); |
| 86 |
void RemovePlane( DPlane* plane ); |
| 87 |
int PointPosition( vec3_t pnt ); |
| 88 |
|
| 89 |
|
| 90 |
void CutByPlane( DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2 ); |
| 91 |
|
| 92 |
void LoadFromBrush( scene::Instance& brush, bool textured ); |
| 93 |
void AddPoint( vec3_t pnt ); |
| 94 |
|
| 95 |
DPlane* FindPlaneWithClosestNormal( vec_t* normal ); |
| 96 |
int FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts ); |
| 97 |
|
| 98 |
DBrush( int ID = -1 ); |
| 99 |
virtual ~DBrush(); |
| 100 |
|
| 101 |
bool operator==( DBrush* other ); |
| 102 |
|
| 103 |
|
| 104 |
scene::Node* QER_entity; |
| 105 |
scene::Node* QER_brush; |
| 106 |
std::list<DPlane*> faceList; |
| 107 |
std::list<DPoint*> pointList; |
| 108 |
int m_nBrushID; |
| 109 |
vec3_t bbox_min, bbox_max; |
| 110 |
bool bBoundsBuilt; |
| 111 |
}; |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
#endif |