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


C++ MetaObject::getObjectName方法代码示例

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


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

示例1: sqrt

bool	
AgentNet::readyToGo(iPAR* cfipar)
{
	// is this the timing such that this ipar is ready to be executed?
	double tempTime = cfipar->getStartTime(); 

	if (tempTime <= partime->getCurrentTime()){
		return true;
	}

	// if there is an object parameter, get the distance from the current agent location to this 
	// object.  If the action isn't locomoting, then the agent will likely have to locomote to the object
	// We will pop the action sooner to try to allow for the time it will take.  
	// We will always assume that the first object is the salient object.
	if (cfipar->par->getNumObjects() > 0)
	{
		MetaObject* blah = cfipar->getObject(0);
		if (blah != NULL)
		{
			MetaObject *obj = cfipar->getObject(0);
			assert(obj);
			par_debug("In AgentNet::readyToGo, object is %s\n",obj->getObjectName().c_str());
			
			
			//Vector<3> *objPos = obj->getPosition();
			std::string agentName = cfipar->getAgent()->getObjectName();
			//MetaObject *agent = actionary->searchByNameObj(agentName);
			//assert(agent);
			/*Vector<3> *agtPos = agent->getPosition();
			float dist;
				
			dist = (objPos->v[0] - agtPos->v[0]) * (objPos->v[0] - agtPos->v[0]);
			dist = dist + (objPos->v[1] - agtPos->v[1]) * (objPos->v[1] - agtPos->v[1]);
			dist = dist + (objPos->v[2] - agtPos->v[2]) * (objPos->v[2] - agtPos->v[2]);
			dist = sqrt(dist);*/

			double adjustedTime = tempTime - getTimeToObject(cfipar->getAgent(), obj);
				//(dist * 0.6897 * 10);  // assuming walking speed of 1.45m/s
			par_debug("Adjusted time is %f\n", adjustedTime);
			if (adjustedTime <= partime->getCurrentTime())
				return true;
		}
	}
	
	return false;
}
开发者ID:GAIA-GMU,项目名称:PAR,代码行数:46,代码来源:agentnet.cpp


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