Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float length = (dest.position-source.position);
- for (int n=1; n < numBones-1; ++n) {
- float i = Mathf.InverseLerp(0,numBones,n);
- float si = Mathf.SmoothStep(i);
- float sourceLine = source.position + source.forward * length * i;
- float destLine = dest.position - dest.forward * length * (1-i);
- Vector3 pos = Vector3.Lerp( sourceLine, destLine, si);
- Quaternion rot = Quaternion.Slerp( source.rotation, dest.rotation, si);
- }
Advertisement
Add Comment
Please, Sign In to add comment