// ボーン名をIDに置き換える public void SetBoneIDFromName(PmxFile pmd) { parent_node_id = pmd.GetBoneIDByName(ParentName); tail_node_id = pmd.GetBoneIDByName(TailName); target_node_id = pmd.GetBoneIDByName(TargetName); if (parent_node_id != -1) { // 親が捩りボーンなら軸固定を設定する PMD_Bone parent = pmd.nodes[parent_node_id]; if (parent.flags_hi == 0x04) { parent.axis = Vector3.Normalize(position - parent.position); } } }
// ボーン名をIDに置き換える public void SetBoneIDFromName(PmxFile pmd) { pmd.GetBoneByName(effector_node_name).IK = this; target_node_id = pmd.GetBoneIDByName(target_node_name); links.Clear(); foreach (string node_name in chain_node_names) { PMD_IKNode link = new PMD_IKNode(); link.node_id = pmd.GetBoneIDByName(node_name); if (node_name == "左ひざ" || node_name == "右ひざ") { link.constrain_angle = true; link.angle_min.X = Geometry.DegreeToRadian(-180f); link.angle_max.X = Geometry.DegreeToRadian(-0.5f); } links.Add(link); } }
// ボーン名をIDに置き換える public override void SetBoneIDFromName(PmxFile pmd) { // }
// ボーン名をIDに置き換える public override void SetBoneIDFromName(PmxFile pmd) { bone_id = pmd.GetBoneIDByName(bone_name); }
public abstract void SetBoneIDFromName(PmxFile pmd);