MCPcopy Create free account
hub / github.com/ddnet/ddnet / Absolute

Method Absolute

src/engine/client/input.cpp:256–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256bool CInput::CJoystick::Absolute(float *pX, float *pY)
257{
258 if(!Input()->m_MouseFocus || !Input()->m_InputGrabbed || !g_Config.m_InpControllerEnable)
259 return false;
260
261 const vec2 RawJoystickPos = vec2(GetAxisValue(g_Config.m_InpControllerX), GetAxisValue(g_Config.m_InpControllerY));
262 const float DeadZone = Input()->GetJoystickDeadzone();
263 if(dot(RawJoystickPos, RawJoystickPos) > DeadZone * DeadZone)
264 {
265 *pX = RawJoystickPos.x;
266 *pY = RawJoystickPos.y;
267 return true;
268 }
269 return false;
270}
271
272bool CInput::MouseRelative(float *pX, float *pY)
273{

Callers 1

OnCursorMoveMethod · 0.80

Calls 3

InputFunction · 0.85
dotFunction · 0.85
GetJoystickDeadzoneMethod · 0.80

Tested by

no test coverage detected