| 77 | } |
| 78 | |
| 79 | void AFBCSample::update(float delta_time) |
| 80 | { |
| 81 | if (afbc_enabled != afbc_enabled_last_value) |
| 82 | { |
| 83 | recreate_swapchain(); |
| 84 | |
| 85 | afbc_enabled_last_value = afbc_enabled; |
| 86 | } |
| 87 | |
| 88 | /* Pan the camera back and forth. */ |
| 89 | auto &camera_transform = camera->get_node()->get_component<vkb::sg::Transform>(); |
| 90 | |
| 91 | elapsed_time += delta_time; |
| 92 | float rotation_factor = elapsed_time; |
| 93 | |
| 94 | glm::quat qy = glm::angleAxis(0.003f * sin(rotation_factor * 0.7f), glm::vec3(0.0f, 1.0f, 0.0f)); |
| 95 | glm::quat orientation = glm::normalize(qy * camera_transform.get_rotation() * glm::angleAxis(0.0f, glm::vec3(1.0f, 0.0f, 0.0f))); |
| 96 | camera_transform.set_rotation(orientation); |
| 97 | |
| 98 | VulkanSample::update(delta_time); |
| 99 | } |
| 100 | |
| 101 | void AFBCSample::recreate_swapchain() |
| 102 | { |
no test coverage detected