本文整理汇总了C++中fairy::LogicModel::isUseExternalBoundingBox方法的典型用法代码示例。如果您正苦于以下问题:C++ LogicModel::isUseExternalBoundingBox方法的具体用法?C++ LogicModel::isUseExternalBoundingBox怎么用?C++ LogicModel::isUseExternalBoundingBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fairy::LogicModel
的用法示例。
在下文中一共展示了LogicModel::isUseExternalBoundingBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Find_HitFairyObject
tEntityNode* CEngineInterface::Find_HitFairyObject(INT nX, INT nY)
{
Ogre::Ray ray = m_pFairySystem->getWindowToViewportRay(Fairy::Point(nX, nY));
m_pRaySceneQuery->setRay(ray);
// 按照逻辑优先级的查询队列
std::map< INT, tEntityNode* > mapRayQuery;
const Ogre::RaySceneQueryResult& queryResult = m_pRaySceneQuery->execute();
for (Ogre::RaySceneQueryResult::const_iterator it = queryResult.begin(); it != queryResult.end(); ++it)
{
Ogre::MovableObject* pMovable = it->movable;
Fairy::ObjectPtr object = Fairy::getObjectFromMovable(pMovable);
if (object&&object->getData())
{
tEntityNode* pEntityNode = (tEntityNode*)(object->getData());
// 不是游戏逻辑中动态生成的
if(!pEntityNode)
continue;
// 不再被关心
if(!(pEntityNode->GetRayQuery()))
continue;
if(pEntityNode->GetType() == tEntityNode::ETYPE_ACTOR) // object->getType() == "LogicModel")
{
Fairy::LogicModelObject* logicModelObject = static_cast<Fairy::LogicModelObject*>(object.get());
assert (logicModelObject);
Fairy::LogicModel* model = logicModelObject->getLogicModel();
assert (model);
// 不再自定义BoundingBox中
if (model->isUseExternalBoundingBox() && !(model->rayIntersect(ray)))
{
continue;
}
}
// 如果已经有同级存在,按照摄像机远近排序
if(mapRayQuery.find(pEntityNode->RayQuery_GetLevel()) != mapRayQuery.end())
continue;
// 放入查询队列
mapRayQuery.insert(std::make_pair(pEntityNode->RayQuery_GetLevel(), pEntityNode));
}
}
// 返回优先级最高的逻辑对象
if(!mapRayQuery.empty())
{
return mapRayQuery.begin()->second;
}
return NULL;
}