C# Class TouchScript.Gestures.Base.TransformGestureBase

Abstract base class for Transform Gestures.
Inheritance: Gesture
Show file Open project: DRMold/HungryHungryTetris

Protected Properties

Property Type Description
angleBuffer float
debugCoroutine UnityEngine.Coroutine
debugID int
debugTouchSize Vector2
deltaPosition Vector3
deltaRotation float
deltaScale float
isTransforming bool
minScreenPointsPixelDistance float
minScreenPointsPixelDistanceSquared float
scaleBuffer float
screenPixelRotationBuffer float
screenPixelScalingBuffer float
screenPixelTranslationBuffer Vector2
screenTransformPixelThreshold float
screenTransformPixelThresholdSquared float

Protected Methods

Method Description
Awake ( ) : void
OnEnable ( ) : void
clearDebug ( ) : void
doOnePointTranslation ( Vector2 oldScreenPos, Vector2 newScreenPos, TouchScript.Layers.ProjectionParams projectionParams ) : Vector3

Calculates single finger translation.

doRotation ( Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, TouchScript.Layers.ProjectionParams projectionParams ) : float

Calculates rotation.

doScaling ( Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, TouchScript.Layers.ProjectionParams projectionParams ) : float

Calculates scaling.

doTwoPointTranslation ( Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, float dR, float dS, TouchScript.Layers.ProjectionParams projectionParams ) : Vector3

Calculated two finger translation with respect to rotation and scaling.

drawDebug ( int touchPoints ) : void
drawDebugDelayed ( int touchPoints ) : void
getNumPoints ( ) : int

Gets the number of points.

getPointPreviousScreenPosition ( int index ) : Vector2

Returns previous screen position of a point with index 0 or 1

getPointScreenPosition ( int index ) : Vector2

Returns screen position of a point with index 0 or 1

onBegan ( ) : void
onChanged ( ) : void
onRecognized ( ) : void
relevantTouches1 ( IList touches ) : bool

Checks if there are touch points in the list which matter for the gesture.

relevantTouches2 ( IList touches ) : bool

Checks if there are touch points in the list which matter for the gesture.

reset ( ) : void
touchesBegan ( IList touches ) : void
touchesEnded ( IList touches ) : void
touchesMoved ( IList touches ) : void

Private Methods

Method Description
doDrawDebug ( int touchPoints ) : IEnumerator
updateMinScreenPointsDistance ( ) : void
updateScreenTransformThreshold ( ) : void

Method Details

Awake() protected method

protected Awake ( ) : void
return void

OnEnable() protected method

protected OnEnable ( ) : void
return void

clearDebug() protected method

protected clearDebug ( ) : void
return void

doOnePointTranslation() protected method

Calculates single finger translation.
protected doOnePointTranslation ( Vector2 oldScreenPos, Vector2 newScreenPos, TouchScript.Layers.ProjectionParams projectionParams ) : Vector3
oldScreenPos Vector2 Finger old screen position.
newScreenPos Vector2 Finger new screen position.
projectionParams TouchScript.Layers.ProjectionParams Layer projection parameters.
return Vector3

doRotation() protected method

Calculates rotation.
protected doRotation ( Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, TouchScript.Layers.ProjectionParams projectionParams ) : float
oldScreenPos1 Vector2 Finger one old screen position.
oldScreenPos2 Vector2 Finger two old screen position.
newScreenPos1 Vector2 Finger one new screen position.
newScreenPos2 Vector2 Finger two new screen position.
projectionParams TouchScript.Layers.ProjectionParams Layer projection parameters.
return float

doScaling() protected method

Calculates scaling.
protected doScaling ( Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, TouchScript.Layers.ProjectionParams projectionParams ) : float
oldScreenPos1 Vector2 Finger one old screen position.
oldScreenPos2 Vector2 Finger two old screen position.
newScreenPos1 Vector2 Finger one new screen position.
newScreenPos2 Vector2 Finger two new screen position.
projectionParams TouchScript.Layers.ProjectionParams Layer projection parameters.
return float

doTwoPointTranslation() protected method

Calculated two finger translation with respect to rotation and scaling.
protected doTwoPointTranslation ( Vector2 oldScreenPos1, Vector2 oldScreenPos2, Vector2 newScreenPos1, Vector2 newScreenPos2, float dR, float dS, TouchScript.Layers.ProjectionParams projectionParams ) : Vector3
oldScreenPos1 Vector2 Finger one old screen position.
oldScreenPos2 Vector2 Finger two old screen position.
newScreenPos1 Vector2 Finger one new screen position.
newScreenPos2 Vector2 Finger two new screen position.
dR float Calculated delta rotation.
dS float Calculated delta scaling.
projectionParams TouchScript.Layers.ProjectionParams Layer projection parameters.
return Vector3

drawDebug() protected method

protected drawDebug ( int touchPoints ) : void
touchPoints int
return void

drawDebugDelayed() protected method

protected drawDebugDelayed ( int touchPoints ) : void
touchPoints int
return void

getNumPoints() protected method

Gets the number of points.
protected getNumPoints ( ) : int
return int

getPointPreviousScreenPosition() protected method

Returns previous screen position of a point with index 0 or 1
protected getPointPreviousScreenPosition ( int index ) : Vector2
index int The index.
return Vector2

getPointScreenPosition() protected method

Returns screen position of a point with index 0 or 1
protected getPointScreenPosition ( int index ) : Vector2
index int The index.
return Vector2

onBegan() protected method

protected onBegan ( ) : void
return void

onChanged() protected method

protected onChanged ( ) : void
return void

onRecognized() protected method

protected onRecognized ( ) : void
return void

relevantTouches1() protected method

Checks if there are touch points in the list which matter for the gesture.
protected relevantTouches1 ( IList touches ) : bool
touches IList List of touch points.
return bool

relevantTouches2() protected method

Checks if there are touch points in the list which matter for the gesture.
protected relevantTouches2 ( IList touches ) : bool
touches IList List of touch points.
return bool

reset() protected method

protected reset ( ) : void
return void

touchesBegan() protected method

protected touchesBegan ( IList touches ) : void
touches IList
return void

touchesEnded() protected method

protected touchesEnded ( IList touches ) : void
touches IList
return void

touchesMoved() protected method

protected touchesMoved ( IList touches ) : void
touches IList
return void

Property Details

angleBuffer protected property

Angle buffer.
protected float angleBuffer
return float

debugCoroutine protected property

protected Coroutine,UnityEngine debugCoroutine
return UnityEngine.Coroutine

debugID protected property

protected int debugID
return int

debugTouchSize protected property

protected Vector2 debugTouchSize
return Vector2

deltaPosition protected property

Calculated delta position.
protected Vector3 deltaPosition
return Vector3

deltaRotation protected property

Calculated delta rotation.
protected float deltaRotation
return float

deltaScale protected property

Calculated delta scale.
protected float deltaScale
return float

isTransforming protected property

Indicates whether transformation started;
protected bool isTransforming
return bool

minScreenPointsPixelDistance protected property

MinScreenPointsDistance in pixels for internal use.
protected float minScreenPointsPixelDistance
return float

minScreenPointsPixelDistanceSquared protected property

MinScreenPointsDistance squared in pixels for internal use.
protected float minScreenPointsPixelDistanceSquared
return float

scaleBuffer protected property

Scaling buffer.
protected float scaleBuffer
return float

screenPixelRotationBuffer protected property

Rotation buffer.
protected float screenPixelRotationBuffer
return float

screenPixelScalingBuffer protected property

Screen space scaling buffer.
protected float screenPixelScalingBuffer
return float

screenPixelTranslationBuffer protected property

Translation buffer.
protected Vector2 screenPixelTranslationBuffer
return Vector2

screenTransformPixelThreshold protected property

ScreenTransformThreshold in pixels.
protected float screenTransformPixelThreshold
return float

screenTransformPixelThresholdSquared protected property

ScreenTransformThreshold in pixels squared.
protected float screenTransformPixelThresholdSquared
return float