1 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2021 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
|
|
// Magic Cube is free software: you can redistribute it and/or modify //
|
7 |
|
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
|
|
// Magic Cube is distributed in the hope that it will be useful, //
|
12 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
|
|
// along with Magic Cube. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
198c5bf0
|
Leszek Koltunski
|
package org.distorted.objectlib.helpers;
|
21 |
29b82486
|
Leszek Koltunski
|
|
22 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
23 |
|
|
|
24 |
|
|
public class ObjectShape
|
25 |
|
|
{
|
26 |
|
|
private final double[][] mVertices;
|
27 |
|
|
private final int[][] mVertIndices;
|
28 |
|
|
private final float[][] mBands;
|
29 |
|
|
private final int[] mBandIndices;
|
30 |
|
|
private final float[][] mCorners;
|
31 |
|
|
private final int[] mCornerIndices;
|
32 |
|
|
private final float[][] mCenters;
|
33 |
|
|
private final int[] mCenterIndices;
|
34 |
|
|
private final int mNumComponents;
|
35 |
|
|
private final float[] mConvexityCenter;
|
36 |
|
|
|
37 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
38 |
|
|
|
39 |
|
|
public ObjectShape(double[][] vertices, int[][] vertIndices, float[][] bands, int[] bandIndices,
|
40 |
|
|
float[][] corners, int[] cornIndices, float[][] centers, int[] centIndices,
|
41 |
|
|
int numComponents, float[] convexityCenter)
|
42 |
|
|
{
|
43 |
|
|
mVertices = vertices;
|
44 |
|
|
mVertIndices = vertIndices;
|
45 |
|
|
mBands = bands;
|
46 |
|
|
mBandIndices = bandIndices;
|
47 |
|
|
mCorners = corners;
|
48 |
|
|
mCornerIndices = cornIndices;
|
49 |
|
|
mCenters = centers;
|
50 |
|
|
mCenterIndices = centIndices;
|
51 |
|
|
mNumComponents = numComponents;
|
52 |
|
|
mConvexityCenter = convexityCenter;
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
56 |
|
|
|
57 |
|
|
public double[][] getVertices()
|
58 |
|
|
{
|
59 |
|
|
return mVertices;
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
63 |
|
|
|
64 |
|
|
public int[][] getVertIndices()
|
65 |
|
|
{
|
66 |
|
|
return mVertIndices;
|
67 |
|
|
}
|
68 |
|
|
|
69 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
70 |
|
|
|
71 |
|
|
public float[][] getBands()
|
72 |
|
|
{
|
73 |
|
|
return mBands;
|
74 |
|
|
}
|
75 |
|
|
|
76 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
77 |
|
|
|
78 |
|
|
public int[] getBandIndices()
|
79 |
|
|
{
|
80 |
|
|
return mBandIndices;
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
84 |
|
|
|
85 |
|
|
public float[][] getCorners()
|
86 |
|
|
{
|
87 |
|
|
return mCorners;
|
88 |
|
|
}
|
89 |
|
|
|
90 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
91 |
|
|
|
92 |
|
|
public int[] getCornerIndices()
|
93 |
|
|
{
|
94 |
|
|
return mCornerIndices;
|
95 |
|
|
}
|
96 |
|
|
|
97 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
98 |
|
|
|
99 |
|
|
public float[][] getCenters()
|
100 |
|
|
{
|
101 |
|
|
return mCenters;
|
102 |
|
|
}
|
103 |
|
|
|
104 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
105 |
|
|
|
106 |
|
|
public int[] getCenterIndices()
|
107 |
|
|
{
|
108 |
|
|
return mCenterIndices;
|
109 |
|
|
}
|
110 |
|
|
|
111 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
112 |
|
|
|
113 |
|
|
public int getNumComponents()
|
114 |
|
|
{
|
115 |
|
|
return mNumComponents;
|
116 |
|
|
}
|
117 |
|
|
|
118 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
119 |
|
|
|
120 |
|
|
public float[] getConvexityCenter()
|
121 |
|
|
{
|
122 |
|
|
return mConvexityCenter;
|
123 |
|
|
}
|
124 |
|
|
}
|