Revision 2289cab1
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/helpers/ObjectShape.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.objectlib.helpers; |
21 | 21 |
|
22 |
import org.distorted.objectlib.main.ObjectControl; |
|
23 |
|
|
22 | 24 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
23 | 25 |
|
24 | 26 |
public class ObjectShape |
25 | 27 |
{ |
26 | 28 |
private final double[][] mVertices; |
27 | 29 |
private final int[][] mVertIndices; |
28 |
private final float[][] mBands; |
|
29 | 30 |
private final int[] mBandIndices; |
30 | 31 |
private final float[][] mCorners; |
31 | 32 |
private final int[] mCornerIndices; |
... | ... | |
34 | 35 |
private final int mNumComponents; |
35 | 36 |
private final float[] mConvexityCenter; |
36 | 37 |
|
38 |
private float[][] mBands; |
|
39 |
|
|
37 | 40 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
38 | 41 |
|
39 | 42 |
public ObjectShape(double[][] vertices, int[][] vertIndices, float[][] bands, int[] bandIndices, |
... | ... | |
50 | 53 |
mCenterIndices = centIndices; |
51 | 54 |
mNumComponents = numComponents; |
52 | 55 |
mConvexityCenter = convexityCenter; |
56 |
|
|
57 |
if( ObjectControl.isInIconMode() ) |
|
58 |
{ |
|
59 |
int len = bands.length; |
|
60 |
mBands = new float[len][]; |
|
61 |
|
|
62 |
for(int i=0; i<len; i++) |
|
63 |
{ |
|
64 |
int l = bands[i].length; |
|
65 |
mBands[i] = new float[l]; |
|
66 |
mBands[i][0] = 0.01f; |
|
67 |
if (l>=1) System.arraycopy(bands[i], 1, mBands[i], 1, l-1); |
|
68 |
} |
|
69 |
} |
|
53 | 70 |
} |
54 | 71 |
|
55 | 72 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
New 'IconMode' and some APIs to support it.