/
noire-dev
/
SourceTech
Обзор
Документация
Войти
/
noire-dev
/
SourceTech
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
sourcetech
code/qcommon/cm_patch.h
63 строки
2 KB
Noire.dev
sourcetech 1.7
17 май 2025, 21:24
17 май 2025, 21:24
05da339
Код
Авторство
О чём код?
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code 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. Quake III Arena source code 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 Quake III Arena source code; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ #define MAX_FACETS 1024 #define MAX_PATCH_PLANES (2048+128) typedef struct { float plane[4]; int signbits; // signx + (signy<<1) + (signz<<2), used as lookup during collision } patchPlane_t; typedef struct { int surfacePlane; int numBorders; // 3 or four + 6 axial bevels + 4 or 3 * 4 edge bevels int borderPlanes[4+6+16]; int borderInward[4+6+16]; qboolean borderNoAdjust[4+6+16]; } facet_t; typedef struct patchCollide_s { vec3_t bounds[2]; int numPlanes; // surface planes plus edge planes patchPlane_t *planes; int numFacets; facet_t *facets; } patchCollide_t; #define MAX_GRID_SIZE 129 typedef struct { int width; int height; qboolean wrapWidth; qboolean wrapHeight; vec3_t points[MAX_GRID_SIZE][MAX_GRID_SIZE]; // [width][height] } cGrid_t; #define SUBDIVIDE_DISTANCE 16 //4 // never more than this units away from curve #define PLANE_TRI_EPSILON 0.1 #define WRAP_POINT_EPSILON 0.1 struct patchCollide_s *CM_GeneratePatchCollide( int width, int height, vec3_t *points );