MCPcopy Create free account
hub / github.com/Prograda/Skybolt / drawControlInputs

Function drawControlInputs

src/SkyboltExamples/ExamplesCommon/HudSystem.cpp:131–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static void drawControlInputs(VisHud& hud, const glm::vec2& position, const ControlInputsComponent& controlInputsComponents)
132{
133 float size = 0.1f;
134 float margin = 0.02f;
135
136 auto stick = controlInputsComponents.get<glm::vec2>("stick");
137 if (stick)
138 {
139 drawControl2d(hud, position, size, glm::vec2(stick->value.x, -stick->value.y));
140 }
141
142 auto pedal = controlInputsComponents.get<float>("pedal");
143 if (pedal)
144 {
145 drawHSlider(hud, position - glm::vec2(0.0f, size * 0.5f + margin), size, pedal->value * 0.5f + 0.5f);
146 }
147
148 auto collective = controlInputsComponents.get<float>("collective");
149 if (collective)
150 {
151 drawVSlider(hud, position - glm::vec2(size * 0.5f + margin, 0.0f), size, collective->value);
152 }
153}
154
155void HudSystem::updateState()
156{

Callers 1

updateStateMethod · 0.85

Calls 3

drawControl2dFunction · 0.85
drawHSliderFunction · 0.85
drawVSliderFunction · 0.85

Tested by

no test coverage detected