当前位置: 首页>>代码示例>>C++>>正文


C++ List::CopyList方法代码示例

本文整理汇总了C++中List::CopyList方法的典型用法代码示例。如果您正苦于以下问题:C++ List::CopyList方法的具体用法?C++ List::CopyList怎么用?C++ List::CopyList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在List的用法示例。


在下文中一共展示了List::CopyList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReverseLoop

void  Triangulator::ReverseLoop(List<PolyLine> &Loop)
{
    List<PolyLine> NewLoop;
    NewLoop.SetSize(Loop.Num());

    for(int i=Loop.Num()-1, j=0; i>=0; i--, j++)
    {
        NewLoop[i].v1 = Loop[j].v2;
        NewLoop[i].v2 = Loop[j].v1;
        NewLoop[i].lineData = Loop[j].lineData;
    }

    Loop.CopyList(NewLoop);
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:14,代码来源:Triangulator.cpp

示例2: SetNewLoopStartPosition

void  Triangulator::SetNewLoopStartPosition(List<PolyLine> &Loop, DWORD pos)
{
    List<PolyLine> NewLoop;
    NewLoop.SetSize(Loop.Num());

    for(DWORD i=0; i<Loop.Num(); i++)
    {
        DWORD newPos = i+pos;

        if(newPos >= Loop.Num())
            newPos -= Loop.Num();

        NewLoop[i] = Loop[newPos];
    }

    Loop.CopyList(NewLoop);
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:17,代码来源:Triangulator.cpp

示例3: LoadAnimations


//.........这里部分代码省略.........
                    {
                        if(bestVertWeights[k] < bestWeight)
                        {
                            removeBone = bones[k];
                            removeBoneID = k;
                            bestWeight = bestVertWeights[k];
                        }
                    }

                    for(int k=0; k<3; k++)
                    {
                        VertAnimInfo &info = vertInfo[triVertIDs[k]];
                        UINT id = info.bones.FindValueIndex(removeBone);
                        if(id == INVALID) continue;

                        float weightAdjust = 1.0f/(1.0f-info.weights[id]);
                        info.weights.Remove(id);
                        info.bones.Remove(id);

                        for(int l=0; l<info.weights.Num(); l++)
                            info.weights[l] *= weightAdjust;
                    }

                    bones.Remove(removeBoneID);
                    bestVertWeights.Remove(removeBoneID);
                }
            }
        }

        //--------- 
        // sort out sections of triangles that are influenced up to a max of 4 bones
        // also, duplicate shared verts
        VBData *newVBD = new VBData;
        newVBD->CopyList(*vbd);

        newVBD->TVList.SetSize(2);
        newVBD->TVList[1].SetWidth(4);
        newVBD->TVList[1].SetSize(nVerts);

        List<SubSectionInfo> newSubSections;

        for(int i=0; i<nSections; i++)
        {
            List<TriBoneInfo> triInfo;

            DrawSection &section = SectionList[i];
            if(!section.numFaces) continue;

            for(int j=0; j<section.numFaces; j++)
            {
                UINT *triVertIDs = &indices[(section.startFace+j)*3];

                TriBoneInfo &newTri = *triInfo.CreateNew();

                for(int k=0; k<3; k++)
                {
                    VertAnimInfo &info = vertInfo[triVertIDs[k]];

                    for(int l=0; l<info.bones.Num(); l++)
                        newTri.bones.SafeAdd(info.bones[l]);
                }
            }

            BitList UsedTris;
            UsedTris.SetSize(section.numFaces);
            DWORD nUsedTris = 0;
开发者ID:alanzw,项目名称:JimEngine,代码行数:67,代码来源:Mesh.cpp

示例4: ConnectChibiLoops

void  Triangulator::ConnectChibiLoops(ChibiLoopNode &loopNode, List<LoopVerts> &LoopList, List<LoopVerts> &NewLoopList)
{
    DWORD i, j, k, l;

    List<PolyLine> CurLoop;
    CurLoop.CopyList(LoopList[loopNode.loop]);

    if(!ChibiLoopFacingUp(CurLoop))
        ReverseLoop(CurLoop);

    List<DWORD> AlreadyUsed;

    for(i=0; i<loopNode.Children.Num(); i++)
    {
        ChibiLoopNode &childNode = loopNode.Children[i];
        List<PolyLine> &childLoop = LoopList[childNode.loop];

        if(ChibiLoopFacingUp(childLoop))
            ReverseLoop(childLoop);
    }

    List<DWORD> CurChildren;
    CurChildren.SetSize(loopNode.Children.Num());
    for(i=0; i<loopNode.Children.Num(); i++)
        CurChildren[i] = i;

    i = 0;

    while(CurChildren.Num())
    {
        ChibiLoopNode &childNode = loopNode.Children[CurChildren[i]];
        List<PolyLine> &childLoop = LoopList[childNode.loop];

        //---------------------------------------------
        // find closest points between loops

        DWORD curBestChoiceLoop1 = INVALID;
        DWORD curBestChoiceLoop2 = INVALID;
        float closestPos = 0.0f;

        for(j=0; j<CurLoop.Num(); j++)
        {
            if(AlreadyUsed.FindValueIndex(CurLoop[j].v1) != INVALID)
                continue;

            Vect2 &v1 = Verts[CurLoop[j].v1];

            for(k=0; k<childLoop.Num(); k++)
            {
                if(AlreadyUsed.FindValueIndex(childLoop[k].v1) != INVALID)
                    continue;

                Vect2 &v2 = Verts[childLoop[k].v1];

                BOOL bBadChoice = LineIntersectsShape(v1, v2, CurLoop);

                if(bBadChoice)
                    continue;

                for(l=0; l<CurChildren.Num(); l++)
                {
                    if(LineIntersectsShape(v1, v2, LoopList[loopNode.Children[CurChildren[l]].loop]))
                    {
                        bBadChoice = TRUE;
                        break;
                    }
                }

                if(bBadChoice)
                    continue;

                float dist = v2.Dist(v1);

                if((curBestChoiceLoop1 != INVALID) && (dist > closestPos))
                    continue;

                closestPos = dist;
                curBestChoiceLoop1 = j;
                curBestChoiceLoop2 = k;
            }
        }

        if(curBestChoiceLoop1 == INVALID)
        {
            i = (i == CurChildren.Num()-1) ? 0 : (i+1);
            if(i == 0)
            {
                AppWarning(TEXT("...almost infinitely looped there.  Fortunately I have measures against such devious things."));
                break;
            }
            continue;
        }

        AlreadyUsed << CurLoop[curBestChoiceLoop1].v1;
        AlreadyUsed << childLoop[curBestChoiceLoop2].v1;

        //---------------------------------------------
        // connect loops

        if(CurLoop[0].lineData && !childLoop[0].lineData)
//.........这里部分代码省略.........
开发者ID:alanzw,项目名称:JimEngine,代码行数:101,代码来源:Triangulator.cpp


注:本文中的List::CopyList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。