]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - curves.h
optimized surface rendering to surface->groupmesh->data_* array pointers directly...
[xonotic/darkplaces.git] / curves.h
index 8924c4a5fda9956734b38a4019784d0f4ede44c3..af9ba15044c8c09babb08aed7d1f0d18428a26fe 100644 (file)
--- a/curves.h
+++ b/curves.h
@@ -2,13 +2,19 @@
 #ifndef CURVES_H
 #define CURVES_H
 
-void QuadraticBSplineSubdivideFloat(int inpoints, int components, const float *in, int instride, float *out, int outstride);
-void QuadraticBSplinePatchSubdivideFloatBuffer(int cpwidth, int cpheight, int xlevel, int ylevel, int components, const float *in, float *out);
-float QuadraticBSplinePatchLargestDeviationOnX(int cpwidth, int cpheight, int components, const float *in);
-float QuadraticBSplinePatchLargestDeviationOnY(int cpwidth, int cpheight, int components, const float *in);
-int QuadraticBSplinePatchSubdivisionLevelForDeviation(float deviation, float level1tolerance, int levellimit);
-int QuadraticBSplinePatchSubdivisionLevelOnX(int cpwidth, int cpheight, int components, const float *in, float level1tolerance, int levellimit);
-int QuadraticBSplinePatchSubdivisionLevelOnY(int cpwidth, int cpheight, int components, const float *in, float level1tolerance, int levellimit);
+// 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, int firstvertex);
 
 #endif