예제 #1
0
        public void HandleData(Vector2 vet, HumanPoseType hpt)
        {
            HumanPoseNode hpn = stateManager.FindHumanPoseByType(hpt);
            Vector2       Mouse;

            Mouse.x      = Mathf.Clamp((vet.x - (Screen.width / 2)) / Screen.width * 2, -1, 1);
            Mouse.y      = Mathf.Clamp(-(vet.y - (Screen.height / 2)) / Screen.height * 2, -1, 1);
            screenInp    = Mouse;
            screenInp.x  = (screenInp.x + 1) * 0.5f;
            screenInp.y  = (-screenInp.y + 1) * 0.5f;
            screenInp.x *= Screen.width;
            screenInp.y *= Screen.height;

            Control(hpn);

            var c1 = new Color(1, 1, 0, trial_alpha);
            var c2 = new Color(1, 0, 0, trial_alpha);

            hpn.HP_Trail.startColor = c1;
            hpn.HP_Trail.endColor   = c2;
            hpn.HP_Trail.startWidth = 0.8f;
            hpn.HP_Trail.endWidth   = 0.8f;

            if (trial_alpha > 0)
            {
                trial_alpha -= Time.deltaTime;
            }
        }
예제 #2
0
 private void UpdatePose(HumanPoseType type)
 {
     if (_player.IsActiveHumanPose(type))
     {
         Pose      pose  = _player.GetHumanPose(type);
         Transform trans = GetTransform(type);
         trans.SetPositionAndRotation(pose.position, pose.rotation);
     }
 }
예제 #3
0
        private Transform GetTransform(HumanPoseType type)
        {
            switch (type)
            {
            case HumanPoseType.LeftHand:
                return(_leftHandTrans);

            case HumanPoseType.RightHand:
                return(_rightHandTrans);
            }

            return(null);
        }
예제 #4
0
        private Pose GetHumanPose(HumanPoseType type)
        {
            switch (type)
            {
            case HumanPoseType.Head:
                return(new Pose(_cameraRig.transform.position, _cameraRig.transform.rotation));

            case HumanPoseType.LeftHand:
                return(new Pose(GetHandPosition(HumanPoseType.LeftHand), GetHandRotation(HumanPoseType.LeftHand)));

            case HumanPoseType.RightHand:
                return(new Pose(GetHandPosition(HumanPoseType.RightHand), GetHandRotation(HumanPoseType.RightHand)));
            }

            return(default);
예제 #5
0
        private Pose GetHumanPose(HumanPoseType type)
        {
            switch (type)
            {
            case HumanPoseType.Head:
                return(new Pose(_cameraRig.transform.position, _cameraRig.transform.rotation));

            // NOTE: Hand tracking feature is comming soon.
            case HumanPoseType.LeftHand:
                return(new Pose(Vector3.zero, Quaternion.identity));

            case HumanPoseType.RightHand:
                return(new Pose(Vector3.zero, Quaternion.identity));
            }

            return(default);
예제 #6
0
 bool IPlayer.IsActiveHumanPose(HumanPoseType type) => false;
예제 #7
0
 Pose IPlayer.GetHumanLocalPose(HumanPoseType type) => default;
예제 #8
0
 bool IPlayer.IsActiveHumanPose(HumanPoseType type) => IsActiveHumanPose(type);
예제 #9
0
 Pose IPlayer.GetHumanLocalPose(HumanPoseType type) => GetHumanLocalPose(type);
예제 #10
0
 public HumanPoseNode FindHumanPoseByType(HumanPoseType hpt)
 {
     return(lstHuamPose[hpt]);
 }