* Adds the vertices and vertex attributes for two triangles representing the * stroke cap of a line. A fragment shader is responsible for displaying the * appropriate cap style within the rectangle they make. * * The lineSides buffer will include the following values for the points on
(point, tangent, color)
| 1558 | * @chainable |
| 1559 | */ |
| 1560 | _addCap(point, tangent, color) { |
| 1561 | const ptArray = point.array(); |
| 1562 | const tanInArray = tangent.array(); |
| 1563 | const tanOutArray = [0, 0, 0]; |
| 1564 | for (let i = 0; i < 6; i++) { |
| 1565 | this.lineVertices.push(...ptArray); |
| 1566 | this.lineTangentsIn.push(...tanInArray); |
| 1567 | this.lineTangentsOut.push(...tanOutArray); |
| 1568 | this.lineVertexColors.push(...color); |
| 1569 | } |
| 1570 | this.lineSides.push(-1, 2, -2, 1, 2, -1); |
| 1571 | return this; |
| 1572 | } |
| 1573 | |
| 1574 | /** |
| 1575 | * Adds the vertices and vertex attributes for four triangles representing a |
no test coverage detected