TabulaRasa/Source/Game/Player.cpp
void Player::AddMovementInput(const EMovementInputDirection& Direction, float Value)
{
	if (!Input::IsGameFrozen)
	{
		m_OldPosition = m_Position;
		switch (Direction)
		{
			case MID_FORWARD:
			{
				m_Position += m_MovementSpeed * m_pPlayerCamera->m_Front * Value;
				break;
			}
			case MID_BACKWARD:
			{
				m_Position -= m_MovementSpeed * m_pPlayerCamera->m_Front * Value;
				break;
			}
			case MID_RIGHT:
			{
				m_Position += m_MovementSpeed * m_pPlayerCamera->m_Right * Value;
				break;
			}
			case MID_LEFT:
			{
				m_Position -= m_MovementSpeed * m_pPlayerCamera->m_Right * Value;
				break;
			}
		}
		m_pPlayerCamera->UpdatePosition(m_Position);
	}
}
// TODO: Make it so that no input will ever reach this if the game is frozen, and 
// remove the "if (!Input::IsGameFrozen)" part
Make it so that no input will ever reach this if the game is frozen, and
remove the "if (!Input::IsGameFrozen)" part
Make it so that no input will ever reach this if the game is frozen and remove the " if ( !Input :: IsGameFrozen ) " part
void Player::AddMovementInput(const EMovementInputDirection& Direction, float Value)
{
	if (!Input::IsGameFrozen)
	{
		m_OldPosition = m_Position;
		switch (Direction)
		{
			case MID_FORWARD:
			{
				m_Position += m_MovementSpeed * m_pPlayerCamera->m_Front * Value;
				break;
			}
			case MID_BACKWARD:
			{
				m_Position -= m_MovementSpeed * m_pPlayerCamera->m_Front * Value;
				break;
			}
			case MID_RIGHT:
			{
				m_Position += m_MovementSpeed * m_pPlayerCamera->m_Right * Value;
				break;
			}
			case MID_LEFT:
			{
				m_Position -= m_MovementSpeed * m_pPlayerCamera->m_Right * Value;
				break;
			}
		}
		m_pPlayerCamera->UpdatePosition(m_Position);
	}
}
void Player :: AddMovementInput ( const EMovementInputDirection & Direction , float Value ) { if ( ! Input :: IsGameFrozen ) { m_OldPosition = m_Position ; switch ( Direction ) { case MID_FORWARD : { m_Position += m_MovementSpeed * m_pPlayerCamera -> m_Front * Value ; break ; } case MID_BACKWARD : { m_Position -= m_MovementSpeed * m_pPlayerCamera -> m_Front * Value ; break ; } case MID_RIGHT : { m_Position += m_MovementSpeed * m_pPlayerCamera -> m_Right * Value ; break ; } case MID_LEFT : { m_Position -= m_MovementSpeed * m_pPlayerCamera -> m_Right * Value ; break ; } } m_pPlayerCamera -> UpdatePosition ( m_Position ) ; } }
TODO: Make it so that no input will ever reach this if the game is frozen, and
remove the "if (!Input::IsGameFrozen)" part
TODO : Make it so that no input will ever reach this if the game is frozen and remove the " if ( !Input :: IsGameFrozen ) " part