public FlverBoneInfo(NewAnimSkeleton_HKX.HkxBoneInfo copyFromHkx, List <NewAnimSkeleton_HKX.HkxBoneInfo> hkxBoneList, List <FlverBoneInfo> flverBoneList) { ApplyHkxBoneProperties(copyFromHkx, hkxBoneList, flverBoneList); BoundingBoxPrim = new DbgPrimWireBox(Transform.Default, Vector3.One * -0.01f, Vector3.One * 0.01f, DBG.COLOR_FLVER_BONE_BBOX) { Category = DbgPrimCategory.FlverBoneBoundingBox, }; //SpawnPrinter.AppendLine(Name, DBG.COLOR_FLVER_BONE); }
public void ApplyHkxBoneProperties(NewAnimSkeleton_HKX.HkxBoneInfo copyFromHkx, List <NewAnimSkeleton_HKX.HkxBoneInfo> hkxBoneList, List <FlverBoneInfo> flverBoneList) { Name = copyFromHkx.Name; ParentReferenceMatrix = copyFromHkx.ReferenceMatrix * Matrix.Invert(copyFromHkx.RelativeReferenceMatrix); ReferenceMatrix = copyFromHkx.ReferenceMatrix; CurrentMatrix = ReferenceMatrix; HkxBoneIndex = hkxBoneList.IndexOf(copyFromHkx); IsNub = false; ChildBones.Clear(); foreach (var ci in copyFromHkx.ChildIndices) { if (ci >= 0 && ci < hkxBoneList.Count) { var matchingFlverChildBone = flverBoneList.FirstOrDefault(b => b.Name == hkxBoneList[ci].Name); if (matchingFlverChildBone != null && !ChildBones.Contains(matchingFlverChildBone)) { ChildBones.Add(matchingFlverChildBone); } } } }