Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyAbsoluteBoneTransformsTo()

void Microsoft.Xna.Framework.Graphics.Model.CopyAbsoluteBoneTransformsTo ( Matrix[] destinationBoneTransforms)
inline

Definition at line 58 of file Model.cs.

59 {
60 if (destinationBoneTransforms == null)
61 {
62 throw new ArgumentNullException("destinationBoneTransforms");
63 }
64 if (destinationBoneTransforms.Length < bones.Count)
65 {
66 throw new ArgumentOutOfRangeException("destinationBoneTransforms");
67 }
68 int count = bones.Count;
69 for (int i = 0; i < count; i++)
70 {
71 ModelBone modelBone = bones[i];
72 if (modelBone.Parent == null)
73 {
74 ref Matrix reference = ref destinationBoneTransforms[i];
75 reference = modelBone.transform;
76 }
77 else
78 {
79 int index = modelBone.Parent.Index;
80 ref Matrix reference2 = ref destinationBoneTransforms[i];
81 reference2 = modelBone.transform * destinationBoneTransforms[index];
82 }
83 }
84 }

References Microsoft.Xna.Framework.Graphics.Model.bones, System.count, System.Collections.ObjectModel.ReadOnlyCollection< T >.Count, Microsoft.Xna.Framework.Graphics.ModelBone.Index, System.index, Microsoft.Xna.Framework.Graphics.ModelBone.Parent, and Microsoft.Xna.Framework.Graphics.ModelBone.transform.

Referenced by Microsoft.Xna.Framework.Graphics.Model.Draw().