Revision 5ffb290c
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/library/mesh/MeshMultigon.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
private int isUp(float[][] vertices, int polygon, int edge) |
50 | 50 |
{ |
51 |
//android.util.Log.e("D", "checking polygon "+polygon+" edge "+edge); |
|
52 |
|
|
53 | 51 |
float[] p= vertices[polygon]; |
54 | 52 |
int lenP = p.length/2; |
55 | 53 |
int len = vertices.length; |
... | ... | |
60 | 58 |
float v2x = p[2*next ]; |
61 | 59 |
float v2y = p[2*next+1]; |
62 | 60 |
|
63 |
//android.util.Log.e("D", " v1="+v1x+" "+v1y+" v2="+v2x+" "+v2y); |
|
64 |
|
|
65 | 61 |
for(int i=0; i<len; i++) |
66 | 62 |
if( i!=polygon ) |
67 | 63 |
{ |
... | ... | |
76 | 72 |
float x2 = v[2*n ]; |
77 | 73 |
float y2 = v[2*n+1]; |
78 | 74 |
|
79 |
//android.util.Log.e("D", "comparing v2 to "+x1+" "+y1); |
|
80 |
//android.util.Log.e("D", "comparing v1 to "+x2+" "+y2); |
|
81 |
|
|
82 | 75 |
if( isSame(v2x-x1,v2y-y1) && isSame(v1x-x2,v1y-y2) ) return i; |
83 | 76 |
} |
84 | 77 |
} |
85 | 78 |
|
86 |
//android.util.Log.e("D", "FALSE"); |
|
87 |
|
|
88 | 79 |
return -1; |
89 | 80 |
} |
90 | 81 |
|
... | ... | |
99 | 90 |
{ |
100 | 91 |
int len = vertices[i].length/2; |
101 | 92 |
up[i] = new int[len]; |
102 |
for(int j=0; j<len; j++) |
|
103 |
{ |
|
104 |
up[i][j] = isUp(vertices,i,j); |
|
105 |
//android.util.Log.e("D", "polygon "+i+" edge "+j+" up: "+up[i][j]); |
|
106 |
} |
|
93 |
for(int j=0; j<len; j++) up[i][j] = isUp(vertices,i,j); |
|
107 | 94 |
} |
108 | 95 |
|
109 | 96 |
return up; |
Also available in: Unified diff
remove commented out code