本文整理汇总了C++中CGameObject::getSceneNode方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameObject::getSceneNode方法的具体用法?C++ CGameObject::getSceneNode怎么用?C++ CGameObject::getSceneNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameObject
的用法示例。
在下文中一共展示了CGameObject::getSceneNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectObject
// selectObject
// detect list objs at rect
void CDocument::selectObject( int x, int y, int w, int h, bool isControlHold )
{
IView *pView = getIView();
ISceneManager *smgr = pView->getSceneMgr();
ICameraSceneNode *camera = smgr->getActiveCamera();
// if no camera
if ( camera == NULL )
return;
const SViewFrustum* viewFrustum = camera->getViewFrustum();
ISceneCollisionManager *collMan = smgr->getSceneCollisionManager();
int screenX = -1, screenY = -1;
ArrayZoneIter iZone = m_zones.begin(), iEnd = m_zones.end();
while ( iZone != iEnd )
{
ArrayGameObject* listObj = (*iZone)->getChilds();
ArrayGameObjectIter iObj = listObj->begin(), objEnd = listObj->end();
ISceneNode *pNode = NULL;
while ( iObj != objEnd )
{
CGameObject *pGameObj = (CGameObject*)(*iObj);
pNode = pGameObj->getSceneNode();
if ( pNode != NULL && pGameObj->isVisible() )
{
core::vector3df center = pGameObj->getPosition();
// check object is in frustum
if ( viewFrustum->getBoundingBox().isPointInside( center ) )
{
if ( pView->getScreenCoordinatesFrom3DPosition( center, &screenX, &screenY ) )
{
if ( x <= screenX && screenX <= x + w && y <= screenY && screenY <= y + h )
{
if ( isControlHold == false || pGameObj->getObjectState() == CGameObject::Normal )
m_selectObjects.push_back( pGameObj );
} // inselect
} // getScreenCoordinatesFrom3DPosition
} // frustum
}
iObj++;
}
iZone++;
}
}