本文整理汇总了C++中CFrustum::GetCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ CFrustum::GetCamera方法的具体用法?C++ CFrustum::GetCamera怎么用?C++ CFrustum::GetCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFrustum
的用法示例。
在下文中一共展示了CFrustum::GetCamera方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _GenTriIndex
int ZQuadTree::_GenTriIndex(int nTris, std::vector<Point> &vArray, CGeoMapData &pHeightMap, Point &bottomLeft, CFrustum &pFrustum, float fLODRatio)
{
if(m_bCulled)
{
//printf("%d %d bCulled\n", m_nCenter.x, m_nCenter.y);
m_bCulled = false;
return nTris;
}
if(_IsVisible(pHeightMap, bottomLeft, pFrustum.GetCamera(), fLODRatio))
{
if(m_nCorner[CORNER_TR].x - m_nCorner[CORNER_TL].x <= MIN_SIZE)
{
//좌측 상단 삼각형;
nTris++;
vArray.push_back(m_nCorner[CORNER_TL]);
vArray.push_back(m_nCorner[CORNER_TR]);
vArray.push_back(m_nCorner[CORNER_BL]);
//우측 하단 삼각형
nTris++;
vArray.push_back(bottomLeft + m_nCorner[CORNER_BL]);
vArray.push_back(bottomLeft + m_nCorner[CORNER_TR]);
vArray.push_back(bottomLeft + m_nCorner[CORNER_BR]);
return nTris;
}
bool b[4] = {true, true, true, true};
if(m_pNeighbor[EDGE_UP]) b[EDGE_UP] = m_pNeighbor[EDGE_UP] ->_IsVisible(pHeightMap, bottomLeft, pFrustum.GetCamera(), fLODRatio);
if(m_pNeighbor[EDGE_DN]) b[EDGE_DN] = m_pNeighbor[EDGE_DN] ->_IsVisible(pHeightMap, bottomLeft, pFrustum.GetCamera(), fLODRatio);
if(m_pNeighbor[EDGE_LT]) b[EDGE_LT] = m_pNeighbor[EDGE_LT] ->_IsVisible(pHeightMap, bottomLeft, pFrustum.GetCamera(), fLODRatio);
if(m_pNeighbor[EDGE_RT]) b[EDGE_RT] = m_pNeighbor[EDGE_RT] ->_IsVisible(pHeightMap, bottomLeft, pFrustum.GetCamera(), fLODRatio);
if(b[EDGE_UP] && b[EDGE_DN] && b[EDGE_LT] && b[EDGE_RT])
{
//좌측 상단 삼각형;
nTris++;
vArray.push_back(m_nCorner[CORNER_TL]);
vArray.push_back(m_nCorner[CORNER_TR]);
vArray.push_back(m_nCorner[CORNER_BL]);
//우측 하단 삼각형
nTris++;
vArray.push_back(m_nCorner[CORNER_BL]);
vArray.push_back(m_nCorner[CORNER_TR]);
vArray.push_back(m_nCorner[CORNER_BR]);
return nTris;
}
Point p;
if(!b[EDGE_UP])
{
p.x = (m_nCorner[CORNER_TL].x + m_nCorner[CORNER_TR].x) / 2;
p.y = m_nCorner[CORNER_TL].y;
nTris++;
vArray.push_back(m_nCenter);
vArray.push_back(m_nCorner[CORNER_TL]);
vArray.push_back( p);
nTris++;
vArray.push_back(m_nCenter);
vArray.push_back(p);
vArray.push_back(m_nCorner[CORNER_TR]);
}
else
{
vArray.push_back(m_nCenter);
vArray.push_back(m_nCorner[CORNER_TL]);
vArray.push_back(m_nCorner[CORNER_TR]);
}
if(!b[EDGE_DN])
{
p.x = (m_nCorner[CORNER_BL].x + m_nCorner[CORNER_BR].x) / 2;
p.y = m_nCorner[CORNER_BL].y;
nTris++;
vArray.push_back(m_nCenter);
vArray.push_back(m_nCorner[CORNER_BR]);
vArray.push_back(p);
nTris++;
vArray.push_back(bottomLeft + m_nCenter);
vArray.push_back(p);
vArray.push_back(m_nCorner[CORNER_BL]);
}
else
{
vArray.push_back(m_nCenter);
vArray.push_back(m_nCorner[CORNER_BR]);
vArray.push_back(m_nCorner[CORNER_BL]);
}
if(!b[EDGE_LT])
{
p.x = m_nCorner[CORNER_TL].x;
//.........这里部分代码省略.........