MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Poll

Method Poll

engine/Poseidon/Input/InfantryController.cpp:7–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5{
6
7VehicleControls InfantryController::Poll(float deltaT)
8{
9 auto& input = InputSubsystem::Instance();
10 VehicleControls ctrl;
11
12 ctrl.throttle = input.GetAction(UAMoveForward) - input.GetAction(UAMoveBack);
13 ctrl.steering = input.GetAction(UATurnRight) - input.GetAction(UATurnLeft);
14
15 ctrl.collective = input.GetAction(UAMoveUp) - input.GetAction(UAMoveDown);
16
17 ctrl.roll = input.GetAction(UAMoveRight) - input.GetAction(UAMoveLeft);
18
19 ctrl.fire = input.GetActionToDo(UAFire, false);
20 ctrl.toggleWeapons = input.GetActionToDo(UAToggleWeapons, false);
21 ctrl.reloadMagazine = input.GetActionToDo(UAReloadMagazine, false);
22 ctrl.optics = input.GetActionToDo(UAOptics, false);
23
24 ctrl.lookX = input.GetMouseDeltaX();
25 ctrl.lookY = input.GetMouseDeltaY();
26 ctrl.lookAround = input.IsLookAroundEnabled();
27
28 ctrl.turbo = input.GetAction(UATurbo) > 0.0f;
29 ctrl.slow = input.GetAction(UASlow) > 0.0f;
30
31 return ctrl;
32}
33} // namespace Poseidon

Callers

nothing calls this directly

Calls 5

GetActionToDoMethod · 0.80
GetMouseDeltaXMethod · 0.80
GetMouseDeltaYMethod · 0.80
IsLookAroundEnabledMethod · 0.80
GetActionMethod · 0.45

Tested by

no test coverage detected