本文整理汇总了C++中CGrid::GetK方法的典型用法代码示例。如果您正苦于以下问题:C++ CGrid::GetK方法的具体用法?C++ CGrid::GetK怎么用?C++ CGrid::GetK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGrid
的用法示例。
在下文中一共展示了CGrid::GetK方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseMove
//.........这里部分代码省略.........
Refresh = TRUE;
}
// Vertex dragging
if (m_LBD && kCTRL && kSHIFT && (m_VertexGot != -1) && (mod == MOD_NONE))
{
float *z = g_Grid.GetPtr(m_VertexGot);
*z = floor(*z - g_Prefs.m_fVertexDragStep * (float)Ldelta.y);
if (*z < ASSUME_ZERO)
{
*z = 0;
}
m_vGenericPos.Set(g_Grid.GetX(m_VertexGot), g_Grid.GetY(m_VertexGot), *z);
UpdStatus = TRUE;
pDoc->m_bInvalidateGridPreview = TRUE;
Refresh = TRUE;
}
break;
case (TAB_ALPHAMAP):
int curindex;
curindex = g_AlphamapMan.GetCurSel();
// Alphamap paint
if (m_LBD && kCTRL && kSHIFT && curindex != -1)
{
if (GetXYZ(point, p))
{
if (g_Grid.GetInfo(p.x, p.y, &inf))
{
m_VertexGot = g_Grid.GetK(inf.i, inf.j);
// g_Grid.SetAlphaIndex(m_VertexGot, curindex );
g_Grid.PaintAlphaIndex(inf.i, inf.j, pDoc->m_dwPaintRadius, curindex);
Refresh = TRUE;
}
}
}
break;
case (TAB_MODELS):
break;
}
// rotate X/Y
if (m_LBD && !m_RBD && !kCTRL && !kSHIFT)
{
m_yRot += (float)(Ldelta.x) / 2.0f; // left / right
m_xRot += (float)(Ldelta.y) / 2.0f; // up / dn
if (m_xRot > 85)
{
m_xRot = 85;
}
if (m_xRot < -85)
{
m_xRot = -85;
}
Refresh = TRUE;
}
// pan
if (m_RBD && !m_LBD && !kCTRL && !kSHIFT)
{
float f = (float)u_deg2rad(-m_yRot + 90);
float dx = -(float)(Ldelta.x) * 16;
float dy = (float)(Ldelta.y) * 16;
m_Eye.y += float(sin(f) * dx + cos(f) * dy);
m_Eye.x += float(cos(f) * dx - sin(f) * dy);
Refresh = TRUE;
}
// up/dn
if (m_RBD && m_LBD && !kCTRL && !kSHIFT)
{
m_Eye.z -= (float)(Rdelta.y) * 32;
Refresh = TRUE;
}
if (Refresh)
{
InvalidateRect(NULL, FALSE);
}
if (UpdStatus)
{
UpdateStatusBar();
}
m_LDP = point;
m_RDP = point;
}
示例2: OnLButtonDown
void CEasyGenView::OnLButtonDown(UINT nFlags, CPoint point)
{
CEasyGenDoc *pDoc = GetDocument();
S_POSINFO inf;
CTris *t;
CNmVec3 p;
int tab;
m_LDP = point;
BOOL kCTRL = nFlags & MK_CONTROL;
BOOL kSHIFT = nFlags & MK_SHIFT;
BOOL Refresh = FALSE;
int mod = pDoc->GetModifier();
switch (tab = pDoc->GetActiveTab())
{
case (TAB_GRID):
break;
case (TAB_MODIFIER):
// Get a vertex to drag(CTRL+SHIFT+LeftBut)
if (kCTRL && kSHIFT)
{
if (GetXYZ(point, p))
{
if (g_Grid.GetInfo(p.x, p.y, &inf))
{
m_VertexGot = g_Grid.GetK(inf.i, inf.j);
}
}
}
// Exclude triangle from export | to prevent erroneus exclusion
if (!kCTRL && kSHIFT && g_Grid.OptionExcludedTrisGet())
{
if (GetXYZ(point, p))
{
t = g_Grid.GetTris(g_Grid.GetTris(p.x, p.y));
if (t)
{
t->SetExcluded(!t->GetExcluded());
pDoc->m_bInvalidateGridColor = TRUE;
Refresh = TRUE;
}
}
}
break;
case (TAB_ALPHAMAP):
int curindex;
curindex = g_AlphamapMan.GetCurSel();
// paint the alphamap (CTRL+SHIFT+LeftBut)
if (kCTRL && kSHIFT && curindex != -1)
{
if (GetXYZ(point, p))
{
if (g_Grid.GetInfo(p.x, p.y, &inf))
{
m_VertexGot = g_Grid.GetK(inf.i, inf.j);
// g_Grid.SetAlphaIndex(m_VertexGot, curindex );
g_Grid.PaintAlphaIndex(inf.i, inf.j, pDoc->m_dwPaintRadius, curindex);
Refresh = TRUE;
}
}
}
int indexgot;
// copy alphamap index (SHIFT+LeftBut)
if (!kCTRL && kSHIFT)
{
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;
//.........这里部分代码省略.........