Created
June 27, 2015 19:59
-
-
Save LordNed/336cd41e30ddafdd9909 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void BuildSkeletonRecursive(SceneNode node, List<SkeletonBone> skeleton, List<SkeletonBone> rawJoints, int parentJointIndex) | |
{ | |
switch(node.Type) | |
{ | |
case J3DFileResource.HierarchyDataTypes.NewNode: | |
parentJointIndex = skeleton.Count - 1; | |
break; | |
case J3DFileResource.HierarchyDataTypes.Joint: | |
var joint = rawJoints[node.Value]; | |
if(parentJointIndex < skeleton.Count) | |
joint.Parent = skeleton[parentJointIndex]; | |
skeleton.Add(joint); | |
break; | |
} | |
foreach (SceneNode child in node.Children) | |
BuildSkeletonRecursive(child, skeleton, rawJoints, parentJointIndex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment