X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=curves.h;h=6555a5a01ed86292bca9eb7c95d40adc249456fe;hb=9bb5afc90d6cfc8afe492068aae3f8612319b6f4;hp=af9ba15044c8c09babb08aed7d1f0d18428a26fe;hpb=e40a37e7e99114e259dffe2e36416f0c238a6b40;p=xonotic%2Fdarkplaces.git diff --git a/curves.h b/curves.h index af9ba150..6555a5a0 100644 --- a/curves.h +++ b/curves.h @@ -2,6 +2,23 @@ #ifndef CURVES_H #define CURVES_H +#define PATCH_LODS_NUM 2 +#define PATCH_LOD_COLLISION 0 +#define PATCH_LOD_VISUAL 1 + +typedef struct patchinfo_s +{ + int xsize, ysize; + struct { + int xtess, ytess; + } lods[PATCH_LODS_NUM]; +} patchinfo_t; + +// Calculate number of resulting vertex rows/columns by given patch size and tesselation factor +// When tess=0 it means that we reduce detalization of base 3x3 patches by removing middle row and column +// "DimForTess" is "DIMension FOR TESSelation factor" +int Q3PatchDimForTess(int size, int tess); + // usage: // to expand a 5x5 patch to 21x21 vertices (4x4 tesselation), one might use this call: // Q3PatchSubdivideFloat(3, sizeof(float[3]), outvertices, 5, 5, sizeof(float[3]), patchvertices, 4, 4); @@ -16,5 +33,7 @@ int Q3PatchTesselationOnY(int patchwidth, int patchheight, int components, const // (width-1)*(height-1)*2 triangles, 3 elements each) void Q3PatchTriangleElements(int *elements, int width, int height, int firstvertex); +int Q3PatchAdjustTesselation(int numcomponents, patchinfo_t *patch1, float *patchvertices1, patchinfo_t *patch2, float *patchvertices2); + #endif