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


C++ SBScene::getAssetManager方法代码示例

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


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

示例1: updateScriptFiles

void ResourceWindow::updateScriptFiles( Fl_Tree_Item* tree, std::string pname )
{	
	SmartBody::SBScene* scene = SmartBody::SBScene::getScene();
	const std::vector<std::string>& scriptPaths = scene->getAssetManager()->getAssetPaths("script");
	
	for (std::vector<std::string>::const_iterator pathIter = scriptPaths.begin();
		 pathIter != scriptPaths.end(); 
		 pathIter++)
	{
		boost::filesystem::path path(*pathIter);
		if (boost::filesystem::is_directory(path))
		{
			boost::filesystem::directory_iterator end;
			for (boost::filesystem::directory_iterator iter(path); iter != end; iter++)
			{
				const boost::filesystem::path& cur = (*iter);
				std::string ext = boost::filesystem::extension( cur );
				if (ext == ".seq" || ext == ".SEQ" || ext == ".py" || ext == ".PY")
				{
					std::string fileName = boost::filesystem::basename(cur);
					if (tree->find_child(fileName.c_str()) == -1) // if the script name does not exist in the tree list
					{
						Fl_Tree_Item* item = resourceTree->add(tree, fileName.c_str());						
					}
				}
			}
		}
	}
}
开发者ID:gsi-upm,项目名称:SmartSim,代码行数:29,代码来源:ResourceWindow.cpp

示例2: SBM_SBAssetManager_LoadMotion

SBAPI bool SBM_SBAssetManager_LoadMotion( SBMHANDLE sbmHandle, const void * data, int sizeBytes, const char * motionName )
{
   if ( !SBM_HandleExists( sbmHandle ) )
   {
      return false;
   }

   SmartBody::SBScene * scene = SmartBody::SBScene::getScene();
   SmartBody::SBAssetManager * assetManager = scene->getAssetManager();

   int ret = assetManager->load_motion( data, sizeBytes, motionName );
   return ret == CMD_SUCCESS;
}
开发者ID:gsi-upm,项目名称:SmartSim,代码行数:13,代码来源:smartbody-c-dll.cpp

示例3: updateGUI

void ResourceWindow::updateGUI()
{

	SmartBody::SBScene* scene = SmartBody::SBScene::getScene();
	SmartBody::SBAssetManager* assetManager = scene->getAssetManager();

	resourceTree->sortorder(FL_TREE_SORT_ASCENDING);	
	// update path tree	
	updatePath(getTreeFromName("script path"), SmartBody::SBScene::getScene()->getAssetPaths("script"));	
	updatePath(getTreeFromName("motion path"), SmartBody::SBScene::getScene()->getAssetPaths("motion"));	
	updatePath(getTreeFromName("audio path"), SmartBody::SBScene::getScene()->getAssetPaths("audio"));	
	updatePath(getTreeFromName("mesh path"), SmartBody::SBScene::getScene()->getAssetPaths("mesh"));	
	

	// update sequence file list

	const std::vector<std::string> scriptPaths = SmartBody::SBScene::getScene()->getAssetPaths("script");
	resourceTree->clear_children(getTreeFromName("scriptfiles"));
	for (size_t p = 0; p < scriptPaths.size(); p++)
	{
		updateScriptFiles(getTreeFromName("scriptfiles"), scriptPaths[p]);
	}	

	// update runtime scripts
	resourceTree->clear_children(getTreeFromName("script"));
	std::vector<std::string> scriptName = scene->getScriptNames();
	for (size_t i = 0; i < scriptName.size(); i++)
	{
		SmartBody::SBScript* script = scene->getScript(scriptName[i]);
		updateScript(getTreeFromName("script"), script);
	}

	// update skeleton
	resourceTree->clear_children(getTreeFromName("skeleton"));
	std::vector<std::string> skeletons = scene->getSkeletonNames();
	for (size_t c = 0; c < skeletons.size(); c++)
	{
		SmartBody::SBSkeleton * skel = scene->getSkeleton(skeletons[c]);
		updateSkeleton(getTreeFromName("skeleton"), skel);
	}

	// update joint maps
	resourceTree->clear_children(getTreeFromName("jointmap"));	
	SmartBody::SBJointMapManager* jointMapManager = scene->getJointMapManager();
	std::vector<std::string> jointMapNames = jointMapManager->getJointMapNames();
	for (std::vector<std::string>::iterator iter = jointMapNames.begin();
		 iter != jointMapNames.end(); 
		 iter++)
	{
		Fl_Tree_Item* boneMapItem = resourceTree->add(getTreeFromName("jointmap"), (*iter).c_str());
		updateJointMap(boneMapItem, jointMapManager->getJointMap((*iter)));
	}

	// update gesture maps
	resourceTree->clear_children(getTreeFromName("gesturemap"));
	SmartBody::SBGestureMapManager* gestureMapManager = scene->getGestureMapManager();
	std::vector<std::string> gestureMapNames = gestureMapManager->getGestureMapNames();
	for (std::vector<std::string>::iterator iter = gestureMapNames.begin();
		 iter != gestureMapNames.end(); 
		 iter++)
	{
		Fl_Tree_Item* gestureMapItem = resourceTree->add(getTreeFromName("gesturemap"), (*iter).c_str());
		updateGestureMap(gestureMapItem, gestureMapManager->getGestureMap((*iter)));
	}

	// update motion map
	resourceTree->clear_children(getTreeFromName("motion"));
	std::vector<std::string> motionNames = scene->getMotionNames();
	for (size_t i = 0; i < motionNames.size(); i++)
	{
		//resourceTree->add(treeItemList[ITEM_MOTION],mi->first.c_str());
		SmartBody::SBMotion * motion = scene->getMotion(motionNames[i]);
		updateMotion(getTreeFromName("motion"), motion);
	}

	SmartBody::SBAnimationBlendManager* blendManager = scene->getBlendManager();
	// 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++)
//.........这里部分代码省略.........
开发者ID:gsi-upm,项目名称:SmartSim,代码行数:101,代码来源:ResourceWindow.cpp


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