BRUSH.H 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1999-2005 Id Software, Inc.
  4. This file is part of Quake III Arena source code.
  5. Quake III Arena source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake III Arena source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Foobar; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. // brush.h
  19. // all types moved to qertypes.h
  20. //--typedef struct
  21. //--{
  22. //-- int numpoints;
  23. //-- int maxpoints;
  24. //-- float points[8][5]; // variable sized
  25. //--} winding_t;
  26. // the normals on planes point OUT of the brush
  27. //--#define MAXPOINTS 16
  28. //--typedef struct face_s
  29. //--{
  30. //-- struct face_s *next;
  31. //-- vec3_t planepts[3];
  32. //-- texdef_t texdef;
  33. //-- plane_t plane;
  34. //--
  35. //-- winding_t *face_winding;
  36. //--
  37. //-- vec3_t d_color;
  38. //-- qtexture_t *d_texture;
  39. //--
  40. //--} face_t;
  41. //--
  42. //--typedef struct {
  43. //-- vec3_t xyz;
  44. //-- float sideST[2];
  45. //-- float capST[2];
  46. //--} curveVertex_t;
  47. //--
  48. //--typedef struct {
  49. //-- curveVertex_t v[2];
  50. //--} sideVertex_t;
  51. //--
  52. //--typedef struct brush_s
  53. //--{
  54. //-- struct brush_s *prev, *next; // links in active/selected
  55. //-- struct brush_s *oprev, *onext; // links in entity
  56. //-- struct entity_s *owner;
  57. //-- vec3_t mins, maxs;
  58. //-- face_t *brush_faces;
  59. //--
  60. //-- qboolean bModelFailed;
  61. //-- //
  62. //-- // curve brush extensions
  63. //-- // all are derived from brush_faces
  64. //-- qboolean curveBrush;
  65. //-- qboolean patchBrush;
  66. //-- int nPatchID;
  67. //--} brush_t;
  68. void Brush_AddToList (brush_t *b, brush_t *list);
  69. void Brush_Build(brush_t *b, bool bSnap = true, bool bMarkMap = true, bool bConvert = false);
  70. void Brush_BuildWindings( brush_t *b, bool bSnap = true );
  71. brush_t* Brush_Clone (brush_t *b);
  72. brush_t* Brush_FullClone(brush_t *b);
  73. brush_t* Brush_Create (vec3_t mins, vec3_t maxs, texdef_t *texdef);
  74. void Brush_Draw( brush_t *b );
  75. void Brush_DrawXY(brush_t *b, int nViewType);
  76. // set bRemoveNode to false to avoid trying to delete the item in group view tree control
  77. void Brush_Free (brush_t *b, bool bRemoveNode = true);
  78. int Brush_MemorySize(brush_t *b);
  79. void Brush_MakeSided (int sides);
  80. void Brush_MakeSidedCone (int sides);
  81. void Brush_Move (brush_t *b, const vec3_t move, bool bSnap = true);
  82. int Brush_MoveVertex(brush_t *b, vec3_t vertex, vec3_t delta, vec3_t end, bool bSnap = true);
  83. void Brush_ResetFaceOriginals(brush_t *b);
  84. brush_t* Brush_Parse (void);
  85. face_t* Brush_Ray (vec3_t origin, vec3_t dir, brush_t *b, float *dist);
  86. void Brush_RemoveFromList (brush_t *b);
  87. void Brush_SplitBrushByFace (brush_t *in, face_t *f, brush_t **front, brush_t **back);
  88. void Brush_SelectFaceForDragging (brush_t *b, face_t *f, qboolean shear);
  89. void Brush_SetTexture (brush_t *b, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef=NULL );
  90. void Brush_SideSelect (brush_t *b, vec3_t origin, vec3_t dir, qboolean shear);
  91. void Brush_SnapToGrid(brush_t *pb);
  92. void Brush_Rotate(brush_t *b, vec3_t vAngle, vec3_t vOrigin, bool bBuild = true);
  93. void Brush_MakeSidedSphere(int sides);
  94. void Brush_Write (brush_t *b, FILE *f);
  95. void Brush_Write (brush_t *b, CMemFile* pMemFile);
  96. void Brush_RemoveEmptyFaces ( brush_t *b );
  97. winding_t* Brush_MakeFaceWinding (brush_t *b, face_t *face);
  98. int AddPlanept (float *f);
  99. float SetShadeForPlane (plane_t *p);
  100. face_t* Face_Alloc( void );
  101. void Face_Free( face_t *f );
  102. face_t* Face_Clone (face_t *f);
  103. void Face_MakePlane (face_t *f);
  104. void Face_Draw( face_t *face );
  105. void Face_TextureVectors (face_t *f, float STfromXYZ[2][4]);
  106. void SetFaceTexdef (brush_t *b, face_t *f, texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale = false, IPluginTexdef* pPlugTexdef = NULL );
  107. void Face_FitTexture( face_t * face, int nHeight, int nWidth );
  108. void Brush_FitTexture( brush_t *b, int nHeight, int nWidth );
  109. void Brush_SetEpair(brush_t *b, const char *pKey, const char *pValue);
  110. const char* Brush_GetKeyValue(brush_t *b, const char *pKey);
  111. brush_t *Brush_Alloc();
  112. const char* Brush_Name(brush_t *b);