Revision a6aa9a47
Added by Leszek Koltunski 12 months ago
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlShapeConstant.java | ||
---|---|---|
408 | 408 |
} |
409 | 409 |
} |
410 | 410 |
|
411 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
412 |
|
|
413 |
public boolean axisAndFaceAgree(int axisIndex) |
|
414 |
{ |
|
415 |
Static3D rotAxis = mRotAxis[axisIndex]; |
|
416 |
Static3D faceAxis= mFaceAxis[mLastTouchedFace]; |
|
417 |
|
|
418 |
float rx = rotAxis.get0(); |
|
419 |
float ry = rotAxis.get1(); |
|
420 |
float rz = rotAxis.get2(); |
|
421 |
|
|
422 |
float fx = faceAxis.get0(); |
|
423 |
float fy = faceAxis.get1(); |
|
424 |
float fz = faceAxis.get2(); |
|
425 |
|
|
426 |
float dx = rx-fx; |
|
427 |
float dy = ry-fy; |
|
428 |
float dz = rz-fz; |
|
429 |
|
|
430 |
return (dx*dx + dy*dy + dz*dz) == 0; |
|
431 |
} |
|
432 |
|
|
411 | 433 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
412 | 434 |
|
413 | 435 |
public float[] getTouchedPuzzleCenter() |
Also available in: Unified diff
Improve the 'rot axis parallel to face axis' touch control mode:
support case when the rot axis is parallel and agrees in direction with the face axis, and the one when they disagreee in direction.