------------------------------ CelestialBodySystem::Process
| 25 | // CelestialBodySystem::Process |
| 26 | // |
| 27 | void 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 |
nothing calls this directly
no test coverage detected