本文整理汇总了C++中COperator::GetEditState方法的典型用法代码示例。如果您正苦于以下问题:C++ COperator::GetEditState方法的具体用法?C++ COperator::GetEditState怎么用?C++ COperator::GetEditState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COperator
的用法示例。
在下文中一共展示了COperator::GetEditState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEvent
//.........这里部分代码省略.........
if ( event.dwData == DIK_S )
{
vecVector = -m_pCamEx->getDIRECTION();
vecVector.y = 0;
vecVector.normalize();
vecVector *= MOVE_SPEED_RATIO;
MoveRTS(vecVector);
hitpoint.x += vecVector.x;
hitpoint.z += vecVector.z;
pOperator->SetHitPoint(hitpoint);
m_bResetVS = true;
}
// up another type
if ( event.dwData == DIK_Q )
{
vecVector = m_pCamEx->getDIRECTION();
vecVector *= MOVE_SPEED_RATIO;
MoveRTS(vecVector);
hitpoint.x += m_pCamEx->getDIRECTION().x;
hitpoint.y += m_pCamEx->getDIRECTION().y;
pOperator->SetHitPoint(hitpoint);
m_bResetVS = true;
CMapEditApp::GetInst()->GetOperator()->SetGPushed(false);
}
// down another type
if ( event.dwData == DIK_E )
{
vecVector = -m_pCamEx->getDIRECTION();
vecVector *= MOVE_SPEED_RATIO;
MoveRTS(vecVector);
hitpoint.x -= m_pCamEx->getDIRECTION().x;
hitpoint.y -= m_pCamEx->getDIRECTION().y;
pOperator->SetHitPoint(hitpoint);
m_bResetVS = true;
CMapEditApp::GetInst()->GetOperator()->SetGPushed(false);
}
}
}
break;
case EIET_MS_WHEEL :
{
vecVector = -m_pCamEx->getDIRECTION();
vecVector.normalize();
vecVector *= -event.fData*ZOOM_SPEED_RATIO;
Zoom(vecVector);
hitpoint.x += vecVector.x;
hitpoint.z += vecVector.z;
pOperator->SetHitPoint(hitpoint);
m_bResetVS = true;
}
break;
case EIET_MS_MOVE :
{
if ( CInputDevice::GetInst()->GetButtonState(MK_RBUTTON) ) // right button down rotate
{
if( pOperator->GetEditState() == COperator::EES_SET_TILE_BLOCK )
return;
if ( m_bRotate )
{
int x,y;
CInputDevice::GetInst()->GetMouseDelta(x,y);
float pitch = 0.004f * y;
float yaw = 0.004f * x;
// ÈÆ×ÔÉíÐýת
Rotate(yaw, pitch);
m_bResetVS = true;
CMapEditApp::GetInst()->GetOperator()->SetGPushed(false);
}
}
if ( CInputDevice::GetInst()->GetButtonState(MK_MBUTTON) )
{
int x,y;
CInputDevice::GetInst()->GetMouseDelta(x,y);
vecVector = -m_pCamEx->getDIRECTION();
vecVector *= y*ZOOM_SPEED_RATIO;
Zoom(vecVector);
m_bResetVS = true;
CMapEditApp::GetInst()->GetOperator()->SetGPushed(false);
}
}
break;
default:
break;
}
if ( m_bResetVS )
{
CMapEditApp::GetInst()->GetOperator()->UpdateParamsView();
}
}