|
7 | 7 |
|
8 | 8 | public class Face3D { |
9 | 9 |
|
10 | | - public Color color; |
11 | | - |
12 | | - public int[] indices; |
13 | | - |
14 | | - public Vector3f normal; |
15 | | - |
16 | | - public String tag; |
17 | | - |
18 | | - public Face3D() { |
19 | | - this(new int[0]); |
20 | | - } |
21 | | - |
22 | | - public Face3D(int... indices) { |
23 | | - this.color = new Color(); |
24 | | - this.indices = new int[indices.length]; |
25 | | - this.normal = new Vector3f(); |
26 | | - this.tag = ""; |
27 | | - for (int i = 0; i < indices.length; i++) |
28 | | - this.indices[i] = indices[i]; |
29 | | - } |
30 | | - |
31 | | - public boolean sharesSameIndices(Face3D face) { |
32 | | - int[] indices0 = Arrays.copyOf(face.indices, face.indices.length); |
33 | | - int[] indices1 = Arrays.copyOf(indices, indices.length); |
34 | | - Arrays.sort(indices0); |
35 | | - Arrays.sort(indices1); |
36 | | - return Arrays.equals(indices0, indices1); |
37 | | - } |
38 | | - |
39 | | - public int getIndexAt(int index) { |
40 | | - return indices[index % indices.length]; |
41 | | - } |
42 | | - |
43 | | - public int getVertexCount() { |
44 | | - return indices.length; |
45 | | - } |
46 | | - |
47 | | - public Face3D(Face3D f) { |
48 | | - this(f.indices); |
49 | | - this.tag = new String(f.tag); |
50 | | - } |
51 | | - |
52 | | - @Override |
53 | | - public String toString() { |
54 | | - return "Face3D [indices=" + Arrays.toString(indices) + "]"; |
55 | | - } |
56 | | - |
| 10 | + public Color color; |
| 11 | + |
| 12 | + public int[] indices; |
| 13 | + |
| 14 | + public Vector3f normal; |
| 15 | + |
| 16 | + public String tag; |
| 17 | + |
| 18 | + public Face3D() { |
| 19 | + this(new int[0]); |
| 20 | + } |
| 21 | + |
| 22 | + public Face3D(int... indices) { |
| 23 | + this.color = new Color(); |
| 24 | + this.indices = new int[indices.length]; |
| 25 | + this.normal = new Vector3f(); |
| 26 | + this.tag = ""; |
| 27 | + for (int i = 0; i < indices.length; i++) this.indices[i] = indices[i]; |
| 28 | + } |
| 29 | + |
| 30 | + public boolean sharesSameIndices(Face3D face) { |
| 31 | + int[] indices0 = Arrays.copyOf(face.indices, face.indices.length); |
| 32 | + int[] indices1 = Arrays.copyOf(indices, indices.length); |
| 33 | + Arrays.sort(indices0); |
| 34 | + Arrays.sort(indices1); |
| 35 | + return Arrays.equals(indices0, indices1); |
| 36 | + } |
| 37 | + |
| 38 | + public int getIndexAt(int index) { |
| 39 | + return indices[index % indices.length]; |
| 40 | + } |
| 41 | + |
| 42 | + public int getVertexCount() { |
| 43 | + return indices.length; |
| 44 | + } |
| 45 | + |
| 46 | + public Face3D(Face3D f) { |
| 47 | + this(f.indices); |
| 48 | + this.tag = new String(f.tag); |
| 49 | + } |
| 50 | + |
| 51 | + @Override |
| 52 | + public String toString() { |
| 53 | + return "Face3D [indices=" + Arrays.toString(indices) + "]"; |
| 54 | + } |
57 | 55 | } |
0 commit comments