当前位置: 首页>>代码示例>>C++>>正文


C++ COperator::GetEditState方法代码示例

本文整理汇总了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();
		}
	}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:101,代码来源:AnimCamera.cpp


注:本文中的COperator::GetEditState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。