Adds a element of type "line with adjacency" to this MeshBuilder. Line with adjancey is an OpenGL element that is a line segment with two other associated vertices (typically the previous and next vertices, but shaders are free to interpret these however they'd like to) (vertex numbers are backw
(int v1, int v2, int v3, int v4)
| 449 | IntBuffer dest = ensureElementSize(4, elementCursor); |
| 450 | if (vertexCursor - 1 - v1 < 0) |
| 451 | throw new IllegalArgumentException( |
| 452 | " can't write line into vertexbuffer, trying to access a negative index with start " + v1 + " > " + (vertexCursor - 1)); |
| 453 | if (vertexCursor - 1 - v2 < 0) |
| 454 | throw new IllegalArgumentException( |
| 455 | " can't write line into vertexbuffer, trying to access a negative index with middle1 " + v2 + " > " + (vertexCursor - 1)); |
| 456 | if (vertexCursor - 1 - v3 < 0) |
| 457 | throw new IllegalArgumentException( |
| 458 | " can't write line into vertexbuffer, trying to access a negative index with middle2 " + v3 + " > " + (vertexCursor - 1)); |
| 459 | if (vertexCursor - 1 - v4 < 0) |
| 460 | throw new IllegalArgumentException( |
| 461 | " can't write line into vertexbuffer, trying to access a negative index with end " + v3 + " > " + (vertexCursor - 1)); |
| 462 | dest.put(vertexCursor - 1 - v1); |
| 463 | dest.put(vertexCursor - 1 - v2); |
| 464 | dest.put(vertexCursor - 1 - v3); |
| 465 | dest.put(vertexCursor - 1 - v4); |
| 466 | |
| 467 | elementCursor++; |
| 468 | return this; |
| 469 | } |
| 470 | |
| 471 | /** |
| 472 | * adds a "triangle with adjacency", that is the triangle v1,v2,v3 and the additional verts corresponding to the edges v12, v23, and v31 |
| 473 | */ |
| 474 | public MeshBuilder e(int v1, int v2, int v3, int v12, int v23, int v31) { |
| 475 | IntBuffer dest = ensureElementSize(6, elementCursor); |
no test coverage detected