public List <NPVoxBox> GetCurrentSelectedChildBoxes()
    {
        List <NPVoxBox> allBoxes = new List <NPVoxBox>();

        NPVoxBone[] bones = CurrentEditedBone.GetDescendants(AllBones);
        foreach (NPVoxBone bone in bones)
        {
            allBoxes.AddRange(GetBoxes(bone));
        }
        allBoxes.AddRange(GetBoxes(CurrentEditedBone));
        return(allBoxes);
    }
예제 #2
0
    public static uint GetMaskWithDescendants(ref NPVoxBone[] allBones, uint mask)
    {
        uint completeMask = mask;

        for (int i = 0; i < 32; i++)
        {
            int id = i + 1;
            if (((mask >> i) & 0x1) != 0)
            {
                NPVoxBone bone = GetBoneByID(ref allBones, id);
                if (bone != null)
                {
                    NPVoxBone[] descendants = bone.GetDescendants(allBones);
                    foreach (NPVoxBone descendant in descendants)
                    {
                        completeMask |= (1u << (descendant.ID - 1));
                    }
                }
            }
        }

        return(completeMask);
    }