本文整理汇总了C++中fairy::LogicModel::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ LogicModel::setVisible方法的具体用法?C++ LogicModel::setVisible怎么用?C++ LogicModel::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fairy::LogicModel
的用法示例。
在下文中一共展示了LogicModel::setVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateObject
// 把一个物体放到指定得摄影机位置
void CFakeObjectEntityManager::CreateObject(LPCTSTR szObjName, CObjEntityActor* pNode, CObjEntityActor* pAttachNode, LPCTSTR szCameraName, int nTexWidth, int nTexHeight, LPCTSTR szBackgroundName)
{
// 先根据该fake object的名称来获取摆放位置
m_fvPosition = Ogre::Vector3(_GetFakeObjPos(szObjName), 10000.f, 0.f);
//物体不存在,创建新的渲染环境
FakeObjectMap::iterator it = _GetFakeNode(szObjName, pNode, szCameraName, nTexWidth, nTexHeight, szBackgroundName);
if(it == m_mapObject.end()) return;
it->second.pEntityNode = pNode;
it->second.pAttachEntityNode = pAttachNode;
//将需要渲染的实体放入渲染环境中
// 如果骑在马上的,要设置马的位置,把人的位置复位
Fairy::LogicModel* modelImpl = pNode->GetActorImpl();
if (modelImpl->isAttached())
{
Fairy::LogicModel* parentModel = modelImpl->getAttachModel();
KLAssert (parentModel);
modelImpl->setPosition(Ogre::Vector3(0.0f, 0.0f, 0.0f));
parentModel->setPosition(Ogre::Vector3(m_fvPosition.x, m_fvPosition.y, m_fvPosition.z));
parentModel->setVisible(true);
}
else
pNode->SetGfxPosition(fVector3(m_fvPosition.x, m_fvPosition.y, m_fvPosition.z));
//初始就显示,在运行过程中会一直保持visible为true的状态
pNode->SetVisible(TRUE);
}
示例2: SetShowObjectByType
//----laim
void CEngineInterface::SetShowObjectByType( LPCTSTR szName)
{
static bool blogic=TRUE;
static bool bstaticentity = TRUE;
static bool bliquid = TRUE;
static bool effect = TRUE;
static bool pareticle = TRUE;
static long lshowType = ENUM_OBJ_TYPE::ALL_TYPE;;
Ogre::String currentName = szName;
if (currentName == "lm")
{
lshowType =lshowType ^ ( blogic << 5);
}
if (currentName == "se"){
lshowType =lshowType ^ bstaticentity;
// bstaticentity =!bstaticentity;
}
if (currentName == "sl"){
lshowType = lshowType ^ (bliquid <<2);//ENUM_OBJ_TYPE::TERRAINLIQUIDOBJ_TYPE;
//bliquid =!bliquid;
}
if (currentName == "ef"){
lshowType = lshowType ^ (effect <<3);
//effect =!effect;
}
if (currentName == "ps"){
lshowType = lshowType ^ (effect <<1);
// pareticle =!pareticle;
}
if (currentName == "all"){
lshowType = ENUM_OBJ_TYPE::ALL_TYPE;
}
//obj
Fairy::LogicModelManager::LogicModelMap logicmap = Fairy::LogicModelManager::getSingleton().getModelMap();
for ( Fairy::LogicModelManager::LogicModelMap::iterator i = logicmap.begin();
i != logicmap.end(); ++i )
{
Fairy::LogicModel* model = i->second;
model->setVisible(lshowType & ENUM_OBJ_TYPE::LOGICMODEL_TYPE);
}
Fairy::Scene::Objects objs = CEngineInterface::GetMe()->GetFairySystem()->getSceneInfo()->getObjects();
Fairy::Scene::Objects::const_iterator it = objs.begin();
for ( ; it != objs.end(); it++)
{
const Fairy::ObjectPtr& object = *it;
if ( object->getType()== "StaticEntity" )
{
Fairy::StaticEntityObject* entity = static_cast<Fairy::StaticEntityObject*>(object.get());
Ogre::SceneNode* parentNode = entity->getSceneNode();
if(parentNode)
parentNode->setVisible( lshowType & ENUM_OBJ_TYPE::STATICENTITY_TYPE );
}
if( object->getType()== "TerrainLiquid")
{
Fairy::TerrainLiquidObject* liquid = static_cast< Fairy::TerrainLiquidObject *>(object.get());
Fairy::TerrainLiquid * parentNode = liquid->getTerrainLiquid();
if(parentNode)
parentNode->setVisible(lshowType & ENUM_OBJ_TYPE::TERRAINLIQUIDOBJ_TYPE);
}
if( object->getType()== "Effect")
{
Fairy::EffectObject* effect = static_cast<Fairy::EffectObject*>(object.get());
Ogre::SceneNode* parentNode = effect->getSceneNode();
if(parentNode)
parentNode->setVisible(lshowType & ENUM_OBJ_TYPE::EFFECTOBJ_TYPE);
}
if(object->getType()== "ParticleSystem")
{
Fairy::ParticleSystemObject* particle = static_cast<Fairy::ParticleSystemObject*>(object.get());
Ogre::SceneNode* parentNode = particle->getSceneNode();
if(parentNode)
parentNode->setVisible( lshowType & ENUM_OBJ_TYPE::PARTICLE_TYPE);
}
//.........这里部分代码省略.........