Beispiel #1
0
void SelectFaceEdge (brush_t* b, face_t *f, int p1, int p2)
{
	winding_t	*w;
	int			i, j, k;
	int			pnum[128];

	w = Brush_MakeFaceWinding (b, f);
	if (!w)
		return;
	for (i=0 ; i<w->numpoints ; i++)
		pnum[i] = FindPoint (w->points[i]);

  for (i=0 ; i<w->numpoints ; i++)
		if (pnum[i] == p1 && pnum[(i+1)%w->numpoints] == p2)
		{
			VectorCopy (g_qeglobals.d_points[pnum[i]], f->planepts[0]);
			VectorCopy (g_qeglobals.d_points[pnum[(i+1)%w->numpoints]], f->planepts[1]);
			VectorCopy (g_qeglobals.d_points[pnum[(i+2)%w->numpoints]], f->planepts[2]);
			for (j=0 ; j<3 ; j++)
			{
				for (k=0 ; k<3 ; k++)
				{
					f->planepts[j][k] = floor(f->planepts[j][k]/g_qeglobals.d_gridsize+0.5)*g_qeglobals.d_gridsize;
				}
			}

			AddPlanept (f->planepts[0]);
			AddPlanept (f->planepts[1]);
			break;
		}

	if (i == w->numpoints)
		Sys_Printf ("SelectFaceEdge: failed\n");
	free (w);
}
Beispiel #2
0
void MakeFace (face_t *f)
#endif
{
	winding_t	*w;
	int			i;
	int			pnum[128];

#ifdef NEWEDGESEL
	w = Brush_MakeFaceWinding (b, f);
#else
	w = Brush_MakeFaceWinding (selected_brushes.next, f);
#endif
	if (!w)
		return;
	for (i=0 ; i<w->numpoints ; i++)
		pnum[i] = FindPoint (w->points[i]);
	for (i=0 ; i<w->numpoints ; i++)
		FindEdge (pnum[i], pnum[(i+1)%w->numpoints], f);

	free (w);
}
Beispiel #3
0
void SelectFaceEdge (face_t * f, int p1, int p2)
#endif 
{
	idWinding	*w;
	int			i, j, k;
	int			pnum[128];

#ifdef NEWEDGESEL
	w = Brush_MakeFaceWinding(b, f);
#else
	w = Brush_MakeFaceWinding(selected_brushes.next, f);
#endif
	if (!w) {
		return;
	}
	for (i = 0; i < w->GetNumPoints(); i++) {
		pnum[i] = FindPoint( (*w)[i].ToVec3() );
	}
	for (i = 0; i < w->GetNumPoints(); i++) {
		if (pnum[i] == p1 && pnum[(i + 1) % w->GetNumPoints()] == p2) {
			VectorCopy(g_qeglobals.d_points[pnum[i]], f->planepts[0]);
			VectorCopy(g_qeglobals.d_points[pnum[(i + 1) % w->GetNumPoints()]], f->planepts[1]);
			VectorCopy(g_qeglobals.d_points[pnum[(i + 2) % w->GetNumPoints()]], f->planepts[2]);
			for (j = 0; j < 3; j++) {
				for (k = 0; k < 3; k++) {
					f->planepts[j][k] =
					floor(f->planepts[j][k] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
				}
			}
			AddPlanept(&f->planepts[0]);
			AddPlanept(&f->planepts[1]);
			break;
		}
	}
	if ( i == w->GetNumPoints() ) {
		Sys_Status("SelectFaceEdge: failed\n");
	}
	delete w;
}
Beispiel #4
0
void MakeFace (face_t * f)
#endif 
{
	idWinding	*w;
	int			i;
	int			pnum[128];

#ifdef NEWEDGESEL
	w = Brush_MakeFaceWinding(b, f);
#else
	w = Brush_MakeFaceWinding(selected_brushes.next, f);
#endif
	if (!w) {
		return;
	}
	for (i = 0; i < w->GetNumPoints(); i++) {
		pnum[i] = FindPoint( (*w)[i].ToVec3() );
	}
	for (i = 0; i < w->GetNumPoints(); i++) {
		FindEdge(pnum[i], pnum[(i + 1) % w->GetNumPoints()], f);
	}
	delete w;
}
Beispiel #5
0
void MakeFace (brush_t* b, face_t *f)
{
	winding_t	*w;
	int			i;
	int			pnum[128];

	w = Brush_MakeFaceWinding (b, f);
	if (!w)
		return;
	for (i=0 ; i<w->numpoints ; i++)
		pnum[i] = FindPoint (w->points[i]);
	for (i=0 ; i<w->numpoints ; i++)
		FindEdge (pnum[i], pnum[(i+1)%w->numpoints], f);

	free (w);
}
Beispiel #6
0
void SelectVertex (int p1)
{
	brush_t		*b;
	winding_t	*w;
	int			i, j, k;
	face_t		*f;

	for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
  {
	  for (f=b->brush_faces ; f ; f=f->next)
	  {
		  w =  Brush_MakeFaceWinding (b, f);
		  if (!w)
			  continue;
		  for (i=0 ; i<w->numpoints ; i++)
		  {
			  if (FindPoint (w->points[i]) == p1)
			  {
				  VectorCopy (w->points[(i+w->numpoints-1)%w->numpoints], f->planepts[0]);
				  VectorCopy (w->points[i], f->planepts[1]);
				  VectorCopy (w->points[(i+1)%w->numpoints], f->planepts[2]);
			    for (j=0 ; j<3 ; j++)
          {
				    for (k=0 ; k<3 ; k++)
            {
					    ;//f->planepts[j][k] = floor(f->planepts[j][k]/g_qeglobals.d_gridsize+0.5)*g_qeglobals.d_gridsize;
            } 
          }

			    AddPlanept (f->planepts[1]);
          //MessageBeep(-1);

			    break;
        }
		  }
		  free (w);
	  }
  }
}
Beispiel #7
0
/*
 =======================================================================================================================
 =======================================================================================================================
 */
void SelectVertex(int p1) {
	brush_t		*b;
	idWinding	*w;
	int			i, j, k;
	face_t		*f;

#ifdef NEWEDGESEL
	for (b = selected_brushes.next; b != &selected_brushes; b = b->next) {
		for (f = b->brush_faces; f; f = f->next) {
			w = Brush_MakeFaceWinding(b, f);
			if (!w) {
				continue;
			}

			for (i = 0; i < w->GetNumPoints(); i++) {
				if ( FindPoint( (*w)[i].ToVec3() ) == p1 ) {
					VectorCopy((*w)[(i + w->GetNumPoints() - 1) % w->GetNumPoints()], f->planepts[0]);
					VectorCopy((*w)[i], f->planepts[1]);
					VectorCopy((*w)[(i + 1) % w->GetNumPoints()], f->planepts[2]);
					for (j = 0; j < 3; j++) {
						for (k = 0; k < 3; k++) {
							// f->planepts[j][k] = floor(f->planepts[j][k]/g_qeglobals.d_gridsize+0.5)*g_qeglobals.d_gridsize;
						}
					}

					AddPlanept(&f->planepts[1]);

					// MessageBeep(-1);
					break;
				}
			}

			delete w;
		}
	}

#else
	b = selected_brushes.next;
	for (f = b->brush_faces; f; f = f->next) {
		w = Brush_MakeFaceWinding(b, f);
		if (!w) {
			continue;
		}

		for (i = 0; i < w->GetNumPoints(); i++) {
			if (FindPoint(w[i]) == p1) {
				VectorCopy(w[(i + w->GetNumPoints() - 1) % w->GetNumPoints()], f->planepts[0]);
				VectorCopy(w[i], f->planepts[1]);
				VectorCopy(w[(i + 1) % w->GetNumPoints()], f->planepts[2]);
				for (j = 0; j < 3; j++) {
					for (k = 0; k < 3; k++) {
						// f->planepts[j][k] = floor(f->planepts[j][k]/g_qeglobals.d_gridsize+0.5)*g_qeglobals.d_gridsize;
					}
				}

				AddPlanept(&f->planepts[1]);

				// MessageBeep(-1);
				break;
			}
		}

		delete w;
	}
#endif
}