is there any way to count the number of rotations of a matrix ? i've tried to count the number of times the angle reaches a specific angle (say 60 degree) but it wasn't accurate and it didn't count all the times
i've tried also to take a copy of the matrix by newMatrix.set(originalMatrix)
and count number of times that originalMatrix.equals(newMatrix)
but wasn't accurate either and also was kinda buggy
my rotate function
void rotate(int x, int y) {
this.matrix.postRotate((float) (this.startAngle - this.currentAngle),
x, y);
}
my onTouch
event
case MotionEvent.ACTION_MOVE:
ring_gear.setCurrentAngle((float) ring_gear.getAngle(
event.getX(), event.getY()));
ring_gear.rotate(ring_gear.Width / 2, ring_gear.Height / 2);
ring.setImageMatrix(ring_gear.matrix);
ring_gear.startAngle = ring_gear.currentAngle;