Commit 6fcb39e1 authored by Anthony Kleine's avatar Anthony Kleine

Added a few more variables surrounding convexHullEmitStrings. I need to make a test.

parent 4b72e326
Pipeline #1882266 skipped
...@@ -306,6 +306,7 @@ public class InteriorBuilder ...@@ -306,6 +306,7 @@ public class InteriorBuilder
result.setConvexHulls(convexHulls); result.setConvexHulls(convexHulls);
// TODO: Convex Hull Emit Strings // TODO: Convex Hull Emit Strings
System.out.println("Adding Convex Hull Emit Strings"); System.out.println("Adding Convex Hull Emit Strings");
// To inspect this further, I want to make a test DIF with a triangular prism in it. This would give me all the properties of a triangle. I should theoretically just be able to copy paste them.
List<Byte> convexHullByteStrings = new ArrayList<Byte>(); List<Byte> convexHullByteStrings = new ArrayList<Byte>();
for (int i = 0; i < convexHulls.length; i++) { for (int i = 0; i < convexHulls.length; i++) {
// the number of POINTS in this triangle minus one // the number of POINTS in this triangle minus one
...@@ -341,7 +342,8 @@ public class InteriorBuilder ...@@ -341,7 +342,8 @@ public class InteriorBuilder
result.setConvexHullEmitStrings(convexHullEmitStrings); result.setConvexHullEmitStrings(convexHullEmitStrings);
// TODO: Hull Indices // TODO: Hull Indices
System.out.println("Adding Hull Indices"); System.out.println("Adding Hull Indices");
int[] hullIndices = new int[convexHulls.length * 8]; // should be * 3 not 8, there are three vertices per shape
int[] hullIndices = new int[convexHulls.length * 3];
for (int i = 0; i < hullIndices.length; i++) for (int i = 0; i < hullIndices.length; i++)
{ {
hullIndices[i] = i; hullIndices[i] = i;
...@@ -349,16 +351,18 @@ public class InteriorBuilder ...@@ -349,16 +351,18 @@ public class InteriorBuilder
result.setHullIndices(hullIndices); result.setHullIndices(hullIndices);
// TODO: Hull Plane Indices // TODO: Hull Plane Indices
System.out.println("Adding Hull Plane Indices"); System.out.println("Adding Hull Plane Indices");
// just the planeIndexes in some order
short[] hullPlaneIndices = new short[planes.sizeIndices()]; short[] hullPlaneIndices = new short[planes.sizeIndices()];
for (short i = 0; i < planes.sizeIndices(); i++) for (short i = 0; i < planes.sizeIndices(); i++)
hullPlaneIndices[i] = i; hullPlaneIndices[i] = i;
result.setHullPlaneIndices(hullPlaneIndices); result.setHullPlaneIndices(hullPlaneIndices);
// TODO: Hull Emit String Indices // TODO: Hull Emit String Indices
// Each triangle uses 15 numbers in the convexHullEmitStrings. This makes sense - they are all the same shape.
System.out.println("Adding Hull Emit String Indices"); System.out.println("Adding Hull Emit String Indices");
int[] hullEmitStringIndices = new int[convexHulls.length * 8]; int[] hullEmitStringIndices = new int[convexHulls.length];
for (int i = 0; i < hullEmitStringIndices.length; i++) for (int i = 0; i < convexHulls.length; i++)
{ {
hullEmitStringIndices[i] = 0; hullEmitStringIndices[i] = i*15;
} }
result.setHullEmitStringIndices(hullEmitStringIndices); result.setHullEmitStringIndices(hullEmitStringIndices);
......
Markdown is supported
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