2 BobToolz plugin for GtkRadiant
3 Copyright (C) 2001 Gordon Biggans
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // DBrush.h: interface for the DBrush class.
22 //////////////////////////////////////////////////////////////////////
24 #if !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)
25 #define AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_
29 #endif // _MSC_VER > 1000
46 #define POINT_IN_BRUSH 0
47 #define POINT_ON_BRUSH 1
48 #define POINT_OUT_BRUSH 2
53 DPlane* AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const char* textureName, bool bDetail);
54 void SaveToFile(FILE* pFile);
56 void Rotate(vec3_t vOrigin, vec3_t vRotation);
57 void RotateAboutCentre(vec3_t vRotation);
59 DPlane* HasPlaneInverted(DPlane* chkPlane);
60 DPlane* HasPlane(DPlane* chkPlane);
61 DPlane* AddFace(const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData);
63 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 HasTexture(const char* textureName);
66 bool IntersectsWith(DBrush *chkBrush);
67 bool IntersectsWith(DPlane* p1, DPlane* p2, vec3_t v);
68 bool IsCutByPlane(DPlane* cuttingPlane);
69 bool GetBounds(vec3_t min, vec3_t max);
70 bool HasPoint(vec3_t pnt);
71 bool BBoxCollision(DBrush* chkBrush);
72 bool BBoxTouch(DBrush* chkBrush);
76 void BuildFromWinding(DWinding* w);
77 scene::Node* BuildInRadiant(bool allowDestruction, int* changeCnt, scene::Node* entity = NULL);
79 void ResetChecks(std::list<Str>* exclusionList);
84 int RemoveRedundantPlanes( void );
85 void RemovePlane( DPlane* plane );
86 int PointPosition(vec3_t pnt);
89 void CutByPlane(DPlane* cutPlane, DBrush** newBrush1, DBrush** newBrush2);
91 void LoadFromBrush(scene::Node& brush, bool textured);
92 void AddPoint(vec3_t pnt);
94 DPlane* FindPlaneWithClosestNormal( vec_t* normal );
95 int FindPointsForPlane( DPlane* plane, DPoint** pnts, int maxpnts );
100 bool operator== (DBrush* other);
103 scene::Node* QER_brush;
104 std::list<DPlane*> faceList;
105 std::list<DPoint*> pointList;
107 vec3_t bbox_min, bbox_max;
111 //typedef CList<DBrush*, DBrush*> DBrushList;
113 #endif // !defined(AFX_DBRUSH_H__35B2C522_F0A7_11D4_ACF7_004095A18133__INCLUDED_)