Unity/Unity 리서치

Touch.deltaposition

lipnus 2021. 6. 10. 15:19
반응형

Touch에서 position, deltaPosition은 둘다 Vector2

 

 

position

현재 터치 위치.

디바이스의 왼쪽하단이 (0,0)

x,y축 방향은 고등학교 수학의 1사분면과 같음.

 

deltaPosition

전 프레임에서의 터치 위치와 이번 프레임에서 터치위치의 차이

말 그대로 dX, dY

 

Touch.deltaPosition

Leave feedback

public Vector2 deltaPosition;

Description

The position delta since last change in pixel coordinates.

The absolute position of the touch is recorded periodically and available in the position property. The deltaPosition value is a Vector2 in pixel coordinates that represents the difference between the touch position recorded on the most recent update and that recorded on the previous update. The deltaTime value gives the time that elapsed between the previous and current updates; you can calculate the touch's speed of motion by dividing deltaPosition.magnitude by deltaTime.

See Also: deltaTime.

 

 

 


 

 

Touch Properties

altitudeAngle Value of 0 radians indicates that the stylus is parallel to the surface, pi/2 indicates that it is perpendicular.
azimuthAngle Value of 0 radians indicates that the stylus is pointed along the x-axis of the device.
deltaPosition The position delta since last change in pixel coordinates.
deltaTime Amount of time that has passed since the last recorded change in Touch values.
fingerId The unique index for the touch.
maximumPossiblePressure The maximum possible pressure value for a platform. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f.
phase Describes the phase of the touch.
position The position of the touch in screen space pixel coordinates.
pressure The current amount of pressure being applied to a touch. 1.0f is considered to be the pressure of an average touch. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f.
radius An estimated value of the radius of a touch. Add radiusVariance to get the maximum touch size, subtract it to get the minimum touch size.
radiusVariance This value determines the accuracy of the touch radius. Add this value to the radius to get the maximum touch size, subtract it to get the minimum touch size.
rawPosition The first position of the touch contact in screen space pixel coordinates.
tapCount Number of taps.
type A value that indicates whether a touch was of Direct, Indirect (or remote), or Stylus type.

 

반응형

'Unity > Unity 리서치' 카테고리의 다른 글

Camera Panning  (0) 2021.06.10
[RTS Engine] Camera관련 코드  (0) 2021.06.10
Mobile Pinch Zoom  (0) 2021.06.09
Mouse DoubleClick  (0) 2021.06.08
모바일 더블 터치(Mobile Double Touch) 구현  (0) 2021.06.06