mouse controls, fixed texture loading
This commit is contained in:
@@ -30,6 +30,9 @@ void C_MOBAPlayer::Think( float fDelta )
|
||||
vCameraPos.z = 20;
|
||||
vCameraPos.y+=3;
|
||||
g_pWorldRenderer->SetCameraPosition(vCameraPos);
|
||||
Quat vCameraRot;
|
||||
glm_euler_yxz_quat((vec3){m_fPitch, m_fYaw, 0}, *(versor*)&vCameraRot);
|
||||
g_pWorldRenderer->SetCameraRotation(vCameraRot);
|
||||
}
|
||||
BaseClass::Think(fDelta);
|
||||
};
|
||||
@@ -127,3 +130,35 @@ static void IN_LeftUp( int c, char **v ) {
|
||||
((C_MOBAPlayer*)pPlayer)->m_bIsLeft = false;
|
||||
}
|
||||
static ConCommand endleft("-left", IN_LeftUp);
|
||||
|
||||
void Game_OnGameAxis( EInputDeviceType eDevice, EInputAxis eAxis, float fValue )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
static ConVar m_pitch("m_pitch", "0.022", FCVAR_CLIENTDLL);
|
||||
static ConVar m_yaw("m_yaw", "0.022", FCVAR_CLIENTDLL);
|
||||
static ConVar sens("sens", "3", FCVAR_CLIENTDLL);
|
||||
|
||||
void Game_OnGameAxisDiff( EInputDeviceType eDevice, EInputAxis eAxis, float fValue )
|
||||
{
|
||||
C_BaseEntity *pPlayer = UTIL_GetLocalPlayer();
|
||||
if (!pPlayer)
|
||||
return;
|
||||
if (!dynamic_cast<C_MOBAPlayer*>(pPlayer))
|
||||
return;
|
||||
switch(eAxis)
|
||||
{
|
||||
case k_EInputAxis_MouseY:
|
||||
((C_MOBAPlayer*)pPlayer)->m_fPitch -= glm_rad(fValue * m_pitch.GetFloat() * sens.GetFloat());
|
||||
break;
|
||||
case k_EInputAxis_MouseX:
|
||||
((C_MOBAPlayer*)pPlayer)->m_fYaw -= glm_rad(fValue * m_yaw.GetFloat() * sens.GetFloat());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user