X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=curves.h;h=48d01219799907cd200794d94418fcfaa8c1c4f4;hb=71c88e4a876a4cfcccf312e3cd4ddbb1ced6d11f;hp=72567dd3ad86396601f194573b7373321e895604;hpb=1c62b35652c52a3fc8f469306c2521bb7502dd7f;p=xonotic%2Fdarkplaces.git diff --git a/curves.h b/curves.h index 72567dd3..48d01219 100644 --- a/curves.h +++ b/curves.h @@ -2,8 +2,19 @@ #ifndef CURVES_H #define CURVES_H -void QuadraticSplineSubdivideFloat(int inpoints, int components, const float *in, int instride, float *out, int outstride); -void QuadraticSplinePatchSubdivideFloatBuffer(int cpwidth, int cpheight, int xlevel, int ylevel, int components, const float *in, float *out); +// 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); +void Q3PatchTesselateFloat(int numcomponents, int outputstride, float *outputvertices, int patchwidth, int patchheight, int inputstride, float *patchvertices, int tesselationwidth, int tesselationheight); +// returns how much tesselation of each segment is needed to remain under tolerance +int Q3PatchTesselationOnX(int patchwidth, int patchheight, int components, const float *in, float tolerance); +// returns how much tesselation of each segment is needed to remain under tolerance +int Q3PatchTesselationOnY(int patchwidth, int patchheight, int components, const float *in, float tolerance); +// calculates elements for a grid of vertices +// (such as those produced by Q3PatchTesselate) +// (note: width and height are the actual vertex size, this produces +// (width-1)*(height-1)*2 triangles, 3 elements each) +void Q3PatchTriangleElements(int *elements, int width, int height); #endif