protected static float GetTension(Quaternion restRotation, TargetedBone targetedBone) { float angle = Quaternion.Angle(restRotation, targetedBone.bone.targetRotation); float wristTension = GetTensionFromAngle(angle, targetedBone.bone.maxAngle); return(wristTension); }
public static void GetDefaultTargetBone(Animator rig, ref Transform boneTransform, Bone boneID, params string[] boneNames) { GetDefaultBone(rig, ref boneTransform, boneID, boneNames); if (boneTransform == null) { boneTransform = TargetedBone.NewTargetTransform(boneID.ToString()); } }
//private void DrawTensions() { // if (bones == null || humanoid == null || !humanoid.showMuscleTension) // return; // foreach (TargetedBone bone in bones) // DrawTensionGizmo(bone); //} protected virtual void DrawTensionGizmo(TargetedBone targetedBone) { if (targetedBone.bone.transform == null) { return; } float tension = targetedBone.GetTension(); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(targetedBone.bone.transform.position, tension * 0.05F); }
public TargetedBone(TargetedBone _nextBone) { nextBone = _nextBone; }
public static void DrawAvatarBone(TargetedBone bone, Vector3 direction) { DrawAvatarBone(bone.bone, direction); }
public static void DrawTargetBone(TargetedBone bone, Vector3 direction) { DrawTargetBone(bone.target, direction); }