本文整理汇总了C++中Input::GetKeyUp方法的典型用法代码示例。如果您正苦于以下问题:C++ Input::GetKeyUp方法的具体用法?C++ Input::GetKeyUp怎么用?C++ Input::GetKeyUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Input
的用法示例。
在下文中一共展示了Input::GetKeyUp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessInput
void MazeMovement::ProcessInput(const Input& input, float delta)
{
if (!m_moving)
{
SetFrontTile();
if (input.GetKeyUp(Input::KEY_LEFT))
{
GetTransform()->Rotate(PxQuat(ToRadians(-90.0f), PxVec3(0, 1, 0)));
SetFrontTile();
}
if (input.GetKeyUp(Input::KEY_RIGHT))
{
GetTransform()->Rotate(PxQuat(ToRadians(90.0f), PxVec3(0, 1, 0)));
SetFrontTile();
}
if (input.GetKey(Input::KEY_UP))
{
switch (m_frontTile)
{
case 2:
m_ogPosition = *GetTransform()->GetPos();
m_desiredPosition = *GetTransform()->GetPos() + PxVec3(-GetTransform()->GetRot()->getBasisVector0().z, 0.0f, GetTransform()->GetRot()->getBasisVector0().x);
m_gridPosition = PxVec2(m_gridPosition.x - (int)GetTransform()->GetRot()->getBasisVector0().z, m_gridPosition.y + (int)GetTransform()->GetRot()->getBasisVector0().x);
SetFrontTile();
m_moving = true;
break;
}
}
if (input.GetKey(Input::KEY_DOWN))
{
switch (m_maze[(int)m_gridPosition.x + (int)GetTransform()->GetRot()->getBasisVector0().z][(int)m_gridPosition.y - (int)GetTransform()->GetRot()->getBasisVector0().x])
{
case 2:
m_ogPosition = *GetTransform()->GetPos();
m_desiredPosition = (*GetTransform()->GetPos() - PxVec3(-GetTransform()->GetRot()->getBasisVector0().z, 0.0f, +GetTransform()->GetRot()->getBasisVector0().x));
m_gridPosition = PxVec2(m_gridPosition.x + (int)GetTransform()->GetRot()->getBasisVector0().z, m_gridPosition.y - (int)GetTransform()->GetRot()->getBasisVector0().x);
SetFrontTile();
m_moving = true;
break;
}
}
if (input.GetKeyUp(Input::KEY_F) && m_frontTile == 3)
{
m_parent->GetEngine().Stop();
}
}
}
示例2: ProcessInput
void FreeLook::ProcessInput(const Input& input, float delta)
{
if (input.GetKeyUp(Input::KEY_LEFT))
{
GetTransform()->Rotate(PxQuat(ToRadians(-90.0f), PxVec3(0, 1, 0)));
}
if (input.GetKeyUp(Input::KEY_RIGHT))
{
GetTransform()->Rotate(PxQuat(ToRadians(90.0f), PxVec3(0, 1, 0)));
}
}
示例3: ProcessInput
void FreeMove::ProcessInput(const Input& input, float delta)
{
float movAmt = m_speed;
if (input.GetKeyUp(m_forwardKey))
Move(GetForward(*GetTransform()->GetRot()), movAmt);
if (input.GetKeyUp(m_backKey))
Move(GetBack(*GetTransform()->GetRot()), movAmt);
if ( input.GetKeyUp ( m_leftKey ) )
Move(GetLeft(*GetTransform()->GetRot()), movAmt);
if ( input.GetKeyUp ( m_rightKey ) )
Move(GetRight(*GetTransform()->GetRot()), movAmt);
}