MCPcopy Create free account
hub / github.com/Illation/ETEngine / Process

Method Process

Projects/Demo/source/Runtime/CelestialBodySystem.cpp:27–45  ·  view source on GitHub ↗

------------------------------ CelestialBodySystem::Process

Source from the content-addressed store, hash-verified

25// CelestialBodySystem::Process
26//
27void CelestialBodySystem::Process(fw::ComponentRange<CelestialBodySystemView>& range)
28{
29 // common variables
30 bool const toggle = (core::InputManager::GetInstance()->GetKeyState(E_KbdKey::R) == E_KeyState::Pressed);
31 float const dt = core::ContextManager::GetInstance()->GetActiveContext()->time->DeltaTime();
32
33 for (CelestialBodySystemView& view : range)
34 {
35 if (toggle)
36 {
37 view.body->isRotating = !(view.body->isRotating);
38 }
39
40 if (view.body->isRotating)
41 {
42 view.transf->Rotate(quat(vec3::UP, dt * view.body->rotationSpeed));
43 }
44 }
45}
46
47
48} // namespace demo

Callers

nothing calls this directly

Calls 4

GetKeyStateMethod · 0.80
DeltaTimeMethod · 0.80
GetActiveContextMethod · 0.80
RotateMethod · 0.80

Tested by

no test coverage detected