• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ fairy::LogicModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中fairy::LogicModel的典型用法代码示例。如果您正苦于以下问题:C++ LogicModel类的具体用法?C++ LogicModel怎么用?C++ LogicModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: OnBtn

void AnimationSelector::OnBtn(wxCommandEvent & e)
{
	if (e.GetId() == ID_BTN_PLAY)
	{
		if (!m_bPause)
		{
			return;
		}
	}
	else
	{
		if (m_bPause)
		{
			return;
		}
	}

	m_bPause = !m_bPause;

	m_btnPause->Enable(!m_bPause);
	m_btnPlay->Enable(m_bPause);

	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		pObjModel->setAnimEditing(m_bPause);
	}	
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:29,代码来源:AnimationSelector.cpp


示例2: ResetSkillObject

//重新设置效果物体
void SkillObjectEditor::ResetSkillObject()
{
	Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject();
	if(!pDObject)
		return;
	//pDObject->execute(0.0f);
	try
	{
		pDObject->createSkill( mSkillTemplateName, m_Frame->GetGraphDialog()->GetLoop());
		if(mSkill->getNumAnimationBulletFlows() > 0)
		{
			BulletFlowInfo* pInfo = new BulletFlowInfo;
			Fairy::AnimationBulletFlow* pAnimationFlow = mSkill->getAnimationBulletFlow(0);

			pInfo->attachPoint = pAnimationFlow->getAttachPoint();
			pInfo->offsetPoistion = pAnimationFlow->getOffsetPos();
			pInfo->offsetRotation = pAnimationFlow->getOffsetRotation();
			pInfo->casterModel = m_Frame->GetActorSettingEditor()->GetCurrentObject();
			pInfo->targetModel = m_Frame->GetActorSettingEditor()->GetTargetObject();
			pInfo->targetPoint = "身体中心点";

			pDObject->getCurrentSkill()->m_userData = pInfo;

		}
	}
	catch ( Ogre::Exception& e)
	{
	}
	//mSkill = Fairy::EffectManager::getSingleton().getSkill(mSkillTemplateName);
	m_Frame->GetGraphDialog()->InitSkillEditor(mSkill,mSkillTemplateName);

}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:33,代码来源:SkillObjectEditor.cpp


示例3: 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;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:58,代码来源:EngineInterface.cpp


示例4: getCurrentObjectSkill

Fairy::Skill* SkillObjectEditor::getCurrentObjectSkill()
{
	Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject();
	if(pDObject)
	{
		return pDObject->getCurrentSkill();
	}
	return NULL;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:9,代码来源:SkillObjectEditor.cpp


示例5: 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);
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:35,代码来源:FakeObjectEntityManager.cpp


示例6: InitSkillEditor

void SkillObjectEditor::InitSkillEditor(Fairy::Skill* pSkill,Ogre::String& templateName)
{
	mSkillTemplateName = templateName;
	mSkill = pSkill;

	GetParentFrame()->GetEffectObjectProperty()->InitSkillEditor(mSkill,templateName);

	m_SkillObjectTree->DeleteAllItems();
	m_SkillObjectTree->AddSkillToTree(mSkill);
	m_SkillObjectTree->SelectSkillSetting();

	Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject();

	pDObject->setAnimEditing(false);
	m_Frame->GetGraphDialog()->InitSkillEditor(mSkill,mSkillTemplateName);
	m_Frame->GetGraphDialog()->InitAnimTimePosSlider();
	
	try
	{
		pDObject->createSkill( mSkill->getSkillName(), m_Frame->GetGraphDialog()->GetLoop());
		if(mSkill->getNumAnimationBulletFlows() > 0)
		{
			BulletFlowInfo* pInfo = new BulletFlowInfo;
			Fairy::AnimationBulletFlow* pAnimationFlow = mSkill->getAnimationBulletFlow(0);

			pInfo->attachPoint = pAnimationFlow->getAttachPoint();
			pInfo->offsetPoistion = pAnimationFlow->getOffsetPos();
			pInfo->offsetRotation = pAnimationFlow->getOffsetRotation();
			pInfo->casterModel = m_Frame->GetActorSettingEditor()->GetCurrentObject();
			pInfo->targetModel = m_Frame->GetActorSettingEditor()->GetTargetObject();
			pInfo->targetPoint = "身体中心点";

			pDObject->getCurrentSkill()->m_userData = pInfo;

		}
		
	}
	catch ( Ogre::Exception& e)
	{
		Ogre::String msg = "[Warning] Animation : " + mSkill->getSkillName() + "_getAnimationState Failed!";
		wxLogMessage(msg.c_str());		
	}
	mDObject = pDObject;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:44,代码来源:SkillObjectEditor.cpp


示例7: OnSliderUpdate

void AnimationSelector::OnSliderUpdate(wxCommandEvent & e)
{
	if (!m_bPause)
	{
		return;
	}
	int pos = m_slider->GetValue();
	
	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		Ogre::Real timeTotal = pObjModel->getAnimationLength(pObjModel->getCurrentAnimName());

		Ogre::Real posValue = ((Ogre::Real)pos)/m_slider->GetMax();
		pObjModel->setAnimTimePos(posValue);
		m_curTimeText->SetValue(Ogre::StringConverter::toString(posValue*timeTotal));
		m_curFrameText->SetValue(Ogre::StringConverter::toString(posValue*timeTotal*STATIC_FPS));
	}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:20,代码来源:AnimationSelector.cpp


示例8: pauseAnimation

void AnimationSelector::pauseAnimation(bool bPause)
{
	if (!GetDataManipulator())
	{
		return;
	}

	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( !pObjModel || pObjModel->getCurrentAnimName().empty())
	{
		return;
	}	

	if (!bPause)
	{
		if (!m_bPause)
		{
			return;
		}
	}
	else
	{
		if (m_bPause)
		{
			return;
		}
	}

	m_bPause = !m_bPause;

	m_btnPause->Enable(!m_bPause);
	m_btnPlay->Enable(m_bPause);

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		pObjModel->setAnimEditing(m_bPause);
	}	
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:39,代码来源:AnimationSelector.cpp


示例9: wxASSERT

void
AnimationSelector::OnAnimationListSelChanged(wxTreeEvent& e)
{
	// reset the state
	resetState();

    wxTreeItemId item = e.GetItem();

    wxASSERT(item.IsOk());

	wxTreeCtrl* tree = wxStaticCast(e.GetEventObject(), wxTreeCtrl);
    mActivedItem = e.GetItem();

    wxArrayTreeItemIds selections;
    int nCount = tree->GetSelections(selections);

	if(nCount <= 0)
		return;

	if (mIsMeshAnim)
	{
		GetDataManipulator()->changeMeshAnimation(DoActiveItem(item));
		return;
	}

	GetDataManipulator()->changeAnimation(DoActiveItem(item),0.0);

	Fairy::LogicModel* pObjModel = GetDataManipulator()->m_pObjTemplate;

	if ( pObjModel && !pObjModel->getCurrentAnimName().empty())
	{
		
		m_btnPause->Enable(true);
 
 		pObjModel->setAnimEditing(m_bPause);

		Ogre::String animationName = pObjModel->getCurrentAnimName();

		bool bLoop = pObjModel->getAnimationLoop();
		Ogre::Real timeTotal = pObjModel->getAnimationLength(animationName);

		m_endTimeText->SetValue(Ogre::StringConverter::toString(timeTotal));
		m_endFrameText->SetValue(Ogre::StringConverter::toString(timeTotal*STATIC_FPS));
	}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:45,代码来源:AnimationSelector.cpp


示例10: OnMouseMove

void ActorSceneCanvas::OnMouseMove(wxMouseEvent& e)
{

	ShowPos(e.GetX(), e.GetY());

    if (!GetSceneManipulator())
        return;

    if (m_pCameraManip)
    {
        wxASSERT(mDragButton != wxMOUSE_BTN_NONE);
        m_pCameraManip->onMotion(e.GetX(), e.GetY());
    }

	if (mDragStarted  && e.LeftIsDown())
	{
		mDragCurrent =Ogre::Vector2(e.GetX(), e.GetY()) ;
		mDragDelta = mDragCurrent - mDragOrigin;
		mDragOrigin = mDragCurrent;

		if (Fairy::CDataManipulator::GetDataManipulator() && mCanManipulateAxis)
		{	
			Ogre::Camera* camera = GetSceneManipulator()->getCamera();
			assert (camera);
			Ogre::Vector3 oldPos = camera->getPosition();
			Fairy::LogicModel* pModel = GetDataManipulator()->m_pObjTemplate;
			if (pModel)
			{
				Ogre::Vector3 objPos = pModel->getPosition();
				Ogre::Real distance = oldPos.distance(objPos);
				Ogre::Real factor = distance*0.1/150.0;

				Ogre::Vector3 pos=Fairy::CDataManipulator::m_baseNode->getPosition();
				Ogre::Vector3 fdeltaxi = Ogre::Vector3::ZERO;
				Ogre::Quaternion qRot = Fairy::CDataManipulator::m_baseNode->getOrientation();
				//david-<<
				 if(mXax)
					 fdeltaxi = /*qRot**/(mDragDelta.x*0.1*Ogre::Vector3::UNIT_X);
				 if(mYax)
					 fdeltaxi = /*qRot**/(mDragDelta.x*0.1*Ogre::Vector3::UNIT_Y);
				 if(mZax)
					 fdeltaxi = /*qRot**/(mDragDelta.x*0.1*Ogre::Vector3::UNIT_Z);
				 //david->>

				Fairy::CDataManipulator::GetDataManipulator()->_updateCurLocatorTrans(fdeltaxi,Ogre::Quaternion::IDENTITY,true);
			}			
		}	
	}

	if(mDragRightStarted &&  e.RightIsDown())
	{
	
		mDragCurrent =Ogre::Vector2(e.GetX(), e.GetY()) ;
		mDragDelta = mDragCurrent - mDragOrigin;
		mDragOrigin = mDragCurrent;

// 		Ogre::Radian x = Ogre::Degree(mDragDelta.val[0]);
// 		Ogre::Radian y = Ogre::Degree(mDragDelta.val[1]);
// 		Fairy::CDataManipulator::m_axex->yaw(y);
// 		Fairy::CDataManipulator::m_axex->pitch(x);

		if ( Fairy::CDataManipulator::GetDataManipulator() &&(mXax || mYax || mZax) && mCanManipulateAxis)
		{			
			Ogre::Vector3 fBaseAxis = Ogre::Vector3::ZERO;
			Ogre::Quaternion fBaseRot = Fairy::CDataManipulator::m_baseNode->getOrientation();

			if(mXax)
				fBaseAxis =/* fBaseRot**/Ogre::Vector3::UNIT_X;
			if(mYax)
				fBaseAxis =/* fBaseRot**/Ogre::Vector3::UNIT_Y;
			if(mZax)
				fBaseAxis =/* fBaseRot**/Ogre::Vector3::UNIT_Z;

			//david-<<
			Ogre::Radian angle = Ogre::Degree(mDragDelta.y);
			//david->>

			Ogre::Quaternion rot(angle, fBaseAxis);			

			if(mRotFirst)
			{
				Fairy::CDataManipulator::GetDataManipulator()->_updateCurLocatorTrans(Ogre::Vector3::ZERO, rot, false);	
			}
			else
			{
				Fairy::CDataManipulator::GetDataManipulator()->_updateCurLocatorRot(rot);	
			}				
		}
	}



    if (GetActiveAction())
    {
        //GetActiveAction()->onMotion(e.GetX(), e.GetY());
		if (e.ControlDown())
		{
			GetActiveAction()->setParameter("FUNC_KEY", "CTRL");
		}
		
//.........这里部分代码省略.........
开发者ID:jjiezheng,项目名称:pap_full,代码行数:101,代码来源:WXSceneCanvas.cpp


示例11: DestroySkillObject

//销毁效果物体
void SkillObjectEditor::DestroySkillObject()
{
	Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject();
	if(pDObject)
		pDObject->delCurrentSkill();
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:7,代码来源:SkillObjectEditor.cpp


示例12: wxBoxSizer

void
AddEffectInfoDialog::OnInitDialog(wxInitDialogEvent &e)
{
	wxDialog::OnInitDialog(e);

	wxSizer* sizer = new wxBoxSizer( wxVERTICAL );

	wxFlexGridSizer *item1 = new wxFlexGridSizer( 2, 0, 0 );

	wxComboBox *item2 = new wxComboBox( this, feID_COMBOCTRL_EFFECT, wxT(""), wxDefaultPosition, wxSize(200,-1), 0, NULL, wxCB_DROPDOWN );
	item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );

	wxComboBox *item3 = new wxComboBox( this, feID_COMBOCTRL_LOCATOR, wxT(""), wxDefaultPosition, wxSize(200,-1), 0, NULL, wxCB_DROPDOWN );
	item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );

	sizer->Add( item1, 0, wxALIGN_CENTER|wxALL, 10 );

	wxFlexGridSizer *item5 = new wxFlexGridSizer( 2, 0, 0 );

	wxButton *item6 = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 );
	item6->SetDefault();
	item5->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );

	wxButton *item7 = new wxButton( this, wxID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
	item5->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );

	sizer->Add( item5, 0, wxALIGN_CENTER|wxALL, 10 );

	this->SetSizer( sizer );
	sizer->SetSizeHints( this );

	Fairy::EffectManager::EffectTemplateIterator it = 
		Fairy::EffectManager::getSingleton().getEffectTemplateIterator();

	while ( it.hasMoreElements() )
	{
		item2->AppendString(it.peekNextKey().c_str());

		it.moveNext();
	}

	item2->SetSelection(0);

	SkillObjectEditor* pEditor= static_cast<SkillObjectEditor*>(this->GetParent());
	if(!pEditor)
		return;
	Fairy::LogicModel *pMbject  = pEditor->GetParentFrame()->GetActorSettingEditor()->GetActorObject();
	assert (pMbject);

	Ogre::StringVector boneNameList;
	for ( unsigned short i=0; i<pMbject->getNumBones(); ++i )
	{
		boneNameList.push_back(pMbject->getBoneName(i));
	}

	Ogre::StringVector locatorNames;
	pMbject->getLocatorNames(locatorNames);

	for ( size_t i=0; i<locatorNames.size(); ++i )
	{
		Fairy::LogicModel::LocatorValue value;
		if(pMbject->getLocatorInfo(locatorNames[i], value))
		{
			if(value.mBoneName != "" )
			{
				for ( int index=0; index<(int)boneNameList.size(); ++index )
				{
					if (boneNameList[index] == value.mBoneName)
					{
						// info of the locator is valid
						item3->Append(locatorNames[i].c_str());
						break;
					}
				}						
			}
		}
	}

	item3->SetSelection(0);
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:80,代码来源:SkillObjectEditor.cpp


示例13: nameStr

void
AddSkillDialog::OnInitDialog(wxInitDialogEvent &e)
{
	wxDialog::OnInitDialog(e);

	wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );

	wxFlexGridSizer *item1 = new wxFlexGridSizer( 2, 0, 0 );

	wxStaticText *item2 = new wxStaticText( this, wxID_ANY, /*_("Animation")*/ wxT("动作"), wxDefaultPosition, wxDefaultSize, 0 );
	item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );

	wxString *strs3 = (wxString*) NULL;
	wxComboBox *item3 = new wxComboBox( this, ID_COMBO_ANIMATION, wxT(""), wxDefaultPosition, wxSize(200,-1), 0, strs3, wxCB_DROPDOWN );
	item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );

	wxStaticText *item4 = new wxStaticText( this, wxID_ANY, /*_("Skill Name")*/wxT("技能名称"), wxDefaultPosition, wxDefaultSize, 0 );
	item1->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );

	wxTextCtrl *item5 = new wxTextCtrl( this, ID_TEXTCTRL_SKILL, wxT(""), wxDefaultPosition, wxSize(200,-1), 0 );
	item1->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );

	wxButton *item6 = new wxButton( this, wxID_OK, /*_("OK")*/wxT("确认[&O]"), wxDefaultPosition, wxDefaultSize, 0 );
	item1->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );

	wxButton *item7 = new wxButton( this, wxID_CANCEL, /*_("Cancel")*/wxT("取消[&C]"), wxDefaultPosition, wxDefaultSize, 0 );
	item1->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );

	item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );

	this->SetSizer( item0 );
	item0->SetSizeHints( this );

	SkillObjectEditor* pSkillEditor = dynamic_cast<SkillObjectEditor*>(m_parent);
	assert(pSkillEditor);

	ActorAnimationSettingEditor *parentDialog = pSkillEditor->GetParentFrame()->GetActorSettingEditor();
	assert (parentDialog);
	Fairy::LogicModel *object = parentDialog->GetCurrentObject();

	for ( unsigned short i = 0; i < object->getSkeletonAnimationCount(); ++i )
	{
		Ogre::Animation *anim = object->getSkeletonAnimation(i);

		if ( anim )
		{
			wxString nameStr(anim->getName().c_str());
			item3->AppendString(nameStr);
		}
	}

	// 加入obj中定义的动作名称
	Fairy::LogicModelManager::AnimationSkeletonLinksIterator asmIt = 
		Fairy::LogicModelManager::getSingleton().getAnimationSkeletonLinksIterator(object->getName());

	while ( asmIt.hasMoreElements() )
	{
		wxString animName(asmIt.peekNextKey().c_str());

		if ( wxNOT_FOUND == item3->FindString(animName) )
		{
			wxString nameStr(animName.c_str());
			item3->AppendString(nameStr);
		}

		asmIt.moveNext();
	}

	item3->SetSelection(0);
	mAnimComboBox = item3;

	mSkillNameTextCtrl = item5;	
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:73,代码来源:SkillObjectEditor.cpp


示例14: 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);
			}
//.........这里部分代码省略.........
开发者ID:jjiezheng,项目名称:pap_full,代码行数:101,代码来源:EngineInterface.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ fapi::Target类代码示例发布时间:2022-05-31
下一篇:
C++ extensionsystem::PluginManager类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap