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