public BoneHeadTail(HumanoidBones head, HumanoidBones tail, float xWidth = 0.05f, float zWidth = 0.05f) { Head = head; Tail = tail; TailOffset = Vector3.Zero; XWidth = xWidth; ZWidth = zWidth; }
public BoneHeadTail(HumanoidBones head, Vector3 tailOffset, float xWidth = 0.05f, float zWidth = 0.05f) { Head = head; Tail = HumanoidBones.unknown; TailOffset = tailOffset; XWidth = xWidth; ZWidth = zWidth; }
public float GetLength(HumanoidBones bone) { var head = (float)HeightMeter / 6; var upper = head * 2; var lower = HeightMeter / 2; var footHeight = head / 2; switch (bone) { case HumanoidBones.head: return(head); case HumanoidBones.neck: return(upper / 7); case HumanoidBones.chest: case HumanoidBones.spine: case HumanoidBones.hips: return(upper / 7 * 2); case HumanoidBones.leftUpperLeg: case HumanoidBones.rightUpperLeg: return(lower / 2); case HumanoidBones.leftLowerLeg: case HumanoidBones.rightLowerLeg: return(lower / 2 - footHeight); case HumanoidBones.leftFoot: case HumanoidBones.rightFoot: return(footHeight); case HumanoidBones.leftToes: case HumanoidBones.rightToes: return(footHeight * 1.5f); case HumanoidBones.leftShoulder: case HumanoidBones.rightShoulder: return(head / 2); case HumanoidBones.leftUpperArm: case HumanoidBones.leftLowerArm: case HumanoidBones.rightUpperArm: case HumanoidBones.rightLowerArm: return(head); case HumanoidBones.leftHand: case HumanoidBones.rightHand: return(head / 2); } throw new NotImplementedException(); }