/// <summary> /// /// </summary> /// <param name="frame"></param> /// <param name="skeleton"></param> public void UpdateSkeleton(float frame, GenericSkeleton skeleton) { foreach (var v in TransformNodes) { GenericBone bone = null; switch (v.HashType) { case AnimNodeHashType.Name: bone = skeleton.Bones.Find(e => e.Name == v.Name); break; case AnimNodeHashType.CRC32C: bone = skeleton.Bones.Find(e => e.NameHash == v.Hash); break; } if (bone != null) { bone.AnimatedTransform = v.GetTransformAt(frame, bone); } } }
/// <summary> /// /// </summary> /// <param name="Frame"></param> /// <param name="skeleton"></param> /// <returns></returns> public Matrix4 GetTransformAt(float Frame, GenericSkeleton skeleton) { return(GetTransformAt(Frame, skeleton.GetBoneByName(Name))); }