52 |
public int getCSAt(int parent, float x, float y, float[] targetcoords) { |
public int getCSAt(int parent, float x, float y, float[] targetcoords) { |
53 |
int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, y); |
int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, y); |
54 |
for(int i=0; i<inds.length; i++) |
for(int i=0; i<inds.length; i++) |
55 |
if(isNearestActiveAncestor(inds[i], parent)) |
if(isNearestActiveAncestor(inds[i], parent)) { |
56 |
return inds[i]; |
int cs = inds[i]; |
57 |
|
if(targetcoords != null) { |
58 |
|
float[] coords = new float[] {x, y, 0}; |
59 |
|
inverseTransformPoints3(cs, coords, coords); |
60 |
|
targetcoords[0] = coords[0]; |
61 |
|
targetcoords[1] = coords[1]; |
62 |
|
} |
63 |
|
return cs; |
64 |
|
} |
65 |
return -1; |
return -1; |
66 |
} |
} |
67 |
|
|