37 |
int nfloats = 0; |
int nfloats = 0; |
38 |
|
|
39 |
int[] inds = new int[5000]; |
int[] inds = new int[5000]; |
40 |
int ninds = 3; // first 3 ignored. |
int ninds = 1; // zero is special (the root) |
41 |
|
|
42 |
public int getCSIndexAt(float x, float y) { return -1; } |
public int getCSIndexAt(float x, float y) { return -1; } |
43 |
|
|
47 |
float x_x, float x_y, |
float x_x, float x_y, |
48 |
float y_x, float y_y |
float y_x, float y_y |
49 |
) { |
) { |
50 |
if(dbg) pa("AffineCoordSys "+ninds/3+": "+into+" '"+depth+" --- "+ |
if(dbg) pa("AffineCoordSys "+ninds+": "+into+" '"+depth+" --- "+ |
51 |
cx+" "+cy+" "+x_x+" "+x_y+" "+y_x+" "+y_y); |
cx+" "+cy+" "+x_x+" "+x_y+" "+y_x+" "+y_y); |
52 |
|
|
53 |
int paramInd = nfloats; |
int paramInd = nfloats; |
57 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
58 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
59 |
|
|
60 |
int was = ninds / 3; |
int was = ninds; |
61 |
ninds += 3; |
ninds += 3; |
62 |
|
|
63 |
setAffineParams(was, depth, cx, cy, x_x, x_y, y_x, y_y); |
setAffineParams(was, depth, cx, cy, x_x, x_y, y_x, y_y); |
68 |
public void setAffineParams( |
public void setAffineParams( |
69 |
int cs, float depth, float cx, float cy, |
int cs, float depth, float cx, float cy, |
70 |
float x_x, float x_y, float y_x, float y_y) { |
float x_x, float x_y, float y_x, float y_y) { |
71 |
int ind = inds[3*cs + 2]; |
int ind = inds[cs + 2]; |
72 |
floats[ind + 0] = cx; |
floats[ind + 0] = cx; |
73 |
floats[ind + 1] = cy; |
floats[ind + 1] = cy; |
74 |
floats[ind + 2] = depth; |
floats[ind + 2] = depth; |
86 |
inds[ninds + 0] = 2; // rotation = 2 |
inds[ninds + 0] = 2; // rotation = 2 |
87 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
88 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
89 |
int was = ninds / 3; |
int was = ninds; |
90 |
ninds += 3; |
ninds += 3; |
91 |
|
|
92 |
return was; |
return was; |
103 |
inds[ninds + 0] = 4; // rotation xyz |
inds[ninds + 0] = 4; // rotation xyz |
104 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
105 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
106 |
int was = ninds / 3; |
int was = ninds; |
107 |
ninds += 3; |
ninds += 3; |
108 |
|
|
109 |
return was; |
return was; |
119 |
inds[ninds + 0] = 6; // translation xyz |
inds[ninds + 0] = 6; // translation xyz |
120 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
121 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
122 |
int was = ninds / 3; |
int was = ninds; |
123 |
ninds += 3; |
ninds += 3; |
124 |
|
|
125 |
return was; |
return was; |
140 |
inds[ninds + 0] = 7; // buoy xyz |
inds[ninds + 0] = 7; // buoy xyz |
141 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
142 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
143 |
int was = ninds / 3; |
int was = ninds; |
144 |
ninds += 3; |
ninds += 3; |
145 |
|
|
146 |
return was; |
return was; |
158 |
inds[ninds + 0] = 5; // rotation xyz |
inds[ninds + 0] = 5; // rotation xyz |
159 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
160 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
161 |
int was = ninds / 3; |
int was = ninds; |
162 |
ninds += 3; |
ninds += 3; |
163 |
|
|
164 |
return was; |
return was; |
181 |
inds[ninds + 1] = into; |
inds[ninds + 1] = into; |
182 |
inds[ninds + 2] = paramInd; |
inds[ninds + 2] = paramInd; |
183 |
|
|
184 |
int was = ninds / 3; |
int was = ninds; |
185 |
ninds += 3; |
ninds += 3; |
186 |
return was; |
return was; |
187 |
} |
} |
188 |
|
|
189 |
public void dump() { |
public void dump() { |
190 |
pa("GLVobCoorder: "); |
pa("GLVobCoorder: "); |
191 |
for(int i=0; i<ninds/3; i++) { |
for(int i=0; i<ninds; i++) { |
192 |
int ind = i*3; |
pa(" "+i); |
|
String s = ""; |
|
|
for(int u = ind; u<ind+3; u++) |
|
|
s = s + " " + inds[u]; |
|
|
pa(" cs: "+s); |
|
193 |
} |
} |
194 |
} |
} |
195 |
|
|