private void OnTwoHandManipulationStarted(State newState)
 {
     if ((newState & State.Rotating) > 0)
     {
         m_rotateLogic.Setup(m_handsPressedLocationsMap, HostTransform);
     }
     if ((newState & State.Moving) > 0)
     {
         m_moveLogic.Setup(GetHandsCentroid(), HostTransform);
     }
 }
 private void OnTwoHandManipulationStarted(State newState)
 {
     if ((newState & State.Rotating) > 0)
     {
         m_rotateLogic.Setup(gazeHandHelper.GetHandPositionsDictionary());
     }
     if ((newState & State.Moving) > 0)
     {
         m_moveLogic.Setup(gazeHandHelper.GetHandsCentroid(), hostTransform);
     }
     if ((newState & State.Scaling) > 0)
     {
         m_scaleLogic.Setup(gazeHandHelper.GetHandPositionsDictionary(), hostTransform);
     }
 }
示例#3
0
        void OnTwoFingerGestureStarted()
        {
            m_TwoFingerTouchStartCentroid = new MixedRealityPose(ComputeInputCentroid());
            m_ObjectStartPose             = new MixedRealityPose(m_TargetTransform.position, m_TargetTransform.rotation);

            moveLogic.Setup(m_TwoFingerTouchStartCentroid, m_TwoFingerTouchStartCentroid.Position, m_ObjectStartPose, m_TargetTransform.localScale);

            Vector3 f1 = new Vector3(InputArray[0].x, 0f, InputArray[0].y);
            Vector3 f2 = new Vector3(InputArray[1].x, 0f, InputArray[1].y);

            rotationLogic.Setup(new Vector3[] { f1, f2 }, m_TargetTransform);
            scaleLogic.Setup(InputArray, m_TargetTransform);

            m_VelocityDirectionSamples.Clear();
            m_CurrentGestureType = GestureType.Multi;
        }
示例#4
0
    private void OnTwoHandManipulationStarted(ManipulationMode newState)
    {
#if UNITY_2017_2_OR_NEWER
        if ((newState & ManipulationMode.Rotate) > 0)
        {
            rotateLogic.Setup(handsPressedLocationsMap, hostTransform);
        }

        if ((newState & ManipulationMode.Move) > 0)
        {
            moveLogic.Setup(GetHandsCentroid(), hostTransform);
        }

        if ((newState & ManipulationMode.Scale) > 0)
        {
            scaleLogic.Setup(handsPressedLocationsMap, hostTransform);
        }
#endif // UNITY_2017_2_OR_NEWER
    }
        private void HandleTwoHandManipulationStarted(State newState)
        {
            var handPositionMap = GetHandPositionMap();

            targetRotationTwoHands = hostTransform.rotation;

            if ((newState & State.Rotating) > 0)
            {
                m_rotateLogic.Setup(handPositionMap, hostTransform, ConstraintOnRotation);
            }
            if ((newState & State.Moving) > 0)
            {
                m_moveLogic.Setup(GetPointersCentroid(), hostTransform.position);
            }
            if ((newState & State.Scaling) > 0)
            {
                m_scaleLogic.Setup(handPositionMap, hostTransform);
            }
        }