add: 添加新的控制思路
This commit is contained in:
parent
d901880eea
commit
479e64907f
|
@ -65,17 +65,12 @@ private void HipUpdate()
|
|||
|
||||
private void RShoulderUpdate()
|
||||
{
|
||||
var direction = _transforms[PoseLandmarkType.RightElbow]
|
||||
- _transforms[PoseLandmarkType.RightShoulder];
|
||||
var absolutelyRotation = Quaternion.LookRotation(direction);
|
||||
|
||||
var relativeRot = _transforms[PoseLandmarkType.RightElbow] - _transforms[PoseLandmarkType.RightShoulder];
|
||||
relativeRot.Normalize();
|
||||
|
||||
var hipRot = _animator.GetBoneTransform(HumanBodyBones.Hips).rotation;
|
||||
hipRot.Normalize();
|
||||
|
||||
var interal = Quaternion.FromToRotation(relativeRot, hipRot.eulerAngles);
|
||||
interal.Normalize();
|
||||
|
||||
_animator.GetBoneTransform(HumanBodyBones.RightUpperArm).rotation = interal; //Quaternion.LookRotation(relativeRot + hipRot);
|
||||
_animator.GetBoneTransform(HumanBodyBones.RightUpperArm).rotation
|
||||
= absolutelyRotation * Quaternion.Inverse(_animator.GetBoneTransform(HumanBodyBones.Hips).rotation);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user