quakeforge/tools/qfbsp/include/csg4.h

92 lines
2.6 KiB
C
Raw Normal View History

/*
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
See file, 'COPYING', for details.
*/
#ifndef qfbsp_csg4_h
#define qfbsp_csg4_h
#include "QF/bspfile.h"
#include "QF/darray.h"
/** \defgroup qfbsp_csg4 CSG Functions
\ingroup qfbsp
*/
2020-02-11 06:20:49 +00:00
///@{
struct plane_s;
struct visfacet_s;
struct brushset_s;
struct surface_s;
typedef struct DARRAY_TYPE (struct visfacet_s *) visfacetset_t;
extern visfacetset_t validfaces;
2010-08-29 09:31:04 +00:00
/** Build the surface lists for the brushset.
Each plane still with faces after clipping will have one surface, and
each surface will list the faces on that plane.
\return Chain of all the external surfaces with one or more
visible faces.
*/
struct surface_s *BuildSurfaces (void);
2010-08-29 09:31:04 +00:00
/** Create a duplicate face.
Duplicates the non point information of a face.
\param in The face to duplicate.
\return The new face.
*/
2010-08-29 11:34:59 +00:00
struct visfacet_s *NewFaceFromFace (const struct visfacet_s *in);
2010-08-29 09:31:04 +00:00
/** Convert a brush-set to a list of clipped faces.
The brushes of the brush set will be clipped against each other.
\param bs The brush-set to convert.
\return list of surfaces containing all of the faces
*/
struct surface_s *CSGFaces (struct brushset_s *bs);
2010-08-29 09:31:04 +00:00
/** Split a face by a plane.
\param in The face to split.
\param split The plane by which to split the face.
\param front Set to the new face repesenting the part of the input
face that is in front of the plane, or NULL if there is
no front portion.
\param back Set to the new face repesenting the part of the input
face that is behind the plane, or NULL if there is
no back portion.
\note A face entirely on the plane is considered to be behind the plane.
\note The face represented by \a in becomes invalid. If either \a front
or \a back is NULL, then no split has occurred and the other will be set
to \a in.
*/
void SplitFace (struct visfacet_s *in, struct plane_s *split,
struct visfacet_s **front, struct visfacet_s **back);
2020-02-11 06:20:49 +00:00
///@}
#endif//qfbsp_csg4_h