3d骑行视角旋转

This commit is contained in:
lishuo committed 2021-12-21 18:43:22 +08:00
1 parent 939084b074
commit c8c27bd021
3 files changed
+49 -16

No files matched your search

@@ -14,6 +14,7 @@ public class TKRotationRecognizer : TKAbstractGestureRecognizer
public event Action<TKRotationRecognizer> gestureCompleteEvent;
public float deltaRotation = 0;
public float CurrentRotation = 0;
public float minimumRotationToRecognize = 0;
protected float _previousRotation = 0;
@@ -115,6 +116,7 @@ public class TKRotationRecognizer : TKAbstractGestureRecognizer
if( state == TKGestureRecognizerState.RecognizedAndStillRecognizing || state == TKGestureRecognizerState.Began )
{
var currentRotation = angleBetweenPoints( _trackingTouches[0].position, _trackingTouches[1].position );
CurrentRotation = currentRotation;
deltaRotation = Mathf.DeltaAngle( currentRotation, _previousRotation );
_previousRotation = currentRotation;
state = TKGestureRecognizerState.RecognizedAndStillRecognizing;