MCPcopy Create free account
hub / github.com/demoth/jake2 / Move

Method Move

client/src/main/java/jake2/client/IN.java:154–184  ·  view source on GitHub ↗
(usercmd_t cmd)

Source from the content-addressed store, hash-verified

152 }
153
154 public static void Move(usercmd_t cmd) {
155 if (!IN.mouse_avail)
156 return;
157
158 if (ClientGlobals.m_filter.value != 0.0f) {
159 KBD.mx = (KBD.mx + IN.old_mouse_x) / 2;
160 KBD.my = (KBD.my + IN.old_mouse_y) / 2;
161 }
162
163 IN.old_mouse_x = KBD.mx;
164 IN.old_mouse_y = KBD.my;
165
166 KBD.mx = (int) (KBD.mx * ClientGlobals.sensitivity.value);
167 KBD.my = (int) (KBD.my * ClientGlobals.sensitivity.value);
168
169 // add mouse X/Y movement to cmd
170 if ((CL_input.in_strafe.state & 1) != 0
171 || ((ClientGlobals.lookstrafe.value != 0) && IN.mlooking)) {
172 cmd.sidemove += ClientGlobals.m_side.value * KBD.mx;
173 } else {
174 ClientGlobals.cl.viewangles[YAW] -= ClientGlobals.m_yaw.value * KBD.mx;
175 }
176
177 if ((IN.mlooking || ClientGlobals.freelook.value != 0.0f)
178 && (CL_input.in_strafe.state & 1) == 0) {
179 ClientGlobals.cl.viewangles[PITCH] += ClientGlobals.m_pitch.value * KBD.my;
180 } else {
181 cmd.forwardmove -= ClientGlobals.m_forward.value * KBD.my;
182 }
183 KBD.mx = KBD.my = 0;
184 }
185
186 static void MLookDown() {
187 mlooking = true;

Callers 1

CreateCmdMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected