コード例 #1
0
ファイル: ReprWizard.cs プロジェクト: jorgejgnz/HPTK
        List <Point> GetPoints(BoneSearchEngine source)
        {
            List <Point> points; //ToList

            if (source is HandSearchEngine)
            {
                HandSearchEngine sourceAsHand = source as HandSearchEngine;
                points = sourceAsHand.hand.ToList();
                points.AddRange(sourceAsHand.specialPoints.ToList());
            }
            else if (source is BodySearchEngine)
            {
                BodySearchEngine sourceAsBody = source as BodySearchEngine;
                points = sourceAsBody.body.ToList();

                // Don't generate reprmodels for hands. They can only be generated when attached under a HandSearchEngine (requires rotation fix)
                points.RemoveAll(p => p.original == sourceAsBody.body.leftHandPoint.original || p.original == sourceAsBody.body.rightHandPoint.original);
            }
            else
            {
                points = source.GetPointsFromBones();
            }

            return(points);
        }
コード例 #2
0
ファイル: ReprWizard.cs プロジェクト: jorgejgnz/HPTK
        public void GenerateMissingReprModels()
        {
            if (!source)
            {
                source = GetComponent <BoneSearchEngine>();
            }

            if (source is BodySearchEngine && !(source as BodySearchEngine).body.IsValid())
            {
                Debug.LogError("Body has missing references. ReprModels cannot be generated");
                return;
            }
            else if (source is HandSearchEngine && !(source as HandSearchEngine).hand.IsValid())
            {
                Debug.LogError("Hand has missing references. ReprModels cannot be generated");
                return;
            }
            else if (source is HandSearchEngine && !(source as HandSearchEngine).hand.wristPoint.corrected && requiresCorrected)
            {
                Debug.LogError("Hand wrist has not been corrected. Fix rotations first");
                return;
            }
            else
            {
                GenerateMissingReprModels(source);
            }
        }
コード例 #3
0
ファイル: ReprWizard.cs プロジェクト: jorgejgnz/HPTK
        void GenerateMissingReprModels(BoneSearchEngine source)
        {
            List <Point> points = GetPoints(source);

            points.ForEach(p => GenerateReprModel(p, source.bones.Find(b => b.parent.original == p.original) == null));
        }