本文整理汇总了C++中CGrid::GetPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ CGrid::GetPtr方法的具体用法?C++ CGrid::GetPtr怎么用?C++ CGrid::GetPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGrid
的用法示例。
在下文中一共展示了CGrid::GetPtr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseMove
void CEasyGenView::OnMouseMove(UINT nFlags, CPoint point)
{
CView::OnMouseMove(nFlags, point);
CEasyGenDoc *pDoc = GetDocument();
BOOL Refresh = FALSE;
BOOL UpdStatus = FALSE;
CNmVec3 p;
S_POSINFO inf;
int tab;
int mod = pDoc->GetModifier();
BOOL kCTRL = nFlags & MK_CONTROL;
BOOL kSHIFT = nFlags & MK_SHIFT;
BOOL m_LBD = nFlags & MK_LBUTTON;
BOOL m_RBD = nFlags & MK_RBUTTON;
CPoint Ldelta = point - m_LDP;
CPoint Rdelta = point - m_RDP;
if (!m_LBD)
{
m_VertexGot = -1;
}
switch (tab = pDoc->GetActiveTab())
{
case (TAB_GRID):
break;
case (TAB_MODIFIER):
// move Modifier CTRL + Left
if (m_LBD && kCTRL && !kSHIFT)
{
float f = (float)u_deg2rad(-m_yRot + 90);
float dx = -(float)(Ldelta.x) * pDoc->m_modXYstep;
float dy = (float)(Ldelta.y) * pDoc->m_modXYstep;
pDoc->m_modY += float(sin(f) * dx + cos(f) * dy);
pDoc->m_modX += float(cos(f) * dx - sin(f) * dy);
g_Mod.MoveDelta(float(cos(f) * dx - sin(f) * dy), float(sin(f) * dx + cos(f) * dy));
UpdStatus = TRUE;
pDoc->m_bInvalidateGridPreview = TRUE;
Refresh = TRUE;
}
// inc Strength CTRL + Right
if (m_RBD && kCTRL && !kSHIFT && (mod != MOD_NONE))
{
pDoc->m_modStrength -= (float)(Rdelta.y) * 4.f;
g_Mod.HeightDelta(-(float)(Rdelta.y) * 4.f);
UpdStatus = TRUE;
pDoc->m_bInvalidateGridPreview = TRUE;
Refresh = TRUE;
}
// inc Radius SHIFT + Right
if (m_RBD && !kCTRL && kSHIFT && (mod != MOD_NONE))
{
pDoc->m_modRadius -= (float)(Rdelta.y) * 4.f;
g_Mod.RadiusDelta(-(float)(Rdelta.y) * 4.f);
if (pDoc->m_modRadius < 0)
{
pDoc->m_modRadius = 0;
}
UpdStatus = TRUE;
pDoc->m_bInvalidateGridPreview = TRUE;
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;
//.........这里部分代码省略.........