private static GetVerticalOffset ( Vector3 p1, Vector3 p2, |
||
p1 | Vector3 | |
p2 | Vector3 | |
rotation | ||
return | float |
private static bool RootHeightWarning(BipedReferences references, ref string warningMessage) { if (references.head == null) { return(false); } float verticalOffset = BipedReferences.GetVerticalOffset(references.head.position, references.leftFoot.position, references.root.rotation); if (BipedReferences.GetVerticalOffset(references.root.position, references.leftFoot.position, references.root.rotation) / verticalOffset > 0.2f) { warningMessage = "Biped's root Transform's position should be at ground level relative to the character (at the character's feet not at it's pelvis)."; return(true); } return(false); }
private static bool CheckRootHeightWarning(BipedReferences references, bool log) { if (references.head == null) { return(true); } float verticalOffset = BipedReferences.GetVerticalOffset(references.head.position, references.leftFoot.position, references.root.rotation); float verticalOffset2 = BipedReferences.GetVerticalOffset(references.root.position, references.leftFoot.position, references.root.rotation); if (verticalOffset2 / verticalOffset > 0.2f) { if (log) { Warning.Log("Biped's root Transform's position should be at ground level relative to the character (at the character's feet not at it's pelvis).", references.root, true); } return(false); } return(true); }