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


C++ MeshObject::AddChild方法代码示例

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


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

示例1: restFile

bool VART::Human::LoadFromFile(const string& fileName)
{
    XmlScene scene;
    bool result = scene.LoadFromFile(fileName);
    if (result) // if no read errors
    {
        // Detach human's root joint from local scene and add it to self
        hipJointPtr = dynamic_cast<Joint*>(scene.GetObjects().front());
        orientation.AddChild(*hipJointPtr);
        scene.Unreference(hipJointPtr);

        // Find smaller vertex on front right foot
        MeshObject* rightFootFingersMeshPtr =
                       dynamic_cast<MeshObject*>(hipJointPtr->FindChildByName("R_footfingersMesh"));
        assert(rightFootFingersMeshPtr != NULL);
        hipJointPtr->FindPathTo(rightFootFingersMeshPtr, &pathToRFoot);
        Point4D::xWeight = 0.1;
        Point4D::yWeight = 3;
        Point4D::zWeight = 2;
        Point4D::operatorLess = &Point4D::WeightedLess;
        rightFootFingersMeshPtr->SmallerVertex(&rfFront); // Compute right foot front
        ResetPosition();

        // Find smaller vertex on front left foot
        MeshObject* leftFootFingersMeshPtr =
                       dynamic_cast<MeshObject*>(hipJointPtr->FindChildByName("L_footfingersMesh"));
        assert(leftFootFingersMeshPtr != NULL);
        hipJointPtr->FindPathTo(leftFootFingersMeshPtr, &pathToLFoot);
        Point4D::xWeight = -0.1;
        Point4D::yWeight = 3;
        Point4D::zWeight = 2;
        leftFootFingersMeshPtr->SmallerVertex(&lfFront); // Compute left foot front
        Point4D::operatorLess = &Point4D::LexicographicalLess;
        Dot* leftFootFrontDotPtr = new Dot(lfFront); // debug only
        leftFootFrontDotPtr->color = Color::RED();
        leftFootFingersMeshPtr->AddChild(*leftFootFrontDotPtr);
        stickPositionPtr = &lfFront;
        pathToStickPosPtr = &pathToLFoot;

        // Load Rest Action
        std::string restFile("");
        restFile = VART::File::GetPathFromString(fileName) + "rest.xml";
        restPtr = LoadAction(restFile);
        if (restPtr)
        {
            restPtr->SetPriority(1);
            restPtr->Activate();
            //~ restPtr->SetSpeed(3);
        }
        // Load Breeth Action
        std::string breethFile("");
        breethFile = VART::File::GetPathFromString(fileName) + "breathe.xml";
        breathePtr = LoadAction(breethFile);
        if (breathePtr)
        {
            breathePtr->SetPriority(2);
            breathePtr->Activate();
        }
    }
    return result;
}
开发者ID:haschmitt,项目名称:iV-ART,代码行数:61,代码来源:human.cpp


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