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; } }
private void UpdatePose(HumanPoseType type) { if (_player.IsActiveHumanPose(type)) { Pose pose = _player.GetHumanPose(type); Transform trans = GetTransform(type); trans.SetPositionAndRotation(pose.position, pose.rotation); } }
private Transform GetTransform(HumanPoseType type) { switch (type) { case HumanPoseType.LeftHand: return(_leftHandTrans); case HumanPoseType.RightHand: return(_rightHandTrans); } return(null); }
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);
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);
bool IPlayer.IsActiveHumanPose(HumanPoseType type) => false;
Pose IPlayer.GetHumanLocalPose(HumanPoseType type) => default;
bool IPlayer.IsActiveHumanPose(HumanPoseType type) => IsActiveHumanPose(type);
Pose IPlayer.GetHumanLocalPose(HumanPoseType type) => GetHumanLocalPose(type);
public HumanPoseNode FindHumanPoseByType(HumanPoseType hpt) { return(lstHuamPose[hpt]); }