Skip to content

Commit

Permalink
rename ancestorNode
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed Dec 23, 2024
1 parent 0bf91a8 commit ed9e36f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Xna.Framework.Content.Pipeline.Graphics/OpenAssetImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -954,26 +954,26 @@ private static void GetSubtree(Node aiNode, List<Node> list)
/// Gets the transform of node relative to a specific ancestor node.
/// </summary>
/// <param name="node">The node.</param>
/// <param name="ancestor">The ancestor node. Can be <see langword="null"/>.</param>
/// <param name="ancestorNode">The ancestor node. Can be <see langword="null"/>.</param>
/// <returns>
/// The relative transform. If <paramref name="ancestor"/> is <see langword="null"/> the
/// The relative transform. If <paramref name="ancestorNode"/> is <see langword="null"/> the
/// absolute transform of <paramref name="node"/> is returned.
/// </returns>
private static Matrix4x4 GetRelativeTransform(Node node, Node ancestor)
private static Matrix4x4 GetRelativeTransform(Node node, Node ancestorNode)
{
Debug.Assert(node != null);

// Get transform of node relative to ancestor.
Matrix4x4 transform = node.Transform;
Node parent = node.Parent;
while (parent != null && parent != ancestor)
while (parent != null && parent != ancestorNode)
{
transform = transform * parent.Transform;
parent = parent.Parent;
}

if (parent == null && ancestor != null)
throw new ArgumentException(String.Format("Node \"{0}\" is not an ancestor of \"{1}\".", ancestor.Name, node.Name));
if (parent == null && ancestorNode != null)
throw new ArgumentException(String.Format("Node \"{0}\" is not an ancestor of \"{1}\".", ancestorNode.Name, node.Name));

return transform;
}
Expand Down

0 comments on commit ed9e36f

Please sign in to comment.