1 |
3ee1d662
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2021 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
a7a40b3c
|
Leszek Koltunski
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7 |
|
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8 |
3ee1d662
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9 |
|
|
|
10 |
|
|
package org.distorted.objectlib.helpers;
|
11 |
|
|
|
12 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
13 |
|
|
|
14 |
|
|
public class ObjectFaceShape
|
15 |
|
|
{
|
16 |
|
|
private final int[] mBandIndices;
|
17 |
|
|
private final float[] mConvexityCenter;
|
18 |
3bf19410
|
Leszek Koltunski
|
private final float[][] mBands;
|
19 |
3ee1d662
|
Leszek Koltunski
|
|
20 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
21 |
|
|
|
22 |
84a17011
|
Leszek Koltunski
|
public ObjectFaceShape(float[][] bands, int[] bandIndices, float[] convexityCenter)
|
23 |
3ee1d662
|
Leszek Koltunski
|
{
|
24 |
|
|
mBands = bands;
|
25 |
|
|
mBandIndices = bandIndices;
|
26 |
|
|
mConvexityCenter = convexityCenter;
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
30 |
|
|
|
31 |
|
|
public float[][] getBands()
|
32 |
|
|
{
|
33 |
|
|
return mBands;
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
37 |
|
|
|
38 |
|
|
public int[] getBandIndices()
|
39 |
|
|
{
|
40 |
|
|
return mBandIndices;
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
44 |
|
|
|
45 |
|
|
public float[] getConvexityCenter()
|
46 |
|
|
{
|
47 |
|
|
return mConvexityCenter;
|
48 |
|
|
}
|
49 |
3821ebef
|
leszek
|
|
50 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
51 |
|
|
|
52 |
|
|
public void debug()
|
53 |
|
|
{
|
54 |
|
|
StringBuilder str = new StringBuilder();
|
55 |
|
|
|
56 |
94c50a70
|
leszek
|
str.append("Bands\n");
|
57 |
|
|
|
58 |
3821ebef
|
leszek
|
for(float[] ba : mBands)
|
59 |
|
|
{
|
60 |
94c50a70
|
leszek
|
str.append(' ');
|
61 |
3821ebef
|
leszek
|
str.append(ba[0]);
|
62 |
|
|
str.append(' ');
|
63 |
|
|
str.append(ba[1]);
|
64 |
|
|
str.append(' ');
|
65 |
|
|
str.append(ba[2]);
|
66 |
|
|
str.append(' ');
|
67 |
|
|
str.append(ba[3]);
|
68 |
|
|
str.append(' ');
|
69 |
|
|
str.append(ba[4]);
|
70 |
|
|
str.append(' ');
|
71 |
|
|
str.append(ba[5]);
|
72 |
|
|
str.append(' ');
|
73 |
|
|
str.append(ba[6]);
|
74 |
|
|
str.append("\n");
|
75 |
|
|
}
|
76 |
|
|
|
77 |
94c50a70
|
leszek
|
str.append("Indices ");
|
78 |
|
|
|
79 |
3821ebef
|
leszek
|
for(int i : mBandIndices )
|
80 |
|
|
{
|
81 |
|
|
str.append(' ');
|
82 |
94c50a70
|
leszek
|
str.append(i);
|
83 |
3821ebef
|
leszek
|
}
|
84 |
|
|
|
85 |
|
|
str.append("\n");
|
86 |
94c50a70
|
leszek
|
str.append("convexityCenter");
|
87 |
3821ebef
|
leszek
|
|
88 |
|
|
if( mConvexityCenter!=null )
|
89 |
|
|
{
|
90 |
94c50a70
|
leszek
|
str.append(' ');
|
91 |
3821ebef
|
leszek
|
str.append(mConvexityCenter[0]);
|
92 |
|
|
str.append(' ');
|
93 |
|
|
str.append(mConvexityCenter[1]);
|
94 |
|
|
str.append(' ');
|
95 |
|
|
str.append(mConvexityCenter[2]);
|
96 |
|
|
}
|
97 |
|
|
else
|
98 |
|
|
{
|
99 |
94c50a70
|
leszek
|
str.append(" null");
|
100 |
3821ebef
|
leszek
|
}
|
101 |
|
|
|
102 |
|
|
android.util.Log.e("D", "ObjectFaceShape: \n"+str);
|
103 |
|
|
}
|
104 |
3ee1d662
|
Leszek Koltunski
|
}
|