private Queue <BulkCalculator.DistanceCalculationJob> CreateContourQueue(double[] cDistances, System.Drawing.Color[] colors, int totalNumberPositions, int[] animationOrder, int numFramesPerStep) { Queue <BulkCalculator.DistanceCalculationJob> q = new Queue <BulkCalculator.DistanceCalculationJob>(); //need to create this for each position and every bone... for (int boneIndex = 0; boneIndex < WristFilesystem.NumBones; boneIndex++) { Bone referenceBone = _bones[boneIndex]; //we can only do this for valid color bones, so lets check that this is the case, if not, continue if (!referenceBone.IsValidBone || !referenceBone.IsColoredBone) { continue; } for (int i = 0; i < totalNumberPositions; i++) { BulkCalculator.DistanceCalculationJob job = new BulkCalculator.DistanceCalculationJob(); job.JobType = BulkCalculator.DistanceCalculationType.Contours; job.FullJoint = this; job.PrimaryBone = referenceBone; job.PositionIndex = i; job.ContourDistances = cDistances; job.ContourColors = colors; job.AnimationOrder = animationOrder; job.AnimationNumFramesPerStep = numFramesPerStep; q.Enqueue(job); } } return(q); }
private Queue <BulkCalculator.DistanceCalculationJob> CreateVertexDistanceQueue(int totalNumberPositions, int[] animationOrder, int numFramesPerStep, Bone fixedBone) { Queue <BulkCalculator.DistanceCalculationJob> q = new Queue <BulkCalculator.DistanceCalculationJob>(); //need to create this for each position and every bone... for (int boneIndex = 0; boneIndex < WristFilesystem.NumBones; boneIndex++) { Bone referenceBone = _bones[boneIndex]; //we can only do this for valid color bones, so lets check that this is the case, if not, continue if (!referenceBone.IsValidBone || !referenceBone.IsColoredBone) { continue; } Bone[] interactionBones = GetBonesThatInteractWithBone(boneIndex); for (int i = 0; i < totalNumberPositions; i++) { //check that we need to do this (can only skip when not in animation mode) if (animationOrder == null && referenceBone.HasVertexDistancesForPosition(i)) { continue; } BulkCalculator.DistanceCalculationJob job = new BulkCalculator.DistanceCalculationJob(); job.JobType = BulkCalculator.DistanceCalculationType.VetrexDistances; job.FullJoint = this; job.PrimaryBone = referenceBone; job.IneractionBones = interactionBones; job.PositionIndex = i; job.AnimationOrder = animationOrder; job.AnimationNumFramesPerStep = numFramesPerStep; job.FixedBone = fixedBone; q.Enqueue(job); } } return(q); }