예제 #1
0
        /// <summary>
        /// Ons touch up.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <param name="touchData">The touch data.</param>
        private void OnTouchUp(int index, TouchManager.TouchElement touchData)
        {
            int touchCount = TouchManager.Instance.TouchsActive;
            if (touchCount < 1)
            {
                isMoving = false;

                if (RotationType == RotationMode.OneFinger)
                    isRotating = false;

            }
            else if (touchCount < 2)
            {
                if (RotationType == RotationMode.TwoFingers || RotationType == RotationMode.Angle)
                    isRotating = false;

                isScaling = false;
            }
        }
예제 #2
0
        /// <summary>
        /// Ons touch down.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <param name="touchData">The touch data.</param>
        private void OnTouchDown(int index, TouchManager.TouchElement touchData)
        {
            int touchCount = TouchManager.Instance.TouchsActive;

            ARObject hitObject = null;
            if (TranslationType == TranslationMode.Grab)
                hitObject = SelectionManager.Instance.GetObjectHit();
            else
                hitObject = selectedObject;

            if (touchCount == 1)
            {
                if (hitObject != null)
                {
                    isRotating = false;
                    isMoving = true;
                    isScaling = false;

                    if (RotationType == RotationMode.OneFinger)
                        isRotating = true;
                }
                else
                    isMoving = false;
            }
            else if (touchCount == 2)
            {
                isRotating = false;
                isMoving = false;
                isScaling = true;

                if (RotationType == RotationMode.TwoFingers || RotationType == RotationMode.Angle)
                    isRotating = true;
            }

            if (isRotating)
                SetInitialRotation();

            if (isScaling)
                SetInitialScale();
        }