diff options
author | Sven Gothel <[email protected]> | 2023-04-18 05:15:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-04-18 05:15:16 +0200 |
commit | c65c750e032118f229050ff8e834961264ed0591 (patch) | |
tree | 8500286ca6086eb21a9b275ccd586185090b1500 /src/jogl/classes/com/jogamp/graph/geom/Triangle.java | |
parent | cd845589eea6c7773007e013bd5f2f37242cbe1a (diff) |
Graph + GraphUI: Consolidate Vertex: Drop SVertex and factory, use Vec[234]f instead of float[] and remove unused VectorUtil methods
After Matrix4f consolidation and proving same or better performance on non array types,
this enhances code readability, simplifies API, reduces bugs and may improve performance.
GraphUI:
- Have RoundButton as a functional class to make a round or rectangular backdrop,
i.e. impl. addShapeToRegion() via reused addRoundShapeToRegion()
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/geom/Triangle.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/geom/Triangle.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java index 1c63c4005..6b07501a6 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java +++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java @@ -64,11 +64,11 @@ public class Triangle { /** * Returns a transformed a clone of this instance using the given AffineTransform. */ - public Triangle transform(final AffineTransform t, final Vertex.Factory<? extends Vertex> vertexFactory) { + public Triangle transform(final AffineTransform t) { final Triangle tri = new Triangle(id, boundaryEdges, boundaryVertices); - tri.vertices[0] = t.transform(vertices[0], vertexFactory.create()); - tri.vertices[1] = t.transform(vertices[1], vertexFactory.create()); - tri.vertices[2] = t.transform(vertices[2], vertexFactory.create()); + tri.vertices[0] = t.transform(vertices[0], new Vertex()); + tri.vertices[1] = t.transform(vertices[1], new Vertex()); + tri.vertices[2] = t.transform(vertices[2], new Vertex()); return tri; } @@ -83,9 +83,9 @@ public class Triangle { * Returns true if all vertices are lines, i.e. zero tex-coord, otherwise false. */ public final boolean isLine() { - return VectorUtil.isVec2Zero(vertices[0].getTexCoord(), 0) && - VectorUtil.isVec2Zero(vertices[1].getTexCoord(), 0) && - VectorUtil.isVec2Zero(vertices[2].getTexCoord(), 0) ; + return VectorUtil.isVec2Zero(vertices[0].getTexCoord()) && + VectorUtil.isVec2Zero(vertices[1].getTexCoord()) && + VectorUtil.isVec2Zero(vertices[2].getTexCoord()) ; } public int getId() { |