44 |
} |
} |
45 |
|
|
46 |
public int getCSAt(int parent, float x, float y, float[] targetcoords) { |
public int getCSAt(int parent, float x, float y, float[] targetcoords) { |
47 |
|
int[] inds = GL.getAllCSAt(ninds, this.inds, floats, parent, x, y); |
48 |
|
for(int i=0; i<inds.length; i++) |
49 |
|
if(isAncestor(inds[i], parent)) |
50 |
|
return inds[i]; |
51 |
return -1; |
return -1; |
52 |
} |
} |
53 |
|
|
54 |
|
private boolean isAncestor(int cs, int parent) { |
55 |
|
while(cs != parent && cs != -1) |
56 |
|
cs = getParent(cs); |
57 |
|
return cs == parent; |
58 |
|
} |
59 |
|
|
60 |
|
public int getParent(int cs) { |
61 |
|
return inds[cs+1]; |
62 |
|
} |
63 |
|
|
64 |
public int affineCoordsys( |
public int affineCoordsys( |
65 |
int into, float depth, |
int into, float depth, |
66 |
float cx, float cy, |
float cx, float cy, |