Version: 2022.1
언어: 한국어
public void SolveIK ();

설명

Execute the IK solver.

The humanoid IK solver is executed using the IK goal position, rotation, and weight currently set in the AnimationHumanStream.

using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Animations;

public struct IKJob : IAnimationJob { public TransformSceneHandle effector; public PropertySceneHandle positionWeight; public PropertySceneHandle rotationWeight;

public void ProcessRootMotion(AnimationStream stream) {}

public void ProcessAnimation(AnimationStream stream) { AnimationHumanStream humanStream = stream.AsHuman(); if (effector.IsValid(stream) && positionWeight.IsValid(stream) && rotationWeight.IsValid(stream)) { humanStream.SetGoalPosition(AvatarIKGoal.LeftFoot, effector.GetPosition(stream)); humanStream.SetGoalRotation(AvatarIKGoal.LeftFoot, effector.GetRotation(stream)); humanStream.SetGoalWeightPosition(AvatarIKGoal.LeftFoot, positionWeight.GetFloat(stream)); humanStream.SetGoalWeightRotation(AvatarIKGoal.LeftFoot, rotationWeight.GetFloat(stream)); }

humanStream.SolveIK(); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961