Commit 3dac795e authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

Version 3.17.0 Release

See merge request !28
1 merge request!28Version 3.17.0 Release
Pipeline #11012 passed with stage
in 1 minute and 10 seconds
Showing with 1310 additions and 190 deletions
+1310 -190
......@@ -33,7 +33,7 @@ import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.math.Vector3d;
/**
* Tesselator to create triangles out of polygons.
* Tesselator to create triangles out of polygons. Uses JOGL implementation.
*
* @author Matthias Betz
*
......@@ -102,6 +102,10 @@ public class JoglTesselator {
}
public static TesselatedPolygon tesselatePolygon(Polygon p) {
return tesselatePolygon(p, true);
}
public static TesselatedPolygon tesselatePolygon(Polygon p, boolean discardDegeneratedTriangles) {
ArrayList<Vector3d> vertices = new ArrayList<>();
Vector3d normal = p.calculateNormalNormalized();
synchronized (tess) {
......@@ -121,7 +125,7 @@ public class JoglTesselator {
GLU.gluTessEndPolygon(tess);
ArrayList<Integer> indices = new ArrayList<>();
for (Primitive primitive : primitives) {
primitive.fillListWithIndices(indices);
primitive.fillListWithIndices(indices, discardDegeneratedTriangles);
}
primitives.clear();
return new TesselatedPolygon(vertices, indices, p);
......@@ -137,7 +141,7 @@ public class JoglTesselator {
GLU.gluTessEndContour(tess);
}
public static TesselatedRing tesselateRing(LinearRing r) {
public static TesselatedRing tesselateRing(LinearRing r, boolean discardDegeneratedTriangles) {
ArrayList<Vector3d> vertices = new ArrayList<>();
Vector3d normal = r.calculateNormal();
synchronized (tess) {
......@@ -147,12 +151,16 @@ public class JoglTesselator {
GLU.gluTessEndPolygon(tess);
ArrayList<Integer> indices = new ArrayList<>();
for (Primitive primitive : primitives) {
primitive.fillListWithIndices(indices);
primitive.fillListWithIndices(indices, discardDegeneratedTriangles);
}
primitives.clear();
return new TesselatedRing(vertices, indices, r);
}
}
public static TesselatedRing tesselateRing(LinearRing r) {
return tesselateRing(r, true);
}
private JoglTesselator() {
// only static useage
......
File added
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment