浏览代码

Added some more hints in ProcessAnimation to guide people along when

implementing job.
/main
Simon Bouvier-Zappa 5 年前
当前提交
085daf2a
共有 2 个文件被更改,包括 32 次插入5 次删除
  1. 28
      Assets/AnimationRiggingWorkshop/Constraints/TwistChainStep0.cs
  2. 9
      Assets/AnimationRiggingWorkshop/Constraints/TwistChainStep1.cs

28
Assets/AnimationRiggingWorkshop/Constraints/TwistChainStep0.cs


public void ProcessRootMotion(AnimationStream stream) {}
public void ProcessAnimation(AnimationStream stream) {}
public void ProcessAnimation(AnimationStream stream)
{
// 1. Retrieve root and tip rotation.
// q1 <- ROOT_TARGET_ROTATION
// q2 <- TIP_TARGET_ROTATION
// 2. Interpolate rotation on chain.
// FOREACH(transform in chain)
// transform.rotation <- LERP(transform.rotation, LERP(q1, q2, w), jobWeight)
// 3. Update position of tip handle for easier visualization.
// ROOT_TARGET_POSITION <- ROOT_CHAIN_POSITION
// TIP_TARGET_POSITION <- TIP_CHAIN_POSITION
}
}
[System.Serializable]

{
public override TwistChainStep0Job Create(Animator animator, ref TwistChainStep0Data data, Component component)
{
// Build Job.
// 1. Retrieve chain in-between root and tip transforms.
// ...
// 2. Extract steps from chain.
// ...
// 3. Build Job.
// ...
// 4. Set values in NativeArray.
// ...
return job;
}

9
Assets/AnimationRiggingWorkshop/Constraints/TwistChainStep1.cs


public void ProcessAnimation(AnimationStream stream)
{
// 1. Retrieve root and tip rotation.
// ...
// q1 <- ROOT_TARGET_ROTATION
// q2 <- TIP_TARGET_ROTATION
// ...
// FOREACH(transform in chain)
// transform.rotation <- LERP(transform.rotation, LERP(q1, q2, w), jobWeight)
// ...
// ROOT_TARGET_POSITION <- ROOT_CHAIN_POSITION
// TIP_TARGET_POSITION <- TIP_CHAIN_POSITION
}
}

正在加载...
取消
保存