MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / e_quad

Method e_quad

src/main/java/field/graphics/MeshBuilder.java:515–541  ·  view source on GitHub ↗

Adds two triangles that mark out the quad v1,v2,v3,v4. Specifically v1,v2,v3 and v1,v3,v4. (vertex numbers are backwards from the current vertex, so vertex 0 is the most recent call to v, 1 is the vertex before that and so on)

(int v1, int v2, int v3, int v4)

Source from the content-addressed store, hash-verified

513 IntBuffer dest = ensureElementSize(3, elementCursor + 1);
514 if (vertexCursor - 1 - v1 < 0)
515 throw new IllegalArgumentException(
516 " can't write line into vertexbuffer, trying to access a negative index with start " + v1 + " > " + (vertexCursor - 1));
517 if (vertexCursor - 1 - v2 < 0)
518 throw new IllegalArgumentException(
519 " can't write line into vertexbuffer, trying to access a negative index with middle1 " + v2 + " > " + (vertexCursor - 1));
520 if (vertexCursor - 1 - v3 < 0)
521 throw new IllegalArgumentException(
522 " can't write line into vertexbuffer, trying to access a negative index with middle2 " + v3 + " > " + (vertexCursor - 1));
523 if (vertexCursor - 1 - v4 < 0)
524 throw new IllegalArgumentException(
525 " can't write line into vertexbuffer, trying to access a negative index with end " + v3 + " > " + (vertexCursor - 1));
526
527 dest.put(vertexCursor - 1 - v1);
528 dest.put(vertexCursor - 1 - v2);
529 dest.put(vertexCursor - 1 - v3);
530
531 dest.put(vertexCursor - 1 - v1);
532 dest.put(vertexCursor - 1 - v3);
533 dest.put(vertexCursor - 1 - v4);
534
535 elementCursor++;
536 elementCursor++;
537 return this;
538 }
539
540 /**
541 * Adds the triangle v1,v2,v3.
542 * <p>
543 * vertex numbers are backwards from the current vertex, so vertex 0 is the most recent call to v, 1 is the vertex before that and so on
544 */

Callers 5

drawIntoMethod · 0.95
compositeWithMethod · 0.95
blurIntoMethod · 0.95
BrowserClass · 0.80
drawMethod · 0.80

Calls 2

ensureElementSizeMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected