本文整理汇总了C++中smartbody::SBScene::getCharacterNames方法的典型用法代码示例。如果您正苦于以下问题:C++ SBScene::getCharacterNames方法的具体用法?C++ SBScene::getCharacterNames怎么用?C++ SBScene::getCharacterNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smartbody::SBScene
的用法示例。
在下文中一共展示了SBScene::getCharacterNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateGUI
//.........这里部分代码省略.........
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);
}
// update characters
resourceTree->clear_children(getTreeFromName("character"));
const std::vector<std::string>& charNames = scene->getCharacterNames();
for (size_t i = 0; i < charNames.size(); i++)
{
SmartBody::SBCharacter* character = scene->getCharacter(charNames[i]);
resourceTree->sortorder(FL_TREE_SORT_ASCENDING);
updateCharacter(getTreeFromName("character"), character);
}
// for (SBPhysicsObjMap::iterator iter = phySim->getPhysicsObjMap().begin();
// iter != phySim->getPhysicsObjMap().end();
// iter++)
// {
// SBPhysicsObj* obj = (*iter).second;
// if (dynamic_cast<SbmJointObj*>(obj) == NULL)
// {
//
// }
// }
// update services
SmartBody::SBServiceManager* serviceManager = scene->getServiceManager();
std::map<std::string, SmartBody::SBService*>& serviceMap = serviceManager->getServices();
resourceTree->clear_children(getTreeFromName("service"));
for (std::map<std::string, SmartBody::SBService*>::iterator iter = serviceMap.begin();
iter != serviceMap.end();
iter++)
{
SmartBody::SBService* service = (*iter).second;
resourceTree->sortorder(FL_TREE_SORT_ASCENDING);
SmartBody::SBPhysicsManager* phyManager = dynamic_cast<SmartBody::SBPhysicsManager*>(service);
if (phyManager)
updatePhysicsManager(getTreeFromName("service"),phyManager);
else
updateService(getTreeFromName("service"), service);
}
// update behavior sets
resourceTree->clear_children(getTreeFromName("behaviorset"));
std::map<std::string, SmartBody::SBBehaviorSet*>& behaviorSets = scene->getBehaviorSetManager()->getBehaviorSets();
for (std::map<std::string, SmartBody::SBBehaviorSet*>::iterator iter = behaviorSets.begin();
iter != behaviorSets.end();
iter++)
{
SmartBody::SBBehaviorSet* behaviorSet = (*iter).second;
updateBehaviorSet(getTreeFromName("behaviorset"), behaviorSet);
}
_dirty = false;
if (_firstTime)
{
hideTree();
_firstTime = false;
}
}