MCPcopy Index your code
hub / github.com/processing/processing / curveVertexSegment

Method curveVertexSegment

core/src/processing/core/PGraphics.java:2324–2351  ·  view source on GitHub ↗

Handle emitting a specific segment of Catmull-Rom curve. This can be overridden by subclasses that need more efficient rendering options.

(float x1, float y1,
                                    float x2, float y2,
                                    float x3, float y3,
                                    float x4, float y4)

Source from the content-addressed store, hash-verified

2322 * overridden by subclasses that need more efficient rendering options.
2323 */
2324 protected void curveVertexSegment(float x1, float y1,
2325 float x2, float y2,
2326 float x3, float y3,
2327 float x4, float y4) {
2328 float x0 = x2;
2329 float y0 = y2;
2330
2331 PMatrix3D draw = curveDrawMatrix;
2332
2333 float xplot1 = draw.m10*x1 + draw.m11*x2 + draw.m12*x3 + draw.m13*x4;
2334 float xplot2 = draw.m20*x1 + draw.m21*x2 + draw.m22*x3 + draw.m23*x4;
2335 float xplot3 = draw.m30*x1 + draw.m31*x2 + draw.m32*x3 + draw.m33*x4;
2336
2337 float yplot1 = draw.m10*y1 + draw.m11*y2 + draw.m12*y3 + draw.m13*y4;
2338 float yplot2 = draw.m20*y1 + draw.m21*y2 + draw.m22*y3 + draw.m23*y4;
2339 float yplot3 = draw.m30*y1 + draw.m31*y2 + draw.m32*y3 + draw.m33*y4;
2340
2341 // vertex() will reset splineVertexCount, so save it
2342 int savedCount = curveVertexCount;
2343
2344 vertex(x0, y0);
2345 for (int j = 0; j < curveDetail; j++) {
2346 x0 += xplot1; xplot1 += xplot2; xplot2 += xplot3;
2347 y0 += yplot1; yplot1 += yplot2; yplot2 += yplot3;
2348 vertex(x0, y0);
2349 }
2350 curveVertexCount = savedCount;
2351 }
2352
2353
2354 /**

Callers 1

curveVertexMethod · 0.95

Calls 1

vertexMethod · 0.95

Tested by

no test coverage detected