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