本文整理汇总了C++中smartbody::SBScene::getFaceDefinition方法的典型用法代码示例。如果您正苦于以下问题:C++ SBScene::getFaceDefinition方法的具体用法?C++ SBScene::getFaceDefinition怎么用?C++ SBScene::getFaceDefinition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smartbody::SBScene
的用法示例。
在下文中一共展示了SBScene::getFaceDefinition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initCharacterFaceDefinition
void SBDebuggerUtility::initCharacterFaceDefinition(const std::string& characterName, const std::string& faceDefName, const std::string& message)
{
SmartBody::SBScene* sbScene = SmartBody::SBScene::getScene();
SmartBody::SBCharacter* sbCharacter = sbScene->getCharacter(characterName);
if (!sbCharacter)
return;
SmartBody::SBFaceDefinition* faceDef = sbScene->getFaceDefinition(faceDefName);
if (!faceDef)
return;
sbCharacter->setFaceDefinition(faceDef);
}
示例2: updateGUI
//.........这里部分代码省略.........
// update animation blend map
resourceTree->clear_children(getTreeFromName("blend"));
std::vector<std::string> blendNames = blendManager->getBlendNames();
for (size_t i = 0; i < blendNames.size(); i++)
{
//resourceTree->add(treeItemList[ITEM_MOTION],mi->first.c_str());
SmartBody::SBAnimationBlend * blend = blendManager->getBlend(blendNames[i]);
updateAnimationBlend(getTreeFromName("blend"), blend);
}
// update blend transition map
resourceTree->clear_children(getTreeFromName("transition"));
std::vector<std::string> transitionNames = blendManager->getTransitionNames();
for (size_t i = 0; i < transitionNames.size(); i++)
{
//resourceTree->add(treeItemList[ITEM_MOTION],mi->first.c_str());
SmartBody::SBAnimationTransition * transition = blendManager->getTransitionByName(transitionNames[i]);
updateBlendTransition(getTreeFromName("transition"), transition);
}
// update mesh map
resourceTree->clear_children(getTreeFromName("mesh"));
std::vector<std::string> meshNames = assetManager->getDeformableMeshNames();
for (size_t i = 0; i < meshNames.size(); i++)
{
DeformableMesh* mesh = assetManager->getDeformableMesh(meshNames[i]);
Fl_Tree_Item* meshItem = resourceTree->add(getTreeFromName("mesh"), mesh->getName().c_str());
updateMesh(meshItem, mesh);
}
// update face definition map
resourceTree->clear_children(getTreeFromName("facedefinition"));
std::vector<std::string> faceNames = scene->getFaceDefinitionNames();
for (size_t i = 0; i < faceNames.size(); i++)
{
//resourceTree->add(treeItemList[ITEM_MOTION],mi->first.c_str());
SmartBody::SBFaceDefinition * face = scene->getFaceDefinition(faceNames[i]);
if (!face)
continue;
Fl_Tree_Item* faceTree = resourceTree->add(getTreeFromName("facedefinition"), face->getName().c_str());
updateFaceDefinition(faceTree, face);
}
// update event handler list
SmartBody::SBEventManager* eventManager = SmartBody::SBScene::getScene()->getEventManager();
std::map<std::string, SmartBody::SBEventHandler*>& eventMap = eventManager->getEventHandlers();
std::map<std::string, SmartBody::SBEventHandler*>::iterator ei;
resourceTree->clear_children(getTreeFromName("eventhandler"));
for ( ei = eventMap.begin();
ei != eventMap.end();
ei++)
{
updateEventHandler(getTreeFromName("eventhandler"), ei->second);
}
// Below are instance objects :
// update pawn objects
resourceTree->clear_children(getTreeFromName("pawn"));
const std::vector<std::string>& pawnNames = scene->getPawnNames();
for (size_t i = 0; i < pawnNames.size(); i++)
{
SmartBody::SBPawn* pawn = scene->getPawn(pawnNames[i]);
updatePawn(getTreeFromName("pawn"), pawn);
}