本文整理汇总了C++中CGrid::GetCellsX方法的典型用法代码示例。如果您正苦于以下问题:C++ CGrid::GetCellsX方法的具体用法?C++ CGrid::GetCellsX怎么用?C++ CGrid::GetCellsX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGrid
的用法示例。
在下文中一共展示了CGrid::GetCellsX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLButtonDown
//.........这里部分代码省略.........
if (GetXYZ(point, p))
{
if (g_Grid.GetInfo(p.x, p.y, &inf))
{
m_VertexGot = g_Grid.GetK(inf.i, inf.j);
indexgot = g_Grid.GetAlphaIndex(m_VertexGot);
if (indexgot != g_AlphamapMan.GetCurSel())
{
g_AlphamapMan.SetCurSel(indexgot);
pDoc->UpdateFormView(TAB_ALPHAMAP);
}
}
}
}
break;
case (TAB_MODELS):
// MD3 - Selecting
if (!kCTRL && kSHIFT)
{
CNmVec3 ray, dummy;
float md3_dist, hitterra_dist;
bool hitterra;
S_MD3PTR *oldh = m_Md3Highlight;
S_MD3PTR *hit_md3;
if (GetRay(point, ray))
{
if (g_Md3Man.GetByRay(m_Eye, ray, hit_md3, md3_dist))
{
// check if is covered by terrain!!!
hitterra = g_Grid.GetDistanceTrisRay(m_Eye, ray, dummy, hitterra_dist);
if (!hitterra)
{
m_Md3Highlight = hit_md3;
}
else if (hitterra_dist > md3_dist)
{
m_Md3Highlight = hit_md3;
}
}
}
if (m_Md3Highlight != oldh)
{
Refresh = TRUE;
}
}
break;
}
// rotate tris (CTRL+LeftBut)
if ((tab == TAB_GRID || tab == TAB_MODIFIER || tab == TAB_ALPHAMAP) &&
mod == MOD_NONE && kCTRL && !kSHIFT)
{
if (GetXYZ(point, p))
{
if (g_Grid.GetInfo(p.x, p.y, &inf))
{
int i, j, k;
int mt1;
S_FACEDATAEX *f;
mt1 = g_Grid.GetTris(p.x, p.y);
mt1 &= ~1;
k = mt1 / 2;
i = k % g_Grid.GetCellsX();
j = k / g_Grid.GetCellsX();
f = g_Grid.GetFace(k);
if ((f->flags & FACE_FL_TRISINV))
{
f->flags &= ~FACE_FL_TRISINV;
}
else
{
f->flags |= FACE_FL_TRISINV;
}
g_Grid.FaceOrientateTris(i, j, f->flags & FACE_FL_TRISINV);
Refresh = TRUE;
}
}
}
if (Refresh)
{
InvalidateRect(NULL, FALSE);
} //
SetCapture();
CView::OnLButtonDown(nFlags, point);
}