Revision 2241c459
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlShapeConstant.java | ||
---|---|---|
301 | 301 |
if( offset<translated ) return i; |
302 | 302 |
} |
303 | 303 |
} |
304 |
else |
|
305 |
{ |
|
306 |
// poor hack for CoinTetrahedron where 0 happens to the the correct value. |
|
307 |
// in this case we have the rotAxis normal to the face, i.e. A here is 0. |
|
308 |
// we want to be rotating the central 'coin' where which happens to be row 0. |
|
309 |
return 0; |
|
310 |
} |
|
304 | 311 |
|
305 | 312 |
return len; |
306 | 313 |
} |
... | ... | |
389 | 396 |
output[1] =result.get1(); |
390 | 397 |
|
391 | 398 |
float len = (float)Math.sqrt(output[0]*output[0] + output[1]*output[1]); |
392 |
output[0] /= len; |
|
393 |
output[1] /= len; |
|
399 |
|
|
400 |
if( len!=0 ) |
|
401 |
{ |
|
402 |
output[0] /= len; |
|
403 |
output[1] /= len; |
|
404 |
} |
|
394 | 405 |
} |
395 | 406 |
|
396 | 407 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Coin Tetrahedron: progress