MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / update

Method update

samples/performance/afbc/afbc.cpp:79–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void 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
101void AFBCSample::recreate_swapchain()
102{

Calls 2

get_nodeMethod · 0.45
set_rotationMethod · 0.45

Tested by

no test coverage detected