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


C++ ISceneNode::getParent方法代码示例

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


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

示例1: Java_zte_irrlib_scene_Scene_nativeRemoveNode

	void Java_zte_irrlib_scene_Scene_nativeRemoveNode(
		JNIEnv *env, jobject defaultObj, jint id)
	{
		ISceneNode* node = smgr->getSceneNodeFromId(id);
		if (!node) return;
			
		ISceneNode* parentNode = node->getParent();
		if (!parentNode) return;
			
		parentNode->removeChild(node);
	}
开发者ID:yours321dog,项目名称:IrrAPI,代码行数:11,代码来源:android-Scene.cpp

示例2: if

bool   CEvolEnviroment::onMessage(xWindowMsg& msg)
{
	if(m_xuiWinMgr == NULL || m_pRenderApi == NULL)
		return false;

	bool bRet = m_xuiWinMgr->dispatchMsg(msg);
    if(msg.MsgID == WIN_CLOSE )
	{
	    m_pEngine->platform()->quit();
	}
	if(msg.MsgID == WIN_RESIZE)
	{
		onResize();
		return true;
	}
	else if(msg.MsgID == WIN_KEYUP)
	{
		if(msg.Keyboard.cKeyChar >= '1' && msg.Keyboard.cKeyChar <= '9')
		{
			//m_Model->setAction( msg.Keyboard.cKeyChar - '1' );
		}

		if(msg.Keyboard.nKey == VKEY_F9)
		{
			bool bDrawPlane = m_pEngine->sysValue(L"defualt",L"drawPlane" , false);
		}

		if(msg.Keyboard.nKey == VKEY_DELETE)
		{
			bool bAllowOpScene = m_pEngine->sysValue(L"defualt",L"sceneEditable" , true);
			if(bAllowOpScene && GetSelection()->GetCurSelNode())
			{
				ISceneNode* pNode = GetSelection()->GetCurSelNode();
				ISceneNode* pParentNode = pNode->getParent();
				if(pParentNode == NULL)
				{
					MessageBox(GetActiveWindow() , L"节点没有父节点", L"错误" , MB_OK);
				}
				else
				{
					pParentNode->removeChild(pNode,true);
					GetSelection()->setCurSelNode(NULL);
				}
			}
		}
		return false;
	}
	else if(msg.MsgID == WIN_KEYDOWN)
	{
		if(msg.Keyboard.cKeyChar == 'a' )
		{
			m_pCamera->shift(-m_cameraStep);
		}
		else if(msg.Keyboard.cKeyChar == 'd')
		{
			m_pCamera->shift(m_cameraStep);
		}
		else if(msg.Keyboard.cKeyChar == 'w')
		{
			m_pCamera->toward(m_cameraStep);
		}
		else if(msg.Keyboard.cKeyChar == 's')
		{
			m_pCamera->toward(-m_cameraStep);
		}
		else if(msg.Keyboard.nKey == VKEY_UP)
		{
			m_pCamera->pitch(2);
		}
		else if(msg.Keyboard.nKey == VKEY_DOWN)
		{
			m_pCamera->pitch(-2);
		}
		else if(msg.Keyboard.nKey == VKEY_LEFT)
		{
			m_pCamera->yaw(2);
		}
		else if(msg.Keyboard.nKey == VKEY_RIGHT)
		{
			m_pCamera->yaw(-2);
		}
		else if(msg.Keyboard.nKey == VKEY_SHIFT)
		{
			m_pCamera->upDown(m_cameraStep);
		}
		else if(msg.Keyboard.nKey == VKEY_CONTROL)
		{
			m_pCamera->upDown(-m_cameraStep);
		}
		else 
		{
			return false;
		}
		m_pRightCamera->copyFrom(m_pCamera);
		m_pRightCamera->shift(CameraDist);
		setSameViewTarget(m_pCamera , m_pRightCamera);
		return true;
	}
	m_pScenePlacementOprator->onMessage(msg);
	return false;
//.........这里部分代码省略.........
开发者ID:YOlodfssdf,项目名称:evolution3d,代码行数:101,代码来源:SteroDemo.cpp

示例3: selectObject

// selectObject
// detect list objs at mouse xy	
void CDocument::selectObject( int mouseX, int mouseY, bool isControlHold )
{	
	ISceneManager *smgr = getIView()->getSceneMgr();	
	
	ICameraSceneNode *camera = smgr->getActiveCamera();

	// if no camera
	if (  camera == NULL )
		return;

	ISceneCollisionManager *collMan = smgr->getSceneCollisionManager();

	// get select ray
	core::line3df selectRay = getIView()->getSelectRay();
	
	// check hit test
	core::vector3df intersection;
	core::triangle3df hitTriangle;

	// check select
	ISceneNode *selectedSceneNode = collMan->getSceneNodeAndCollisionPointFromRay
		(
			selectRay,
			intersection,
			hitTriangle
		);
	
	if ( selectedSceneNode )
	{
		CGameObject *pObj =	searchObject( selectedSceneNode->getID() );
		
		// try find parent
		while ( pObj == NULL )
		{
			selectedSceneNode = selectedSceneNode->getParent();
			if ( selectedSceneNode == NULL )
				break;
			pObj = searchObject( selectedSceneNode->getID() );
		}

		// add to select list
		if ( pObj && pObj->isVisible() )
		{
			if ( isControlHold == false || pObj->getObjectState() == CGameObject::Normal )
				m_selectObjects.push_back( pObj );
			else
			{
				pObj->setObjectState( CGameObject::Normal );
				ArrayGameObjectIter i = m_selectObjects.begin(), iEnd = m_selectObjects.end();
				while ( i != iEnd )
				{
					if ( (*i) == pObj )
					{
						m_selectObjects.erase( i );
						break;
					}
					i++;
				}
			}
		}

	}

}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:66,代码来源:CDocument.cpp


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