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)
| 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 | */ |
no test coverage detected